← 返回 meta 的题目列表K Closest Points to Origin in 2D Plane
类型:online_judge
meta
Given an array of points points on a 2D plane and an integer k, return the k closest points to the origin (0, 0).
Example:
Input: points = [[1, 3], [-2, 2]], k = 1
Output: [[-2, 2]]
Constraints:
1 <= points.length <= 10^4
-10^4 < points[i][0], points[i][1] < 10^4
1 <= k <= points.length
Example
Input
[[1,3],[-2,2]] 1