Problem
On an old phone keypad, each digit from 2 to 9 maps to letters:
Example 1
2: abc 3: def 4: ghi 5: jkl
Example 2
6: mno 7: pqrs 8: tuv 9: wxyz
Given a string digits made of the characters 2 to 9, return every string that could be typed by picking one letter per digit, in order. Return them in any order. An empty input gives an empty list.
Example 3
- Input
- "23"
- Output
- ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]
Example 4
- Input
- "2"
- Output
- ["a", "b", "c"]
Example 5
- Input
- ""
- Output
- []
Constraints
0 <= digits.length <= 4digits[i] is a digit from '2' to '9'.