Sir , i got only 1 test case correct , but could not get the reason behind it?

It is the code , please help me out , what is the problem with the code

Hey @aryan_007
https://www.quora.com/Permutations-and-Combinations-In-how-many-ways-can-we-divide-n-distinct-objects-into-r-distinct-groups-of-equal-or-unequal-sizes-having-at-least-1-object-each
This is the question and explanation for the answer
The question is basically selecting N object from K groups

If your doubt is resolved please mark it as closed.

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.