Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Number of Ways to Arrive at Destination
Bookmark
Input
Standard
Small
Diamond
Custom
n
=
7
,
roads
=
[[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]
7
2
3
3
3
1
1
1
5
2
0
1
2
3
4
5
6
dist[]
0
0
1
∞
2
∞
3
∞
4
∞
5
∞
6
∞
ways[]
1
0
0
0
0
0
0
Default
Processing
Finalized
algo
master
.
io
Step:
Start: Number of Ways to Arrive at Destination
0 / 45
Input
Standard
Small
Diamond
Custom
n
=
7
,
roads
=
[[0,6,7],[0,1,2],[1,2,3],[1,3,3],[6,3,3],[3,5,1],[6,5,1],[2,5,1],[0,4,5],[4,6,2]]
0 / 45
7
2
3
3
3
1
1
1
5
2
0
1
2
3
4
5
6
dist[]
0
0
1
∞
2
∞
3
∞
4
∞
5
∞
6
∞
ways[]
1
0
0
0
0
0
0
Default
Processing
Finalized
algo
master
.
io
Step:
Start: Number of Ways to Arrive at Destination