bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 810. Chalkboard XOR Game

810. Chalkboard XOR Game

Leetcode Solutions

Parity Based Solution

  1. Calculate the XOR of all elements in the array.
  2. If the XOR is 0, Alice wins.
  3. If the XOR is not 0, check the number of elements in the array.
  4. If the number of elements is even, Alice wins.
  5. If the number of elements is odd, Alice loses.
UML Thumbnail

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...