Smart keypad - 1

1 test case is failing. Please let me know where my code is going wrong.

Hello @sghosh2018,

Why are you discriminating with 0. LOL:joy:
Funny?
But, this is the solution of your problem.

It is not specified in question that you have to take 0 as a case of no character/null character.

So, there is no significance of the condition:
if(digit==0)
{
keys(inp, out, i+1, j);
}

Remove it, and your will run perfectly.

Hope, this would help.
Give a like, if you are satisfied.