class Solution(object):
def kClosest(self, points, K):
"""
:type points: List[List[int]]
:type K: int
:rtype: List[List[int]]
"""
res = []
for item in points:
a = lambda x: x[0]**2 + x[1]**2
points.sort(key=a)
return points[:K]
相关文章: