File tree 1 file changed +0
-23
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change 1
1
package com .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
public class _1025 {
27
4
public static class Solution1 {
28
5
public boolean divisorGame (int N ) {
You can’t perform that action at this time.
0 commit comments