Skip to content

Commit

Permalink
Merge pull request youngyangyang04#2503 from jycoast/master
Browse files Browse the repository at this point in the history
Update 0017.电话号码的字母组合.md
  • Loading branch information
youngyangyang04 authored May 1, 2024
2 parents b07e850 + 96e9fcb commit b23f1a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions problems/0017.电话号码的字母组合.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class Solution {

}

//每次迭代获取一个字符串,所以会设计大量的字符串拼接,所以这里选择更为高效的 StringBuilder
//每次迭代获取一个字符串,所以会涉及大量的字符串拼接,所以这里选择更为高效的 StringBuilder
StringBuilder temp = new StringBuilder();

//比如digits如果为"23",num 为0,则str表示2对应的 abc
Expand All @@ -274,7 +274,7 @@ class Solution {
String str = numString[digits.charAt(num) - '0'];
for (int i = 0; i < str.length(); i++) {
temp.append(str.charAt(i));
//c
//递归,处理下一层
backTracking(digits, numString, num + 1);
//剔除末尾的继续尝试
temp.deleteCharAt(temp.length() - 1);
Expand Down

0 comments on commit b23f1a9

Please sign in to comment.