Divisor Game
Problem Statement
Two players take turns playing a number game. Starting with a number N on the board:
- The current player chooses a number
xwhere0 < x < NandxdividesNevenly - Replace
NwithN - x - The player who cannot make a move loses
Player 1 moves first. Return true if Player 1 wins with optimal play, false otherwise.
N = 4 Player 1 picks 1: N becomes 3 Player 2 picks 1: N becomes 2 Player 1 picks 1: N becomes 1 Player 2 cannot move → Player 1 wins Answer: true