Petrol Pump-> find error in my approach

Can you plz find error in my code.
why it will not passed 2nd and 4th testcases.

hello @imadarshanand

ur code is correct. there can be multple valid solution , and cb checker is not able to detect all possible solution thats why it is giving error.

try to submit here->link

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.