Search
⌘K

Leetcode 1301. Number of Paths with Max Score

Given an n×n board with digits, obstacles 'X', start 'S' (bottom-right) and end 'E' (top-left), find the maximum sum of digits collectible moving only up, left, or up-left and the number of distinct paths that achieve that maximum (mod 1e9+7). This is a DP problem where each cell tracks the best sum reachable and the count of ways to reach that best sum, returning [maxSum, count] or [0,0] if unreachable.


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.