Smart Keypad-Advanced

Can you please explain me this problem.?

Hey @CODER_JATIN
Relate this problem to your mobile’s keypad.
If you have to search the name/contact of any particular person, then you can directly search on the keypad as:

2 corresponds to letters a, b, c
3 corresponds to letters d, e, f
4 to g, h, i
so on… till 9

So, you have given a vector of names/ strings as specified in the question.
Now, the user will enter a string of digits.

Example : 34

34 will result into combinations :

dg eg fg
dh eh fh
di ei fi

Corresponding strings are output.

vidhi contains dh
divyam contains di
sneha contains eh

https://ide.codingblocks.com/s/350212 ,kartik bhaiya please check this.

Will do in some time :slight_smile:

Hey @CODER_JATIN
Yes its correct
Just telling you one more approach
replace characters of searchIn by nos
like eab=322
After doing that search the given no in strings if present print it.
This is better approach without recursion. whos complexity is O(size of searchin*lengthof string)

Marking this as resolved if u have any other doubt regarding the same feel free to message me personally :slight_smile:

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.