Code
The highlighted line runs next. The pill shows the live values in the running call.
Variables
The data structures the code is building
The grid
Darker = higher ground; blue = under water
grid[i][j] is the height of each square. At time t the water level is t, and you can swim between adjacent squares whose heights are both ≤ t. Return the least time to get from the top-left to the bottom-right.
The highlighted line runs next. The pill shows the live values in the running call.
The data structures the code is building
Darker = higher ground; blue = under water
n = grid side, so there are n² cells. The highlighted row is the solution being traced.
Keyboard: ← → step, Space play or pause. Square grids up to 6×6 using each number from 0 to n² − 1 once.