DIY: K Closest Points to Origin
Problem statement
We have a list of points on the plane. Find the K
closest points to the origin (0, 0)
.
Note: Here, the distance between two points on a plane is the Euclidean distance.
Input
The ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy