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

Commit8a4b97d

Browse files
add 1025
1 parentb3eb2c4 commit8a4b97d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ _If you like this project, please leave me a star._ ★
384384
|1033|[Moving Stones Until Consecutive](https://leetcode.com/problems/moving-stones-until-consecutive/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1033.java)||Easy|Math|
385385
|1030|[Matrix Cells in Distance Order](https://leetcode.com/problems/matrix-cells-in-distance-order/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1030.java)||Easy|
386386
|1029|[Two City Scheduling](https://leetcode.com/problems/two-city-scheduling/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1029.java)||Easy|
387-
|1025|[Divisor Game](https://leetcode.com/problems/divisor-game/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1025.java)||Easy|
387+
|1025|[Divisor Game](https://leetcode.com/problems/divisor-game/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1025.java)||Easy|Math, DP, Brainteaser, Game Theory|
388388
|1022|[Sum of Root To Leaf Binary Numbers](https://leetcode.com/problems/sum-of-root-to-leaf-binary-numbers/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1022.java)||Easy|
389389
|1021|[Remove Outermost Parentheses](https://leetcode.com/problems/remove-outermost-parentheses/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1021.java)||Easy|
390390
|1020|[Number of Enclaves](https://leetcode.com/problems/number-of-enclaves/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1020.java)||Medium|Graph, DFS, BFS, recursion|

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
publicclass_1025 {
44
publicstaticclassSolution1 {
5+
/**
6+
* After writing out a few examples, beginning from n = 1, up to n = 5, the logic flows out naturally:
7+
* 1. when N deduced to 1, whoever plays now loses because no integers exist between 0 and 1;
8+
* 2. when N deduced to 2, whoever plays now wins because he/she will pick one and the next player is left with nothing to play;
9+
* 3. all numbers N will eventually be deduced to either 1 or 2 depending on whether its odd or even.
10+
*/
511
publicbooleandivisorGame(intN) {
6-
//TODO: implement it
7-
returnfalse;
12+
returnN %2 ==0;
813
}
914
}
1015
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp