Given an array of points [x, y] on a plane, find the k closest points to the origin (0, 0).
No need to compute actual square root — compare squared distances instead (preserves ordering):
This is the same "top K" heap pattern as Kth Largest — just with a custom comparison value.
k_closest([[1,3],[-2,2]], 1)
[[-2, 2]]
sorted(k_closest([[3,3],[5,-1],[-2,4]], 2))
[[-2, 4], [3, 3]]