I am unabvle to pass any test case for the above mentioned problem, even though I think my logic is correct.
I am keeping a track of min cost of petrol I have witnessed so far and them purchasing the required amount of pretrol from there. Still all the test cases give a wrong answer. Please help
My code : https://ide.codingblocks.com/s/424831