Smart keypad advanced?/

could not get question

1 Like

Hi @monika

In this question you have to take input of a numeric string,then let you input number say 34(as in the sample test case) ,then you have to check that the strings created by the numeric string is the substring of which strings in the given vector of strings str(given in the question).for eg when you enter 34 the strings are, dg,dh,di,eg,eh,ei,fg,fh,fi (acc to the phone keypad) then check whether dg is the substring of any of the string in the given strings,if yes then print that string else dont print.repeat the same process for all the strings formed by 34.dh is present in vidhi so vidhi got printed,di is present in divyam so divyam got printed and eh is present in sneha so sneha is printed.

1 Like

gotcha
thanks @cutiecoder


help in this ,not working
@cutiecoder

see here you have to make all possible combinations of the numeric string n which have given as input and search that if that combination is contained in searchIn if yes then print it else don’t print .
and make the combinations simply as you have made in keypad question simple .
This might help you.

could not get your code

Hey,

I have made the function getstrings() that will help you to get the string corresponding to the number which you have input.Then I have made a function printstrings() in which i have passed two parameters one is String str which is the numeric string you have given as input and one is the string osf in which i am saving all the combinations which are made.Then in char cc i am storing one by one the character of str then in string res i am getting the string according to that number,now in that loop i am trying to make all the combinations using recursion,just try to dry run the code you will understand that.

Hi Monica
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.

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