...

/

K Closest Points to Origin

K Closest Points to Origin

Try to solve the K Closest Points to Origin problem.

Statement

Given a list of points on a plane, where the plane is a 2-D array with (x, y) coordinates, find the kk closest points to the origin (0,0)(0, 0).

Note: Here, the distance between two points on a plane is the Euclidean distance: x2+y2 \sqrt{x^2 + y^2} ...