Smart Keypad - I

Not Understanding the question/problem?
please explain broadly.

the idea of this ques is same as that of keypad comination…
1)take a string as input
say the string you are taking input as 234

break the string as 2 + 34…call recursion on 34…recursion will do the work on 34 and return you an arraylist of strngs(make your return type of function as ArrayList)…
3)Now just do your self work that is for every character of 2(abc) append it with each String which came as recursion result(from 34’s recursive call)

return the new ArrayList

1 Like

what is the output for 234?

234 means
2-abc
3-def
4-ghi

in output we will get (34’s recursive call)
dg
dh
di
eg
eh
ei
fg
fh
fi

now append them with a,b and c respectively
to get the desired output
adg,adh…etc

1 Like

what in case of 0.
example : 102, for 102, providing space is necessary?
what is the output for this?

yaa you have to provide space

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.