CT045

Nim Game Winner

HardAcceptance: 0.0%

The game of Nim is played with three heaps. Two players take turns removing one or more items from a single pile. The player forced to take the last stone loses. Given starting heap sizes [a, b, c] and assuming optimal play, determine whether the first player has a forced win. Output "true" or "false".

Example 1:

Input: 3 4 5
Output: true

Example 2:

Input: 0 0 1
Output: true

Constraints:

0 <= a, b, c <= 10^9

Tags:

game-theory bit-manipulation recursion
Loading...
Test Cases:No test cases
No test cases available.
Coding Problem Not Found | CodeTikki