Skip to content

Commit 5eb2608

Browse files
author
luzhipeng
committed
feat: 每日一题 2019-06-18
1 parent 8928c98 commit 5eb2608

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

daily/2019-06-18.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## 每日一题 - Letter Combinations Of A Phone Number
2+
3+
### 信息卡片
4+
5+
- 时间:2019-06-18
6+
- 题目链接:https://leetcode.com/problems/letter-combinations-of-a-phone-number/
7+
- tag:`backtrack`
8+
9+
### 题目描述
10+
11+
```
12+
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.
13+
14+
A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.
15+
16+
17+
18+
Example:
19+
20+
Input: "23"
21+
Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
22+
Note:
23+
24+
Although the above answer is in lexicographical order, your answer could be in any order you want.
25+
```
26+
27+
### 参考答案
28+
29+
求解电话号码能够组成的所有可能性。由于要列举所有的,因此很容易想到的是全排列,而不是 DFS.
30+
如果大家之前看过我仓库的话,应该知道这种题目有一个通用的解题框架和模板。
31+
今天我们就来巩固下这个解题思路。 题目简单直接我就不说了,如果没有明白的可以移步到我的仓库中继续看。 比如 https://github.com/azl397985856/leetcode/blob/master/problems/39.combination-sum.md 就用到了这种方法(回溯法)
32+
33+
参考代码: https://github.com/azl397985856/leetcode/blob/master/daily/answers/17.letter-combinations-of-a-phone-number.js
34+
35+
### 其他优秀解答
36+
37+
```
38+
暂无
39+
```

daily/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ tag: `tree`
5959

6060
时间: 2019-06-14
6161

62+
### [letter-combinations-of-a-phone-number](./2019-06-18.md)
63+
64+
tag: `backtrack`
65+
66+
时间: 2019-06-18
67+
6268
### [big-countries](./2019-06-19.md)
6369

6470
tag: `sql`

0 commit comments

Comments
 (0)