63. Unique Paths II
# Medium
similar to #62
If grid[x][y]
is blocked, sumPath[x][y] = 0
If grid[x][y]
isn't blocked, sumPath[x][y]=sumPath[x-1][y]+sumPath[x][y-1]
Solution:
Initialize first row and first column of paths
compute other elements of paths
Python example:
这道题思路简单,但是一次性不容易写对。考虑[[1,0]]的情况
Last updated
Was this helpful?