LintCode: 电话号码的字母组合
来源:互联网 发布:大数据行业法律风险 编辑:程序博客网 时间:2024/04/30 11:27
LintCode: 电话号码的字母组合
class Solution: # @param {string} digits A digital string # @return {string[]} all posible letter combinations def letterCombinations(self, digits): # Write your code here dig_dict = {2:'abc', 3:'def', 4:'ghi', 5:'jkl', 6:'mno', 7:'pqrs', 8:'tuv', 9:'wxyz'} n = len(digits) if n == 0: return [] self.ans = [] res = [] self.my_letterCombinations(res, digits, dig_dict, 0) return self.ans def my_letterCombinations(self, res, digits, dig_dict, index): if len(res) == len(digits): self.ans.append(''.join(res)) return string = dig_dict[int(digits[len(res)])] for index in range(len(string)): res.append(string[index]) self.my_letterCombinations(res, digits, dig_dict, index+1) res.pop()
0 0
- LintCode: 电话号码的字母组合
- lintcode,电话号码的字母组合
- lintcode -- 电话号码的字母组合
- 电话号码的字母组合-lintcode
- LintCode 电话号码的字母组合
- lintcode---电话号码的字母组合
- 电话号码的字母组合-LintCode
- lintcode-电话号码的字母组合-425
- 电话号码的字母组合
- 电话号码的字母组合
- 电话号码的字母组合
- 电话号码的字母组合
- 电话号码的字母组合
- LeetCode 17 Letter Combinations of a Phone Number(电话号码的字母组合)
- 425.Letter Combinations of a Phone Number-电话号码的字母组合(中等题)
- [LeetCode] Letter Combinations of a Phone Number 电话号码的字母组合
- 17:Letter Combinations of a Phone Number(字母组合的电话号码)
- Letter Combinations of a Phone Number (电话号码字母组合) 【leetcode】
- 代码块保存路径
- GoKit3(V)学习笔记04_使用资源管理工具修改Lark7618数据点语音资源
- 51NOD 1432 贪心
- Oracle中的常用权限
- python学习服务器端socket建立
- LintCode: 电话号码的字母组合
- 如何通过分析log解决ANR(Application Not Respond)问题?
- Sublime安装ctags插件实现类方法的定位
- Python抓取极客学院开放数据
- Oracle中的常用权限
- Java字符串 10大最受关注问题解析
- SecondaryNameNode问题
- Android02--Android之UI控件TextView+Button+EditText
- linux内核链表学习笔记