kindly help me in the last part of the question i.e to print the corresponding name to the generated code. I cannot get the logic for the last part of the question.
Help required in the last part of the question
Approach :
- Bigger Problem : To Print all of the possible Strings from the given array that contains code generated by given number.
- Smaller Problem : Assume the recursion works and will give you ans for N - 1 length of String.
- Self Work : In order to make your smaller problem all you need to do is work for the 0th index element. Because it could be the part included in the answer or not. and self work is to use first character as it is and another time with the next variable.For e.gā¦,
In 123 either use 1 as it is or use code for 12 instead.
Note :In the Base all you need to do is to check whether the string code genertated from the number is contained in any of the string array given in the Question.