Skip to content

Commit c7c42be

Browse files
committed
Create nim-game.cpp
1 parent 9c69b0a commit c7c42be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

C++/nim-game.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Time: O(1)
2+
// Soace: O(1)
3+
4+
class Solution {
5+
public:
6+
bool canWinNim(int n) {
7+
return n % 4 != 0;
8+
}
9+
};

0 commit comments

Comments
 (0)