Follow up for"Unique Paths":
Now consider ifsome obstacles are added tothe grids. How many unique paths would there be?
An obstacle and empty spaceis marked as1and0 respectively inthe grid.
For example,
There is one obstacle inthemiddleof a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,0,0]
]
The total numberof unique paths is2.
Follow up for"Unique Paths":
Now consider ifsome obstacles are added tothe grids. How many unique paths would there be?
An obstacle and empty spaceis marked as1and0 respectively inthe grid.
For example,
There is one obstacle inthemiddleof a 3x3 grid as illustrated below.
[
[0,0,0],
[0,1,0],
[0,0,0]
]
The total numberof unique paths is2.
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 ex