Doubt in---Game Theory - 3

I am not able to get why my code is failing all 4 test cases.
pls help me figure out it.
link to my code is–https://ide.codingblocks.com/s/77417

because your method of finding grundy number is wrong… try again…

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.