Smart Keypad 1 problem

sir i am not getting how to approach this problem
can you give some hint

If the number is 23
Then for 2, the alphabets are a, b, c So 3 recursive function will be called with output string as a, b, c respectively and
for 3 there are 3 alphabets d, e, f So, the output will be ad, ae and af for the recursive function with output string.
Similarly, for b and c, the output will be: bd, be, bf and cd, ce, cf respectively.

Algorithm:

  1. Map the number with its string of probable alphabets, i.e 2 with “abc”, 3 with “def” etc. using array of string
  2. create a recursive function which takes following parameters, output string, number array, current index and length of number array
  3. If the current index is equal to the length of number array then print the output string.
  4. Extract the string at digit[current_index] from the Map, where digit is the input number array.
  5. Run a loop to traverse the string from start to end
  6. For every index again call the recursive function with the output string concatenated with the ith character of the string and the current_index + 1.

Reference Code

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved
if you have more doubts regarding this feel free to ask