BNY Mellon OA | Optimal Point for Minimum Manhattan Distance to Axis-Aligned Segments Problem Statement
Question · Posted Apr 2026
Problem Statement Given the endpoints of n line segments in a 2D plane, where each segment is parallel to either the x-axis or the y-axis, your task is to find an integer point p on the coordinate plane such that the sum of the distances from point p to these n line segments is minimized. Tie-Breaking Rules: If multiple points result in the same minimum sum of distances, choose the point using the following priority: Return the one with the ...
The full answer & interview discussion are available to premium members.
Log in Create a free account