Fundamentals
/
Nearest Cities
⏸
00:00
↻
← Prev
Next →
▶
Question
Given arrays of city names with x and y coordinates and a list of query city names, return for each query the nearest city sharing the same x or y coordinate (closest by Manhattan distance, ties broken alphabetically), or null if none.
▶
Understand
▶
Approach
▶
My Code
▶
Reference Solution
Compare
23