Games
1 min readJan 17, 2020
810. Chalkboard XOR Game
class Solution:
def xorGame(self, nums: List[int]) -> bool:
xor = 0
for i in nums: xor ^= i
return xor == 0 or len(nums) % 2 == 0
810. Chalkboard XOR Game
class Solution:
def xorGame(self, nums: List[int]) -> bool:
xor = 0
for i in nums: xor ^= i
return xor == 0 or len(nums) % 2 == 0