Staircase Nim — Solution & Editorial
Staircase Nim reduces to ordinary Nim on the ODD-indexed stairs only: moving from an even stair is mirrored by the opponent, so only odd-stair coin counts matter. XOR them.
Complexity: O(N)
Staircase Nim reduces to ordinary Nim on the ODD-indexed stairs only: moving from an even stair is mirrored by the opponent, so only odd-stair coin counts matter. XOR them.
Complexity: O(N)