Smart keypad-1 problem

https://ide.codingblocks.com/s/150229 my code is giving wrong output for 2nd testcase.

Ajit, plz omit this condition from your code, //if(digit==0){
// smartkeyborad(inp,out,i+1,j);
//}
and then try to submit it.