LeetCode-Daily-Question-34
Jul 21st 2022
7 月 21 日 每日一题
17. Letter Combinations of a Phone Number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order.
A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.
1 | Input: digits = "23" |
思路
Using bsf (a queue) or a temp vector to store the intermediate status of the combinations.
代码
1 | class Solution { |