Imagine you're a city planner tasked with optimizing the placement of emergency services. You have several potential locations on a 2D grid, and you need to minimize the worst-case response time by strategically removing exactly one location.
Given an array points where points[i] = [xi, yi] represents coordinates on a 2D plane, you need to find the minimum possible maximum Manhattan distance between any two points after removing exactly one point.
The Manhattan distance between two points (x1, y1) and (x2, y2) is calculated as: |x1 - x2| + |y1 - y2|
Goal: Remove one point to minimize the maximum distance between any remaining pair of points.
Input & Output
Visualization
Time & Space Complexity
Two passes: one to find extremes, one to test removing each extreme point
Store transformed coordinates and track extreme points
Constraints
- 3 โค points.length โค 105
- points[i].length == 2
- -108 โค points[i][0], points[i][1] โค 108