tank
to startFuel
and stops
to 0.tank
) is less than the distance to the next station, refuel from the max-heap until we can reach the next station or the heap is empty.
b. Increase stops
each time we refuel.
c. If we can't reach the next station and the heap is empty, return -1.tank
) is less than the distance to the target, continue refueling from the max-heap.