What is mistake in code

code:https://ide.codingblocks.com/s/365692
Problem:https://leetcode.com/problems/kth-smallest-instructions/

Can you elaborate the approach you have used?

Also please tell what issue you are facing in this code.

So, we know that every set of instructions for Bob will be some string that is the combination of “H” and “V” with length r + c, exactly r characters will be “V”, and exactly c characters will be “H”.

So just finding kth permutation of string

@rbpagire refere this editorial

https://stackoverflow.com/questions/9330915/number-of-combinations-n-choose-r-in-c/53983114

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.