|
1 | 1 | packagecom.fishercoder.solutions;
|
2 | 2 |
|
3 |
| -/** |
4 |
| - * 1025. Divisor Game |
5 |
| - * |
6 |
| - * Alice and Bob take turns playing a game, with Alice starting first. |
7 |
| - * Initially, there is a number N on the chalkboard. On each player's turn, that player makes a move consisting of: |
8 |
| - * Choosing any x with 0 < x < N and N % x == 0. |
9 |
| - * Replacing the number N on the chalkboard with N - x. |
10 |
| - * Also, if a player cannot make a move, they lose the game. |
11 |
| - * Return True if and only if Alice wins the game, assuming both players play optimally. |
12 |
| - * |
13 |
| - * Example 1: |
14 |
| - * Input: 2 |
15 |
| - * Output: true |
16 |
| - * Explanation: Alice chooses 1, and Bob has no more moves. |
17 |
| - * |
18 |
| - * Example 2: |
19 |
| - * Input: 3 |
20 |
| - * Output: false |
21 |
| - * Explanation: Alice chooses 1, Bob chooses 1, and Alice has no more moves. |
22 |
| - * |
23 |
| - * Note: |
24 |
| - * 1 <= N <= 1000 |
25 |
| - * */ |
26 | 3 | publicclass_1025 {
|
27 | 4 | publicstaticclassSolution1 {
|
28 | 5 | publicbooleandivisorGame(intN) {
|
|