Write a function that takes in a string containing digits and returns all possible letter combinations that
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function that takes in a string containing digits and returns all possible letter combinations that the digits could represent. The mapping of digits to letters is as follows: 2 maps to "abc", 3 maps to "def", 4 maps to "ghi", 5 maps to "jkl", 6 maps to "mno", 7 maps to "pqrs", 8 maps to "tuv", and 9 maps to "wxyz". The output should be sorted in lexicographic order.
For example, if the input string is "23", the function should return ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"].
Related Book For
Posted Date: