Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1
and 0
respectively
in the grid.
For example,
There is one obstacle in the middle of a 3x3 grid as illustrated below.
The total number of unique paths is 2
.
Note: m and n will be at most 100.
和62题1致,在转移的时候加1个特判条件,只有是空地的时候才转移。http://blog.csdn.net/accepthjp/article/details/52585069