Recursion-Keypad Codes

Code: https://ide.codingblocks.com/s/425261
Problem:https://hack.codingblocks.com/app/contests/2022/1375/problem

Its passing all the test cases but I want to ask that why count++ is in base case ( line-11 )?
It should only execute when input array becomes null(in this case shouldn’t the count=1)?

Why cannot I put count in line number 25,after calling recursion?

Hello @kaustub this is becayse you have to put your count in base case because we will increment only when we have completely done with subcase.
if you will put it in line 25 it will even increment even when you are forming the string for one case.

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.