Keypad Words
Medium · Keypad Words
On an old push-button phone, each digit from 2 to 9 carries a few letters: | Key | Letters | |---|---| | 2 | abc | | 3 | def | | 4 | ghi | | 5 | jkl | | 6 | mno | | 7 | pqrs | | 8 | tuv | | 9 | wxyz | The string `keys` is a sequence of pressed keys. Return every word it can type: one letter from each key, in the same order. If `keys` is empty, return an empty list. The words may be listed in any order.…
Solve the problem →