Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit716a4f0

Browse files
refactor 1025
1 parentd7d122e commit716a4f0

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

‎src/main/java/com/fishercoder/solutions/_1025.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
packagecom.fishercoder.solutions;
22

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-
* */
263
publicclass_1025 {
274
publicstaticclassSolution1 {
285
publicbooleandivisorGame(intN) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp