Game theory - two

getting incorrect output
ide: https://ide.codingblocks.com/s/224968

@Vishal123
You forgot to check if number is prime before calculating grundy
For primes also grundy is 1
Kindly close this doubt

i have also put check for prime .still getting incorrect answer. updated code: https://ide.codingblocks.com/s/226141

@Vishal123
For primes grundy is 1
Try that

i tried it but still not working

@Vishal123
You had to return 1 for 1 not 0
Please see this solution for reference once https://ide.codingblocks.com/s/226731