送分题
class Solution(object): def kClosest(self, points, K): """ :type points: List[List[int]] :type K: int :rtype: List[List[int]] """ dst, ret = {}, [] for i, val in enumerate(points): dst[i] = val[0] ** 2 + val[1] ** 2 dst = sorted(dst.items(), key=lambda d:d[1]) for key,val in dst: ret.append(points[key]) return ret[:K]