1. You are given a string str of digits. (will never start with a 0)
2. You are required to encode the str as per following rules
1 -> a
2 -> b
3 -> c
..
25 -> y
26 -> z
3. Complete the body of printEncodings function - without changing signature - to calculate and print all encodings of str.
Use the input-output below to get more understanding on what is required
123 -> abc, aw, lc
993 -> iic
013 -> Invalid input. A string starting with 0 will not be passed.
103 -> jc
303 -> No output possible. But such a string maybe passed. In this case print nothing.
Input Format
A string str
Output Format
Permutations of str in order hinted by Sample output
Constraints
0 <= str.length <= 10
Sample Input
655196
Sample Output
feeaif
feesf
Comments
Post a Comment