Skip to content

Commit a264414

Browse files
committed
solved: 292. Nim Game
Signed-off-by: rajput-hemant <[email protected]>
1 parent a5bfc59 commit a264414

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
impl Solution {
2+
pub fn can_win_nim(n: i32) -> bool {
3+
// if n is divisible by 4, then the first player will always lose
4+
if n % 4 == 0 {
5+
return false;
6+
}
7+
8+
true
9+
}
10+
}

0 commit comments

Comments
 (0)