Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Open the Lock
Bookmark
Input
Simple: target 0009 (1 turn)
Quick: target 0001 (1 turn)
Blocked: some neighbors dead
Impossible: start boxed in
Custom
deadends
=
[8888]
,
target
=
0009
queue
algo
master
.
io
Step:
Start: Find minimum turns to open the lock using BFS
0 / 115
Input
Simple: target 0009 (1 turn)
Quick: target 0001 (1 turn)
Blocked: some neighbors dead
Impossible: start boxed in
Custom
deadends
=
[8888]
,
target
=
0009
0 / 115
queue
algo
master
.
io
Step:
Start: Find minimum turns to open the lock using BFS