GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

String result from old school telephone

Using old school telephone to write string (2 - {ABC}, 3 - {DEF}, ... etc)

1- Write an algorithm to generate all possible strings result from input number.


Input: 2, 2, 8

output: {AAT, ABT, ACT, CAT, ACT, BAT, .... etc)

2- return only english words not gebrish 

example: result only be (CAT, ACT, BAT ... etc)

3- improve the performance

asked Oct 9, 2016 by waelouf