Telephone Keypad Lookup


Given a phone keypad and a dictionary, we want to write a method that, given an array of digits 0-9, returns all the words that match the pattern and are in the dictionary. For example, the number 228 can map to, among other things, “bat”, “cat”, and “ cbu”, but only “bat” and “cat” are in the dictionary. Write this method.


Answer