Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Path With Minimum Effort
Bookmark
Input
Example 1 (ans: 2)
Example 2 (ans: 1)
Example 3 (ans: 0)
Custom
heights
=
[[1,2,2],[3,8,2],[5,3,5]]
1
e:0
S
2
e:inf
2
e:inf
3
e:inf
8
e:inf
2
e:inf
5
e:inf
3
e:inf
5
e:inf
D
min-heap (effort, row, col)
Default
Active
Visited
Checking
algo
master
.
io
Step:
Start: Initialize effort grid. effort[0][0] = 0, all others = infinity. Push (0, 0, 0) into min-heap.
0 / 59
Input
Example 1 (ans: 2)
Example 2 (ans: 1)
Example 3 (ans: 0)
Custom
heights
=
[[1,2,2],[3,8,2],[5,3,5]]
0 / 59
1
e:0
S
2
e:inf
2
e:inf
3
e:inf
8
e:inf
2
e:inf
5
e:inf
3
e:inf
5
e:inf
D
min-heap (effort, row, col)
Default
Active
Visited
Checking
algo
master
.
io
Step:
Start: Initialize effort grid. effort[0][0] = 0, all others = infinity. Push (0, 0, 0) into min-heap.