Letters a phone number could spell
On an old phone keypad 2 is abc, 3 is def, 4 is ghi, 5 is jkl, 6 is mno,
7 is pqrs, 8 is tuv, 9 is wxyz. Write spellings(digits) that returns every
string the digits (all between 2 and 9) could spell. Order of the output does not matter.
spellings("23") -> ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]
spellings("") -> []
The point is to practise a backtracking loop whose choices come from a lookup table.
def spellings(digits):
...