Letter Combination of phone number
来源:互联网 发布:三亚市人民政府的域名 编辑:程序博客网 时间:2024/06/05 11:15
class Solution: # @return a list of strings, [s1, s2] def letterCombinations(self, digits): def dfs(num, string, res): if num == length: res.append(string) return for letter in dict[digits[num]] : dfs(num+1,string+letter,res) dict = {'2':['a','b','c'], '3':['d','e','f'], '4':['g','h','i'], '5':['j','k','l'], '6':['m','n','o'], '7':['p','q','r','s'], '8':['t','u','v'], '9':['w','x','y','z'] } res = [] length = len(digits) dfs(0, '', res) return res
0 0
- Letter Combination of phone number
- Letter Combination of phone number
- Letter Combination of a Phone Number
- leetcode-letter combination of a phone number
- [Leetcode] 17. Letter Combination of a Phone Number
- leetcode-17 Letter Combination of a Phone Number
- Python 刷题日记: Letter Combination of a Phone Number
- FTPrep, 17 letter combination of a phone number
- Letter combinations of 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
- win32创建窗口及其消息循环
- 串结构练习——字符串连接
- Android Studio就看你了,下个项目开始用,再见eclip
- No system images installed for this target 的解决方法
- 4 Sum
- Letter Combination of phone number
- 大学断代史(二)——生活,不是那样简单
- 大学断代史(一)——浑浑噩噩
- Google Web Search
- 使用Handler在子线程中更新UI
- Android中Activity的跳转
- IOS开发--自定义控件
- UVA LIVE-4642 - Malfatti Circles
- fpga的驱动调试dev_dbg 无输出