Skip to content

Commit 49639a6

Browse files
committed
minor fix
1 parent 9de1734 commit 49639a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

introduction/quickstart.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def backtrack(选择列表, 路径):
4646
for 选择 in 选择列表: # 遍历选择,就不会重复了
4747
做选择
4848
backtrack(新选择列表, 新路径)
49-
撤销选择
50-
return # 部分循环中,循环结束依然无解
49+
撤销选择 # 选择放在函数参数临时变量的话,不必显式撤销选择,参见lc301(删括号,hard也能写得漂亮)等题。
50+
return # 代码函数严谨性def - return对应,其实最后自动return
5151
```
5252

5353
- 通过不停的选择,撤销选择,来穷尽所有可能性,最后将满足条件的结果返回。答案代码:
@@ -62,7 +62,6 @@ class Solution:
6262
if len(route) == k:
6363
result.append(route.copy())
6464
return
65-
6665
for i in range(start, n):
6766
route.append(nums[i])
6867
backtrack(i + 1, route, k)

0 commit comments

Comments
 (0)