Please help me to debug the code

i have dry run the code on paper and its works perfectly. please help me to find out problem with my code. I know my approach will give TLE but i think my approach is correct. function game strip tell whether the person with chance is going to win or not.
I know there is a easy solution for this problem but just wanted to know my code is not working.

Problem Link : https://www.codechef.com/LTIME87B/problems/ARRGAME

Solution Link : https://ide.codingblocks.com/s/323688

Can you please tell the idea?

The code doesn’t make it clear.

Hey tell me your number i will call you, or call me at 9787775027

It will take a lot of typing to explain the approach

Okay just comment your code, as what represents what?

I’ll try to get something then

i have explained my approach now let me know the mistake with the code.

reset umpos[chance] = i; after backtracking

Hey after doing the changes the code is not working.

Link of updated code: https://ide.codingblocks.com/s/324367

Please send me the updated code which is working after resetting umpos[chance] = i.

this is not how you reset umpos[chance] = i;, first store its value somewhere and then assign it back

int temp = umpos[chance];
umpos[chance] = i;

recursion()....

umpos[chance] = temp;