You are viewing a single comment's thread. Return to all comments →
This challenge is poorly written. Here's a better explanation.
In (this version of) the game of Nim, whoever takes the last stone wins. On your turn, you can take as many stones as you want from any single pile. You have to take at least one stone on your turn (you cannot pass). It is a well known result in game theory that if both players play optimally, then the winner is decided by the following property. On your turn let p be the number of piles, let size[i] be the number of stones currently in pile i. If size XOR size XOR size ... XOR size[p] != 0, then it is possible for you to make a move that forces your opponent to lose (eventually). If that XOR is 0, then no matter what you do, the opponent (if they play optimally) can make a move that forces you to lose (eventually).
size XOR size XOR size ... XOR size[p] != 0
This challenge wants the number of initial setups such that the first player can force a win, with one extra condition: at the start of the game no two piles have the same number of stones.
So, you want to count the number of ways to take n distinct integers from [1, 2^m-1] such that the XOR of those n values is not zero.