varsha
BAN USER
Questions (3)
Comments (4)
Reputation 0
- 0of 0 votes
AnswersIn a dial pad(similar to phone dial pad) where if 2 corresponds to 'abc' and 3 corresponds to 'def' etc. Write a program to form all possible and meaningful words for the given number.
- varsha in United States
Example:
if 2 is pressed possible words are a,b,c. But 'a' is only meaningful word. Hence print 'a' and
if 23 is pressed. The possible words are going to be ad,ae,af,bd,be,bf,cd,ce,cf. 'be' is the only meaningful word. So, print 'be'.
We are given access to a dictionary.
(Edited now)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
@Sriram. I don't understand. Its seems to be working for your input too. Am I missing something?
- varsha March 24, 2012