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.
Note:
Although the above answer is in lexicographical order, your answer could be in any order you want.
給一串包含數字 2-9 的字串,回傳所有可能出現的字母組合。
每個數字到字母的對應表在下方(就像手機按鈕一樣),記住1沒有對應到任何字母。
注意:
雖然範例中的答案有按字典排序,但實際上你可以用任何順序。
vector<string>
當作對應表,1的部分放入空字串就可以了。LeetCode
C++