做快手网站,网上购物平台哪个好,南城仿做网站,济南网站建设sdqswl题目出处
17-电话号码的字母组合-题目出处
题目描述 个人解法 思路#xff1a; todo 代码示例#xff1a;#xff08;Java#xff09; todo复杂度分析 todo
官方解法
17-电话号码的字母组合-官方解法
方法1#xff1a;回溯 思路#xff1a; 代码示例#xff1a; todo 代码示例Java todo复杂度分析 todo
官方解法
17-电话号码的字母组合-官方解法
方法1回溯 思路 代码示例Java ListString combinations new ArrayListString();if (digits.length() 0) {return combinations;}MapCharacter, String phoneMap new HashMapCharacter, String() {{put(2, abc);put(3, def);put(4, ghi);put(5, jkl);put(6, mno);put(7, pqrs);put(8, tuv);put(9, wxyz);}};backtrack(combinations, phoneMap, digits, 0, new StringBuffer());return combinations;}public void backtrack(ListString combinations, MapCharacter, String phoneMap, String digits, int index, StringBuffer combination) {if (index digits.length()) {combinations.add(combination.toString());} else {char digit digits.charAt(index);String letters phoneMap.get(digit);int lettersCount letters.length();for (int i 0; i lettersCount; i) {combination.append(letters.charAt(i));backtrack(combinations, phoneMap, digits, index 1, combination);combination.deleteCharAt(index);}}}复杂度分析 考察知识点
收获
1.多张图图片垂直拼接为一张 1)在线网址 图片拼接
2.多张图片转为gif动图 1方法 2参考文章 这6个免费GIF合成工具值得收藏 3 实战-完全免费 实战链接 Gitee源码位置
17-电话号码的字母组合-源码
同名文章已同步发表于CSDN个人网站公众号
CSDN 工一木子个人网站 工藤新一公众号