2 Star 1 Fork 0

royce li/Leetcode_royce

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
canCompleteCircuit.py 544 Bytes
Copy Edit Raw Blame History
Royce Li authored 2021-05-10 16:39 . 2020/5/10 First Commit
# class Solution:
# def canCompleteCircuit(self, gas: List[int], cost: List[int]) -> int:
# for i in range(len(gas)):
# if gas[i]>=cost[i]:
# count=i+1
# gases=gas[i]-cost[i]
# while count%len(gas)!=i:
# gases+=gas[count%len(gas)]-cost[count%len(gas)]
# if gases<0:
# break
# count+=1
# if count%len(gas)==i:
# return i
# return -1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/royce-li/leetcode_royce.git
git@gitee.com:royce-li/leetcode_royce.git
royce-li
leetcode_royce
Leetcode_royce
master

Search