Heap
K Closest Points
Given a list of points on a 2D plane. Find k closest points to the origin (0, 0)
.
Input: [(1, 1), (2, 2), (3, 3)], 1
Output: [(1, 1)]
You are on levelĀ Student
Given a list of points on a 2D plane. Find k closest points to the origin (0, 0)
.
Input: [(1, 1), (2, 2), (3, 3)], 1
Output: [(1, 1)]
Monster Assistant is thinking...