- for n = 1,2,3, you can win because you can take them all for the

first shot - for n = 4, you lose
- for n = 4 * 1 + (1, 2, 3), you can reduce the case to 2), you will

win - for n = 4 * 2, you lose

```
public class Solution {
public boolean canWinNim(int n) {
return (n % 4 != 0);
}
}
```