973. 最接近原点的 K 个点

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]

相关文章:

  • 2022-12-23
  • 2022-01-15
  • 2022-01-23
  • 2021-10-16
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
猜你喜欢
  • 2022-12-23
  • 2021-11-16
  • 2021-09-28
  • 2021-12-25
  • 2021-11-24
  • 2021-10-09
  • 2022-12-23
相关资源
相似解决方案