Problem 1779 · Easy

Find Nearest Point That Has the Same X or Y Coordinate

Find the nearest point sharing x or y with the reference point, breaking ties by input index.

Open the interactive visualisation