标签:style blog color io os ar for sp div
class Solution: # @param gas, a list of integers # @param cost, a list of integers # @return an integer def canCompleteCircuit(self, gas, cost): additional_gas=[] for i in range(len(gas)): additional_gas.append(gas[i]-cost[i]) if sum(additional_gas)<0: return -1 start=0 for i in range(1,len(gas)): if (additional_gas[i]>=0 and additional_gas[i-1]<0): start=i return start
标签:style blog color io os ar for sp div
原文地址:http://www.cnblogs.com/iois/p/4042484.html