Problem 2617 · Hard

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.

Open the interactive visualisation