There are N gas stations along a circular route, where the amount of gas at station i is gas[i]
.
You have a car with an unlimited gas tank and it costs cost[i]
of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations.
Return the starting gas station's index if you can travel around the circuit once, otherwise return -1.
题意:n个加油站分布在一个环形的跑道内,每个加油站可以加gas[i],假设只能顺时针跑,每个加油站到下一个加油站需要耗掉cost[i],开始时车的油箱没有油,找到那个可以作为起点的加油站可以让这辆车沿着这条跑道跑一圈。