2022-03-27 20:56:26 +08:00
< p > Given a string containing digits from < code > 2-9< / code > inclusive, return all possible letter combinations that the number could represent. Return the answer in < strong > any order< / strong > .< / p >
2023-12-09 18:42:21 +08:00
< p > A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.< / p >
< img alt = "" src = "https://assets.leetcode.com/uploads/2022/03/15/1200px-telephone-keypad2svg.png" style = "width: 300px; height: 243px;" / >
2022-03-27 20:56:26 +08:00
< p > < / p >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 1:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre >
< strong > Input:< / strong > digits = " 23"
< strong > Output:< / strong > [" ad" ," ae" ," af" ," bd" ," be" ," bf" ," cd" ," ce" ," cf" ]
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 2:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre >
< strong > Input:< / strong > digits = " "
< strong > Output:< / strong > []
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 3:< / strong > < / p >
2022-03-27 20:56:26 +08:00
< pre >
< strong > Input:< / strong > digits = " 2"
< strong > Output:< / strong > [" a" ," b" ," c" ]
< / pre >
< p > < / p >
< p > < strong > Constraints:< / strong > < / p >
< ul >
< li > < code > 0 < = digits.length < = 4< / code > < / li >
< li > < code > digits[i]< / code > is a digit in the range < code > [' 2' , ' 9' ]< / code > .< / li >
< / ul >