Commit dda0b20 1 parent a1359e0 commit dda0b20 Copy full SHA for dda0b20
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -503,7 +503,7 @@ func letterCombinations(_ digits: String) -> [String] {
503
503
504
504
var result = [String]()
505
505
var s = ""
506
- func backtracking(digits: [Int], index: Int) {
506
+ func backtracking(index: Int) {
507
507
// 结束条件:收集结果
508
508
if index == digits.count {
509
509
result.append(s)
@@ -514,11 +514,11 @@ func letterCombinations(_ digits: String) -> [String] {
514
514
let letters = letterMap[digits[index]]
515
515
for letter in letters {
516
516
s.append(letter) // 处理
517
- backtracking(digits: digits, index: index + 1) // 递归,记得+1
517
+ backtracking(index: index + 1) // 递归,记得+1
518
518
s.removeLast() // 回溯
519
519
}
520
520
}
521
- backtracking(digits: digits, index: 0)
521
+ backtracking(index: 0)
522
522
return result
523
523
}
524
524
```
You can’t perform that action at this time.
0 commit comments