Doubt in Expedition Spoj

At 13:10, after reaching fuel tank with capacity of 2, how we are refiling at fuel tank of capacity 5, I mean the previous tank?

hello @gambhirrahul0

yeah that correct.
the idea is if we have reached to point where we need to more fuel , then the optimal step is to pick that previously enountered fuel station (that we never used) which has highest fuel capacity.

here in example when we reach 2 , we need more fuel and becuase 5 is the fuel tank which we have never used, it is optimal to use it here.

Still I’m confused. Will you please elaborate?

bro reaching to particular fuel tank i doest mean that we have used all the fuel tank that we have encountered till now.
there may be some fuel tanks which we have come across but we have not used till now. so what we are doing is we are keeping buffer of such fuel tanks and whenever we need more fuel we will pick fuel with maxium capacity from this buffer .

rewatch the video if it is still not clear

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.