Each number on the telephone dial (except 0 and 1) corresponds to three alphabetic characters. Those correspondences are:
2 ABC 3 DEF 4 GHI 5 JKL 6 MNO 7 PRS 8 TUV 9 WXY
Given a 7 digit phone number, print all possible words that can be formed. For bonus points write the program to solve for N digit phone numbers. Here is a dictionary to help you out (English).
Comments:
Heroka - 9 years, 8 months ago
Generally, 7 and 9 correspond to 4 letters (7: PQRS and 9 WXYZ). Was the omission of Q and Z intentional for the question?
reply permalink
Anonymous - 9 years, 8 months ago
output: Enter a phone number> 6275377 ['markers', 'maskers', 'napless', 'oarless']
reply permalink