Leetcode Letter Combinations of a Phone Number
来源:互联网 发布:distinct sql 用法 编辑:程序博客网 时间:2024/06/05 07:27
深搜
string keys [10] = {" ", "", "abc", "def", "ghi", "jkl", "mno", "pqrs","tuv", "wxyz"}; void dfs(vector<string> &result, string s , int i, string digits){ if(i == digits.length()){ result.push_back(s); return; } int d = (int) digits[i] - '0'; for(int j = 0; j < keys[d].length(); j++){ s[i] = keys[d][j]; dfs(result, s, i+1, digits); } } vector<string> letterCombinations(string digits) { int n = digits.length(); vector<string> result; string s (n, '*'); dfs(result, s, 0, digits); return result; }
0 0
- LeetCode: Letter Combinations of a Phone Number
- LeetCode Letter Combinations of a Phone Number
- LeetCode: Letter Combinations of a Phone Number
- [Leetcode] Letter Combinations of a Phone Number
- [LeetCode] Letter Combinations of a Phone Number
- 【leetcode】Letter Combinations of a Phone Number
- LeetCode: Letter Combinations of a Phone Number
- [LeetCode]Letter Combinations of a Phone Number
- LeetCode-Letter Combinations of a Phone Number
- [LeetCode] Letter Combinations of a Phone Number
- LeetCode - Letter Combinations of a Phone Number
- LeetCode:Letter Combinations of a Phone Number
- LeetCode | Letter Combinations of a Phone Number
- leetcode Letter Combinations of a Phone Number
- Leetcode: Letter Combinations of a Phone Number
- 【leetcode】Letter Combinations of a Phone Number
- [LeetCode] Letter Combinations of a Phone Number
- leetcode: Letter Combinations of a Phone Number
- sql动态添加列
- Intent学习
- VS2010 C++ 操作Excel表格的编程实现
- 【Android知识点精讲】(2)2D绘制与控件绘制
- 侵入式智能指针
- Leetcode Letter Combinations of a Phone Number
- LeetCode(169) Majority Number
- 计算机书记推荐
- Maven针对不同的环境使用Profile完成打包部署
- Jquery(九)jquery工具函数
- java自定义注解
- 关于嵌套子查询的理解
- IOS网络学习-6、NSURLConnection基本使用
- Jquery(十)jqueryUI常用功能实战