Smart Keypad - Advanced : How to solve this question through recursion?

I just used a hack to solve this question. But I want to learn the recursive approach to solve this problem as I am weak in recursion. I also tried to unlock the editorial, but it said “No editorial exists for this problem”. That’s why I need mentor’s help. My approach : https://ide.geeksforgeeks.org/gZw7GnM6Wi

Ayush ur code is not for keypad problem
For keypad problem think of a case
12
that is u have
abc at 1
def at 2
so u have to print combination
now u have to choose abc now for each character of the string u have to choose another string thats why the combination form like
ad,ae,af etc…
so here u have to make a recursive call like that i have choosen 1 string noe i have to choose another string
and if ex=123
then abc def and pqr
then u have to chose 1 string and for each character of 1 string 2nd string and then for each charater of 2 string 3 string.
that how it works
hope this help:)

But sir we don’t need to print combinations is this question. Instead we have to use those combinations and see if they exist as a substring in the given vector of strings.

no i am giving u the basic idea of the question to find the string u have to first generate the combination like
ad ae af
bd,be,bf

and once u have generated the combination then u can easily search in the string array given in question
have u tried this question it is the basic of above
https://hack.codingblocks.com/contests/c/787/96
so the main part is to generate those sequences
for which i have given the idea aboeve

Okay Sir, I got it. Thanks.