K Closest Points to Origin (N log K)

Given a 2D integer array points where points[i] = [xi, yi] represents a point on the plane, and an integer K, return the K points closest to the origin (0,0) (Euclidean distance).

Requireme...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: