Search
⌘K

Leetcode 1779. Find Nearest Point That Has the Same X or Y Coordinate

Given your location (x,y) and a list of points, find the index of a point that shares either the same x or y coordinate and has the smallest Manhattan distance to you (break ties by smallest index); return -1 if no such point exists.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.