63. Unique Paths II
Practice Unique Paths II for free on NudgeCode: Medium, Dynamic Programming pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
A robot starts at the top-left cell of a grid and wants to reach the bottom-right cell, moving only right or down. Cells marked 1 are blocked and cells marked 0 are open. Return how many different routes avoid every blocked cell.
Example
obstacleGrid = [[0,0,0],
[0,1,0],
[0,0,0]] -> 2
obstacleGrid = [[0,1],[0,0]] -> 1
Constraints
- 1 <= rows, cols <= 100
- Each cell is 0 or 1
- The answer fits in a 32-bit signed integer