Skip to main content
K Closest Points to Origin | AlgoCracked
AlgoCracked
ProblemsK Closest Points to Origin
Medium66.0% acceptance
Blind75ArrayMathDivide And ConquerSorting

K Closest Points to Origin

Given an array of points on the plane ( points[i] = [x, y] ) and an integer k , return the k points closest to the origin (0, 0) , measured by Euclidean distance. You may return them in any order . Input format Input is [points, k] , e.g. [[[1,3],[-2,2]],1] .

Loading workspace…