why my second test case is being not passed with this code ??
#include
using namespace std;
char keypad[][10] = { " ", “.+@$”, “abc”, “def”, “ghi”, “jkl” , “mno”, “pqrs” , “tuv”, “wxyz” };
void printKeypadString(char *inp,char *out,int i,int j){
if(inp[i]==’\0’){
out[j]=’\0’;
cout<<out<<" ";
return;
}
int digit =inp[i]-'0';
if(digit ==0){
printKeypadString(inp,out,i+1,j);
}
for(int k=0;keypad[digit][k]!='\0';k++){
out[j]=keypad[digit][k];
printKeypadString(inp,out,i+1,j+1);
}
}
int main() {
char inp[20];
char out[20];
cin>>inp;
printKeypadString(inp,out,0,0);
return 0;
}