题目链接
https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/

回溯搜索是深度优先搜索(DFS)的一种
https://blog.csdn.net/XX_123_1_RJ/article/details/80947129
很显然是,是回溯题目,递归求解,可以使用深度优先(dfs)的思想。
(1)用 index 记录 digits 字符串中的字符索引。
(2)用 paths 表示走过的字符,走到头,就保存到 res, 然后回溯当上一层,继续。
(3)这个过程相当于深度优先搜索。

网友评论