mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-07 15:45:40 +08:00
Update 0017.电话号码的字母组合.md
This commit is contained in:
@ -260,7 +260,7 @@ class Solution {
|
||||
|
||||
}
|
||||
|
||||
//每次迭代获取一个字符串,所以会设计大量的字符串拼接,所以这里选择更为高效的 StringBuilder
|
||||
//每次迭代获取一个字符串,所以会涉及大量的字符串拼接,所以这里选择更为高效的 StringBuilder
|
||||
StringBuilder temp = new StringBuilder();
|
||||
|
||||
//比如digits如果为"23",num 为0,则str表示2对应的 abc
|
||||
@ -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);
|
||||
|
Reference in New Issue
Block a user