Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Minimum Number of Refueling Stops
Bookmark
Input
Example 1
Impossible
Already there
Two stations
Custom
target
=
100
,
startFuel
=
10
,
stations
=
[[10,60],[20,30],[30,30],[60,40]]
stations
max-heap (fuel)
60
30
30
40
algo
master
.
io
Step:
Start: Initialize algorithm
Variable
Value
target
100
startFuel
10
fuel
-
stops
-
prev
-
Variable
Value
i
-
currPos
-
heap
-
return
-
0 / 23
Input
Example 1
Impossible
Already there
Two stations
Custom
target
=
100
,
startFuel
=
10
,
stations
=
[[10,60],[20,30],[30,30],[60,40]]
0 / 23
stations
max-heap (fuel)
60
30
30
40
algo
master
.
io
Step:
Start: Initialize algorithm
Visualization
Variables