Optimal Algorithmic Approach
Max-heap of size K: evict the farthest point when heap exceeds K.
Core Invariants & Edge Cases
- Compare squared distances to avoid sqrt
- Max-heap of size K: if new point closer than max, replace it
- Alternatively quickselect for O(n) average