Merge pull request #2490 from shuaigewudi/master
修改 0039.组合总和.md:修改python代码错误,将continue改为break
This commit is contained in:
commit
7c5e1c54e2
|
|
@ -311,7 +311,7 @@ class Solution:
|
||||||
|
|
||||||
for i in range(startIndex, len(candidates)):
|
for i in range(startIndex, len(candidates)):
|
||||||
if total + candidates[i] > target:
|
if total + candidates[i] > target:
|
||||||
continue
|
break
|
||||||
total += candidates[i]
|
total += candidates[i]
|
||||||
path.append(candidates[i])
|
path.append(candidates[i])
|
||||||
self.backtracking(candidates, target, total, i, path, result)
|
self.backtracking(candidates, target, total, i, path, result)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue