Minimize the maximum elevation you must tolerate along a path.
Dijkstra on states (r,c) where path cost is max(elevation on path).
Relax neighbor with newCost = max(currentCost, grid[nr][nc]).
This is a shortest-path problem under the minimax metric; Dijkstra applies because relaxation is monotone.
Minimize the maximum elevation you must tolerate along a path.
Dijkstra on states (r,c) where path cost is max(elevation on path).
Relax neighbor with newCost = max(currentCost, grid[nr][nc]).
This is a shortest-path problem under the minimax metric; Dijkstra applies because relaxation is monotone.