LeetCode 292 Nim Game
这道题并不能显示出Python的强大,仅仅作为练手吧
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
# if the number can be divided by 4, first hand will lose anyway
return n % 4 != 0;
浙公网安备 33010602011771号