So i have a problem with keypad combinations . What i need help with, is for someone to explain to me, on what could be the easiest way of solving this problem either using recursion or dynamic programming(not asking for code). So the issue is that you have a certain number of presses, which we can assign to "n".
1 press could print "a,d,g,j,m,p,t,w", the count is 8.
2 presses could print "aa,ad,ag,aj,am,ap,at,aw" and so on with every other letter, so the count is 64, but this is where i'm stuck, at this point, when you have 2 presses you can also print "b,e,h,k,n,q,u,x", which means the total count is 64+8.
With 3 presses the count equals to 72*8+64+8=648, since you add the recursions of the letters that appeared later.
And when you have 4 presses, again the last 4 letters show up. The question that i have is, what steps do i have to take, i'm getting lost in the recursion.
What I have tried:
Writing the function recursively.