Grid path that keeps its highest cell as low as possible
Each cell of an m x n grid holds a height. Find a path from the top-left to the bottom-right cell, moving up, down, left or right, whose highest cell is as low as possible, and return that height (the smallest threshold that still allows a path).
Solve it with Dijkstra on the maximum, or with binary search on the threshold plus BFS. Follow-ups: could DFS work, and what are the time complexities?
No answer yet. Write the first one; the best answer gets endorsed.
