• + 0 comments

    Python Solution

    • def truckTour(petrolpumps):
    • fuel=0
    • pos=0
    • for i in range(len(petrolpumps)):
    • fuel+=petrolpumps[i][0]-petrolpumps[i][1]
    • if fuel<0:
    • fuel=0
    • pos=i+1
    • return pos