How does xor gives solution here?

Because xor is same as the nim addition of digits 0 and 1!

1 Like

Have a look at Spargue-Grundy Theorm

2 Likes

xor is fun!

1 Like

Can you tell when will we get the original ranklist ? It has frozen like forever

I know its a modification of game of nimâ€¦ but why xoring it with pile size -1?..

I mean how does it ensure the dividing into two partâ€¦

and what if we can divide one pile into k pilesâ€¦how does it change the solution?

2 Likes

Maybe since 1 pile cannot be broken againâ€¦just considering pile size to be pile size -1 in the game of nim does the trick? Is it? And then if we have to break into k piles â€¦answer can be determined by xoring with

pile size -k+1?

1 Like