Minimum Number of Visited Cells in a Grid
Shortest-path DP on a grid: each cell's distance is one more than the best cell that can jump into it along its row or column.
Shortest-path DP on a grid: each cell's distance is one more than the best cell that can jump into it along its row or column.