Problems > Misere Nim > Editorial

Misere Nim — Solution & Editorial

Back to the Problem

If every pile is at most 1, the first player wins iff the number of size-1 piles is even; otherwise the normal-play XOR rule applies.

Complexity: O(K)

Watch out: The special case is only when all piles are ≤ 1.