Alice and Bob are playing a mathematical game using a single integer, n, written on the chalkboard.
Alice always moves first, and both play optimally.
On each player’s turn:
1. The player chooses an integer x such that 0 < x < n and n % x == 0.
2. The number on the board is replaced with n - x.
If a player cannot make any valid move, that player loses the game.
Your task is to return:
• true → if Alice wins the game,
• false → if Bob wins the game.
________________________________________
⚙️ Rules Summary
• Each move must choose a divisor of the current number.
• The game ends when no valid divisor x can be chosen.
• Both players aim to win — they play optimally.
Input: n = 4
Output: true
Input: n = 7
Output: false
Accepted:
Submission: