Skip to content

Commit 2b0ca46

Browse files
Merge pull request #2879 from lewiseng/patch-1
Update 0216.组合总和III.md
2 parents ce6e658 + 7f5ce0a commit 2b0ca46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problems/0216.组合总和III.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class Solution:
365365

366366
def backtracking(self, targetSum, k, currentSum, startIndex, path, result):
367367
if currentSum > targetSum: # 剪枝操作
368-
return # 如果path的长度等于k但currentSum不等于targetSum,则直接返回
368+
return # 如果currentSum已经超过targetSum,则直接返回
369369
if len(path) == k:
370370
if currentSum == targetSum:
371371
result.append(path[:])

0 commit comments

Comments
 (0)