Skip to content

Commit a72119a

Browse files
solves nim game in python
1 parent 84ddebf commit a72119a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](src/FirstBadVersion.java) [![Python](https://img.icons8.com/color/35/000000/python.png)](python/first_bad_version.py) |
8888
| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](src/MoveZeros.java) [![Python](https://img.icons8.com/color/35/000000/python.png)](python/move_zeroes.py) |
8989
| 290 | [Word Pattern](https://leetcode.com/problems/word-pattern) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](https://github.com/anishLearnsToCode/leetcode-algorithms/blob/master/src/WordPattern.java) [![Python](https://img.icons8.com/color/35/000000/python.png)](python/word_pattern.py) |
90-
| 292 | [Nim Game](https://leetcode.com/problems/nim-game) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](https://github.com/anishLearnsToCode/leetcode-algorithms/blob/master/src/NimGame.java) |
90+
| 292 | [Nim Game](https://leetcode.com/problems/nim-game) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](https://github.com/anishLearnsToCode/leetcode-algorithms/blob/master/src/NimGame.java) [![Python](https://img.icons8.com/color/35/000000/python.png)](python/nim_game.py) |
9191
| 293 | [Flip Game](https://leetcode.com/problems/flip-game) | Easy | |
9292
| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](https://github.com/anishLearnsToCode/leetcode-algorithms/blob/master/src/BullsAndCows.java) |
9393
| 303 | [Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable) | Easy | [![Java](https://img.icons8.com/color/40/000000/java-coffee-cup-logo.png)](https://github.com/anishLearnsToCode/leetcode-algorithms/blob/master/src/RangeSumQueryImmutable.java) |

python/nim_game.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def canWinNim(self, n: int) -> bool:
3+
return n % 4 is not 0

0 commit comments

Comments
 (0)