Leetcode 292 Solution
This article provides solution to leetcode question 292 (nim-game)
Access this page by simply typing in "lcs 292" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/nim-game
Solution
class Solution {
public:
bool canWinNim(int n) {
switch ((n - 1) % 4)
{
case 0:
case 1:
case 2:
return true;
case 3:
return false;
}
return false;
}
};