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;

  

posted on 2016-08-18 21:45  wenchan  阅读(115)  评论(0)    收藏  举报