2 methods for python


  • 12
    X
    class Solution(object):
    def canWinNim(self, n):
        """
        :type n: int
        :rtype: bool
        """
        return bool(n % 4)
    
    class Solution(object):
    def canWinNim(self, n):
        """
        :type n: int
        :rtype: bool
        """
        return bool(n & 3)

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.