K closest points to the origin

0
Remix

Given points in the plane and k, return the k points nearest to the origin in any order. Start simple (sort by distance), then improve with a size-k max-heap or quickselect and compare the costs.

MetaTechnical phone screenLast asked Oct 2025
No answer yet. Write the first one; the best answer gets endorsed.