Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Shortest Path in Binary Matrix
Bookmark
BFS
A* Search
Input
Example 1
3x3 clear
3x3 blocked
4x4
Custom
grid
=
[[0,1],[1,0]]
0
1
1
0
queue
Open
Blocked
Visited
0
1
1
0
queue
Open
Blocked
Visited
1
1
1
0
(0,0,1)
front / rear
queue
Open
Blocked
Visited
1
1
1
0
queue
Open
Blocked
Visited
1
1
1
0
queue
Open
Blocked
Visited
1
1
1
0
queue
Open
Blocked
Visited
1
1
1
0
queue
Open
Blocked
Visited
1
1
1
2
(1,1,2)
front / rear
queue
Open
Blocked
Visited
1
1
1
2
(1,1,2)
front / rear
queue
Open
Blocked
Visited
1
1
1
2
queue
Open
Blocked
Visited
1
1
1
2
queue
Open
Blocked
Visited
algo
master
.
io
Step:
Find the shortest clear path across this 2x2 matrix
0 / 16
Input
Example 1
3x3 clear
3x3 blocked
4x4
Custom
grid
=
[[0,1],[1,0]]
0 / 16
algo
master
.
io
Step:
Find the shortest clear path across this 2x2 matrix