17.letter-combinations-of-a-phone-number

给定一个数字字符串,找出这个字符串对应的字母串组合,这是一个简单题,练习一下linkedlist作为队列的用法


Given a digit string, return all possible letter combinations that the number could represent.

A mapping of digit to letters (just like on the telephone buttons) is given below.

Input:Digit string “23”
Output: [“ad”, “ae”, “af”, “bd”, “be”, “bf”, “cd”, “ce”, “cf”]
Note:
Although the above answer is in lexicographical order, your answer could be in any order you want.


  • 数字与字母的对应关系同电话键盘,2–>abc 3–>def…

保存对应关系,遍历数字串,在结果集中追加当前数字对应字母. 我怎么没想到用队列…

  • 我的代码

  • 题解代码