Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Unique Paths III
Backtracking
Bitmask DP
1
uniquePathsIII(grid, 0, 0, 9)
3x3 Simple
3x3 With Obstacle
3x4 Grid
grid
=
[[1,0,0],[0,0,0],[0,0,2]]
S
E
0
1
2
0
1
2
remaining
9
paths
0
S
E
0
1
2
0
1
2
remaining
9
paths
0
S
E
0
1
2
0
1
2
remaining
2
paths
1
S
E
0
1
2
0
1
2
remaining
4
paths
1
S
E
0
1
2
0
1
2
remaining
5
paths
1
S
E
0
1
2
0
1
2
remaining
3
paths
1
S
E
0
1
2
0
1
2
remaining
3
paths
1
S
E
0
1
2
0
1
2
remaining
4
paths
1
S
E
0
1
2
0
1
2
remaining
5
paths
1
S
E
0
1
2
0
1
2
remaining
2
paths
1
S
E
0
1
2
0
1
2
paths found
2
Step:
Start: Find all paths from S to E visiting every empty cell. Grid is 3x3, 9 non-obstacle cells to visit.
0 / 354
3x3 Simple
3x3 With Obstacle
3x4 Grid
grid
=
[[1,0,0],[0,0,0],[0,0,2]]
0 / 354
Step:
Start: Find all paths from S to E visiting every empty cell. Grid is 3x3, 9 non-obstacle cells to visit.
1
uniquePathsIII(grid, 0, 0, 9)