Skip to content

292. Nim Game

https://leetcode.com/problems/nim-game/

js
/**
 * @param {number} n
 * @return {boolean}
 */
var canWinNim = function(n) {
	return n % 4 !== 0;
};
py
class Solution(object):
    def canWinNim(self, n):
        """
        :type n: int
        :rtype: bool
        """
        return n % 4 != 0