all the testcases are wrong but it is all correct at testing…
can you spot the error.
Deepak and his journey
You need just multiply the minimum cost till ith position with the amount of petrol in ith position and calculate their sum.
Yup Your code is looking fine. Change datatype of int to long long and then try.