LeetCode 017 Letter Combinations of a Phone Number
来源:互联网 发布:苹果电脑删除mac系统 编辑:程序博客网 时间:2024/05/24 01:31
题目描述:
手机键盘上一个数字可以对应多个字母,有如下对应关系:
2:"abc"3:"def"4:"ghi"5:"jkl"6:"mno"7:"pqrs"8:"tuv"9:"wxyz"
输入一串数字,求可对应的字符串的所有组合。例如(来源于题目):
Input:Digit string "23"Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
题目很简单,可以使用回溯法来枚举所有可能的字符串组合。也可以写非递归的算法。栈是基本的数据结构,回溯也是基本的算法。但是要在面试那种环境,短时间内实现好非递归算法,又没有bug,就很考验编程功底了。
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
- android:ViewPager自动轮播图(简单版)
- 用PHP将网页上的Canvas图像保存到服务器上的方法
- LeetCode 256. Paint House
- IOS消息定时推送(JAVAWEB)
- 489 - Hangman Judge
- LeetCode 017 Letter Combinations of a Phone Number
- HTML5新特性之Geolocation
- 关于UIView用户交互相关的属性和方法
- Apache主配置文件httpd.conf 详解
- HDU 4635 Strongly connected 连通图
- View的滑动冲突深入理解
- HTTP详解(2)-请求、响应、缓存
- HTML链接
- HTTP详解(1)-工作原理