Approach Summary
Min-heap (Dijkstra-style): always expand the cell with the minimum elevation. Track the maximum elevation seen to reach (n-1, n-1).
How to Recognize This Pattern
- "Minimum time/elevation to reach target — choose min-cost path"
- Modified Dijkstra: cost = max elevation on the path
Complexity Analysis
Time Complexity
O(n² log n)
Space Complexity
O(n²)
Tags
Array Binary Search DFS BFS Union-Find Heap Matrix