Company: Uber_all
Difficulty: medium
Minimize Maximum Distance to Hub Problem Description Uber is planning to roll out driver hubs across a new city. The city is modeled as a grid, where each cell represents a neighborhood. A driver hub allows nearby drivers to recharge, rest, and get support. The objective is to place exactly n driver hubs such that the maximum distance any neighborhood has to its nearest hub is minimized. Movement across the grid is restricted to up, down, left, and right only (no diagonal shortcuts). Function Description Complete the function findMinDistance in the editor with the following parameter(s): int w : the width of the grid int h : the height of the grid int n : the number of driver hubs to place Returns int : the maximum value among the shortest distances to the closest driver hub for each cell. Examples Example 1: Consider a grid with: w = 4 (width) h = 4 (height) n = 3 (number of driver hubs) Explanation: An optimal placement would ensure that any lot is within two units distance of a driv