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.keys="58" → ['jt', 'ju', 'jv', 'kt', 'ku', 'kv', 'lt', 'lu', 'lv']
Key 5 holds j, k, l and key 8 holds t, u, v, giving 3 × 3 = 9 words.
keys="7" → ['p', 'q', 'r', 's']
Key 7 carries four letters, so there are four words.
keys="" → []
No keys pressed, so the list is empty.
keys is a digit from 2 to 9keys="58"
['jt', 'ju', 'jv', 'kt', 'ku', 'kv', 'lt', 'lu', 'lv']
Run checks the first 3 tests in your browser. Submit checks all 79 tests on the server, hidden ones included.