diffuser78
BAN USER
- 18of 18 votes
AnswersIf a=1, b=2, c=3,....z=26. Given a string, find all possible codes that string can generate. Give a count as well as print the strings.
- diffuser78 in United States
For example:
Input: "1123". You need to general all valid alphabet codes from this string.
Output List
aabc //a = 1, a = 1, b = 2, c = 3
kbc // since k is 11, b = 2, c= 3
alc // a = 1, l = 12, c = 3
aaw // a= 1, a =1, w= 23
kw // k = 11, w = 23| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm Coding
It doesn't work for this input: "101523"
Output list cannot contain a. It must start with j since 10=a. But pretty close.
Looks good to me. How long did it take you ? I had roughly 30 minutes to finish this on whiteboard and I didn't do a good job.
- diffuser78 June 08, 2013
Repmonicahbess, SDET at Adap.tv
Hi Everyone, I'm Monica H. Bess. I love to build props...everything from a casket to pneumatic monsters.My ...
Works like a charm for most cases except these. Still a pretty good job.
- diffuser78 June 09, 2013"110203"