Sift
Closed this issue · 1 comments
darrenfu commented
11/15/2019
973. K Closest Points to Origin
darrenfu commented
Suboptimal solution is to use a K-size max-heap, using heapq.pushpop() since the (K+1)-th element. Time complexity: O(N*logK).
Optimal solution would be quick select.