Given a list of points on a 2D plane and an integer k, return the k points closest to the origin (0, 0) using Euclidean distance. The order of the returned points does not matter.
Input
points: array of [x, y] pairs
k: number of closest points to return
Output
An array of the k closest points to the origin.
Examples
Example 1
Inputpoints = [[0, 0], [1, 1]], k = 1
Output[[0, 0]]
Example 2
Inputpoints = [[1, 1], [2, 2], [3, 3]], k = 1
Output[[1, 1]]
Constraints
1 <= k <= points.length <= 10^5.