Petrol Pump problem

Hi,
Here is my code

This has been submitted successfully on Leetcode but failing two test cases on CB.
Can you please help for the same.

Thanks

Hey @mohanman2210
Logic looks good ,so maybe language specific issue . I am forwarding your doubt as I don’t know Java.