Problem of the day
A mapping from Digits to Letters (just like in Nokia 1100) is shown below. Note that 1 does not map to any letter.
The first line of input contains an integer ‘T’ denoting the number of test cases.
Then the 'T' test cases follow.
The first and only line of each test case contains string S.
For each test case, the list containing all the combinations of letters will be printed.
The output of each test case is printed in a separate line.
You don’t have to print anything, it has already been taken care of. Just implement the function.
The output strings can be returned in any order.
1 <= T <= 10
1 <= |S| <= 10
2 <= S[i] <=9
Where |S| is the length of string 'S" and 'S[i]' represents the element of the string S.
Time Limit: 1 sec
1
23
ad ae af bd be bf cd ce cf
The letters corresponding to 2 are ‘a’, ‘b’, ‘c’ and corresponding to 3 are ‘d’, ‘e’, ‘f’. All the possible letter combinations for “23” will be "ad","ae","af","bd","be","bf","cd","ce","cf".
1
2
a b c
The letters corresponding to 2 are ‘a’, ‘b’, ‘c’.