Skip to content

Commit

Permalink
添加 0017.电话号码的字母组合.md Java版本
Browse files Browse the repository at this point in the history
  • Loading branch information
nanhuaibeian committed May 12, 2021
1 parent 5a799c6 commit c2fd043
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions problems/0017.电话号码的字母组合.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public:
Java:
```Java
class Solution {

//设置全局列表存储最后的结果
List<String> list = new ArrayList<>();

Expand Down Expand Up @@ -271,6 +272,7 @@ class Solution {
String str = numString[digits.charAt(num) - '0'];
for (int i = 0; i < str.length(); i++) {
temp.append(str.charAt(i));
//回溯
backTracking(digits, numString, num + 1);
//剔除末尾的继续尝试
temp.deleteCharAt(temp.length() - 1);
Expand Down

0 comments on commit c2fd043

Please sign in to comment.