Generate every possible letter string that a phone keypad number sequence can represent.
Given a string of digits from 2 to 9, return all possible letter combinations that the number could represent using the standard phone keypad mapping.
Each digit maps to a set of letters:
2 -> abc3 -> def4 -> ghi5 -> jkl6 -> mno7 -> pqrs8 -> tuv9 -> wxyzBuild every valid combination by choosing one letter for each digit in order. The result may be returned in any order.
If the input contains no digits, return an empty list.
digits containing only characters from 2 to 9.0 <= digits.lengthdigits[i] is in the range '2'..'9'Example 1
Input
digits = "23"
Output
["ad","ae","af","bd","be","bf","cd","ce","cf"]
Explanation
Digit 2 maps to abc and digit 3 maps to def. Combine every choice from the first digit with every choice from the second digit.
Example 2
Input
digits = ""
Output
[]
Explanation
With no digits, there are no letter combinations to generate.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.