Back
Close

XOR 'em all

Statement
The program:
Given the list of N digits, either 1 and 0 you need to output one number either 1 or 0 which is a result of XORing whole list.
For example:
1 0 1 0 0 -> apply xor to first two elements and put it at the beginning of the list = 1 1 0 0 -> ... -> 0
so you should output a 0 for this list.
INPUT:
Only line of input: list of 1 and 0

OUTPUT:
Only line of output: either 1 or 0 , the result of XORing over the list

CONSTRAINTS:
1 ≤ N ≤ 10000

EXAMPLE:
Input
1 0 1
Output
0
 

Game modes
Fastest, Shortest

Test cases
Simple Test
Input
3 1 0 1
Output
0

Validator 1 Validator
Input
3 0 1 0
Output
1

Example Test
Input
5 1 0 1 0 0
Output
0

Validator 2 Validator
Input
10 1 0 1 0 0 1 0 1 0 0
Output
0

Test 3 Test
Input
12 1 1 1 1 1 1 1 1 1 1 1 1
Output
0

Validator 3 Validator
Input
13 1 1 1 1 1 1 1 1 1 1 1 1 1
Output
1

Test 4 Test
Input
24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Output
1

Validator 4 Validator
Input
30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0
Output
0

Solution language

Solution

Stub generator input