Expedition code(greedy)

i didn’t understand the logic that if we cross some fuel stations after that we realise we have to use that station…how we are to using it…for going to that station we need fuel(which we dont have)…

hello @tishya_goyal
we are trying to reach as far as possible from starting location by using currently existing fuel.
if at some point we realise that we cannot move ahead then we are taking fuel from previously visited station that is having maximum fuel among all visited fuel stations.
for that we are using priority queue.