diff --git "a/problems/0134.\345\212\240\346\262\271\347\253\231.md" "b/problems/0134.\345\212\240\346\262\271\347\253\231.md" index 5c8b0c3cc8..f80cbd441d 100755 --- "a/problems/0134.\345\212\240\346\262\271\347\253\231.md" +++ "b/problems/0134.\345\212\240\346\262\271\347\253\231.md" @@ -238,7 +238,7 @@ class Solution { curSum += gas[i] - cost[i]; totalSum += gas[i] - cost[i]; if (curSum < 0) { - index = (i + 1) % gas.length ; + index = (i + 1); curSum = 0; } } @@ -247,7 +247,7 @@ class Solution { } } ``` -``` +```java // 解法3 class Solution { public int canCompleteCircuit(int[] gas, int[] cost) {