You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
8
+
9
+
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).
10
+
11
+
Now consider if some obstacles are added to the grids. How many unique paths would there be?
12
+
13
+
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
14
+
15
+
#### Example
16
+
17
+
<pre>
18
+
19
+
Input:
20
+
[
21
+
[0,0,0],
22
+
[0,1,0],
23
+
[0,0,0]
24
+
]
25
+
Output: 2
26
+
Explanation:
27
+
There is one obstacle in the middle of the 3x3 grid above.
28
+
There are two ways to reach the bottom-right corner:
0 commit comments