Given a string containing digits from 2-9
inclusive, 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. Note that 1 does not map to any letters.
Example:
Input: "23" Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
思考:按照如下图进行遍历。以输入为“234”为例。
1 class Solution { 2 public: 3 vector<string> letterCombinations(string digits) { 4 vector<string> res; 5 if(digits.size()==0) return res; 6 7 string map[] = {" ", "", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; 8 string comb(digits.size(),'