Smart Keypad - Advanced

how to it match with the string i can’t get

#include<iostream>
#include<string>
using namespace std;
string searchIn [] = {
            "prateek", "sneha", "deepak", "arnav", "shikha", "palak",
            "utkarsh", "divyam", "vidhi", "sparsh", "akku"
    };

void strkey(char *in, char *out, int i, int j){
	if(!in[i]){
		out[j]='\0';
        for(int k=0;k<11;k++){
           if(searchIn[k].find(out) != -1){
    		    cout<<searchIn[k]<<endl;
                // return;
           }
        }
		return;	
	}
	int digit = in[i]-'0';
	for(int k=0;searchIn[digit][k];k++){
		out[j] = searchIn[digit][k];
		strkey(in,out,i+1,j+1);
	}
}
int main() {
	char in[13],out[13];
	cin>>in;
	strkey( in, out, 0, 0);
	return 0;
}

First you have to make all conbinations from the characters on the keypad, there will be n*m combinations, then you have to search them in the given strings.
Refer this for better understanding -:

unable to understand your code.

sir tell me where is bug in my code plz debug.

For the test case 333 , output should be deepak but your code is printing arnav several times.

Refer this i have commented the part for better understanding -:

1 Like

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.

1 Like

thank you Robin Singh you help me a lot :hugs:
@Robin_rst
feedback link is not working.