Not able to understand how this problem works

Once the first case is printed how would it print the second case? Like how will the i,o and c reset and how will it know how many combinations to print?

hi @mitrapranav0027_5d705c8b616e0add
this problem can be done using recursion, refer this code -->

No I can see the code but I’m unable to understand how it works.

Hi @mitrapranav0027_5d705c8b616e0add
It’s a simple recursive code… try to dry run on a small sample input… u will get better insight…

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.