Recursion codepad problems


How I can return the count values using the int datatype //
for base case when we hit return 1 and return 1+ recursive call

@Vikaspal, i think the code you shared is incorrect ,
coming to your question there are many ways in which you can count the number of combination

  1. take a global variable and increment it whenever you will hit the base case
  2. take a count variable as reference you can increment it the same way as only one function stack works at a time on the count variable
  3. you can store the combination of strings in a vector, and print vector.size()

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.