LEETCODE
UNLOCKED
🧋
Ad-free goal
1/5
A
Alex
🧋
AMAMazing
Your name here
Buy a boba, get your link shown
Nim Game
Solution Code
Python
Java
C++
Javascript
Copy
class Solution: def canWinNim(self, n: int) -> bool: return n % 4 != 0
Time Complexity
O(
1
)
Space Complexity
O(
1
)