Maximum Number of Moves in a Grid
Sweep the grid column by column, recording the most moves that can reach each cell from a strictly smaller neighbour.
Sweep the grid column by column, recording the most moves that can reach each cell from a strictly smaller neighbour.