Phone keypad letters

Write codeMedium18 minAmazon and Meta style

Your task

Given a string of digits 2-9, return all letter strings the number could spell on a classic phone keypad (2 to abc, 3 to def, ..., 9 to wxyz). Return the list sorted lexicographically; an empty input yields an empty list. The input has at most 6 digits.

Examples

letter_combinations(digits: str) -> list[str]
Example 1
Inputletter_combinations("23")
Output["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]