17 Letter Combinations of a Phone Number
来源:互联网 发布:淘宝穿越火线刷经验 编辑:程序博客网 时间:2024/06/06 00:27
class Solution {public: vector<string> letterCombinations(string digits) { vector<string> ans; if(digits==""){ return ans; } string combination=""; dfs(ans,combination,digits); return ans; } void dfs(vector<string> &ans,string combination,string digits){ if(digits==""){ ans.push_back(combination); return; } string button=buttons[digits[0]-'0']; digits.erase(digits.begin()); for(auto c:button){ dfs(ans,combination+c,digits); } }private: const string buttons[10]={" ","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};};
0 0
- 17,Letter Combinations of a Phone Number
- #17 Letter Combinations of a Phone Number
- 17Letter Combinations of a Phone Number
- 17 Letter Combinations of a Phone Number
- 17 Letter Combinations of a Phone Number
- 【17】Letter Combinations of a Phone Number
- 17 Letter Combinations of a Phone Number
- 17-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
- LeetCode18:Letter Combinations of a Phone Number
- Letter Combinations of a Phone Number
- 【leetcode】Letter Combinations of a Phone Number
- LeetCode: Letter Combinations of a Phone Number
- Letter Combinations of a Phone Number
- iOS——关于应用程序生命周期问题
- jquery信息提示插件poshytip 和弹出框插件 jbox,树状图插件ztree,图表插件echarts
- 解决jquery操作checkbox火狐下第二次无法勾选问题
- 腾讯产品总监曹菲-----为何我工作十年,内心仍无比恐慌
- C语言--指针2
- 17 Letter Combinations of a Phone Number
- lov制作注意点
- Android(14)Handler简单例子(1)
- 设计模式(九)装饰模式(Decorator)
- JavaScript中IE与DOM事件的区别http://www.cnblogs.com/stpangpang/archive/2008/06/03/1212607.html
- 单例模式下的嵌套调用导致栈溢出
- LightOJ 1078 - Integer Divisibility (同余定理)
- 自定义系统控件的外观:UIApearance
- Maven的生命周期和插件