Easy
Accuracy :70.69%
Points: 2
Alice and Bob take turns playing a game, with Alice starting first.
Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of:
Also, if a player cannot make a move, they lose the game.
Return true if and only if Alice wins the game, assuming both players play optimally.
Input: n = 2 Output: True Explanation: Alice chooses 1, and Bob has no more moves.
Input: n = 3 Output: False Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves.
- You don't need to read input or print anything. Your task is to complete the function divisorGame() which takes an integer n as a parameter and returns true if Alice wins the game.
O(1)
O(1)
1 ≤ n ≤ 103