Search
⌘K

Leetcode 2617. Minimum Number of Visited Cells in a Grid

Find the minimum number of cells visited to reach bottom-right in an m×n grid when from (i,j) you can jump right to any (i,k) with j<k<=j+grid[i][j] or down to any (k,j) with i<k<=i+grid[i][j]; this is a shortest-path problem with range-based moves that requires efficient enumeration of unvisited cells (m*n up to 1e5) to avoid scanning full ranges.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.