```
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
# Method 1
rs = n%4
if rs == 0:
return False
return True
# Method 2
# if n <= 3:
# return True
# rs = [False] * n
# rs[0] = True
# rs[1] = True
# rs[2] = True
# cur = 3
# while cur < n:
# if rs[cur-3] and rs[cur-2] and rs[cur-1]:
# rs[cur] = False
# else:
# rs[cur] = True
# cur += 1
# return rs[-1]
```