Given a digit string, return all possible letter combinations that the number could represent.
不知道有多少数字,很难遍历,那就用遍历的极端情况,递归
package pack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
class Solution {
public List<String> letterCombinations(String digits) {
HashMap<Integer, String> map = new HashMap<Integer, String>();
map.put(2, "abc");
map.put(3, <

给定一个数字字符串,返回所有可能的字母组合。由于不知道数字的数量,使用递归解决难以遍历的问题。
订阅专栏 解锁全文
8949

被折叠的 条评论
为什么被折叠?



