Fewest Fuel Stops
A car starts with start_fuel litres and uses one litre per kilometre. stations[i] = [position, litres], sorted by position. Return the minimum number of refuelling stops to reach target kilometres, or -1 if it is impossible.
Examples
A guided view of the published example, not a trace of your code.
[1,1,[]]0Start with the input values shown in this example.
Input: target = 1, start_fuel = 1, stations = []
Output: 0
Explanation: already there
Input: target = 100, start_fuel = 1, stations = [[10,100]]
Output: -1
Explanation: can't reach
Input: target = 100, start_fuel = 10, stations = [[10,60],[20,30],[30,30],[60,40]]
Output: 2
Explanation: two stops
Hint 1
Drive as far as possible. Each time you can't reach the next point, refuel retroactively from the largest station you passed (a max-heap).