Mapped string(PROBLEM IN RECURSION)

THE QUESTION-https://online.codingblocks.com/player/16491/content/10555/4947
MY SOLUTION-https://ide.codingblocks.com/s/105295
IT’S WORKING FINE FOR INPUT 123
BUT NOT FO INPUT 1234 AND SO ON.

@Sumit-Kumar-2072048362889836 hey sumit your code need some modification the one test case is failing
this is the modification
int sdigit=in[i]-‘0’;
int ddigit;
if(i+1<length)
{
ddigit=(in[i]-‘0’)*10+(in[i+1]-‘0’);
}
else
ddigit=sdigit;

out[j]=sdigit+64;
sub_string(in,out,i+1,j+1,length);
if(ddigit>9&&ddigit<=26){
  out[j]=ddigit+64;
  sub_string(in,out,i+2,j+1,length);
}

i don’t get the logic.i have done the same using map,but still i am not getting the desired output.my logic-check for single digit and then call function again .next time check for double digit and call the function. Plz find the error in my code and dont supply others code.

@Sumit-Kumar-2072048362889836 I have not supplied you the other code your code is failing to handle some situation and it needs to be modified because it failed to handle some cases.
like consider this case
9999
it should print
IIII
but your code is printing
IIII
II
I
but if you comment sub_string(in,ot,i+2,j+1,length);
this case will handle but your code is making the disaster
for case 1234
this should be print
ABCD
AWD
LCD
but your code is printing
ABCD
AB
AWD
LLD
L
there is no relation handling with your recursive call that’s why Iam suggesting the changes.hope this concept help you understand the mistake.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.