Game of XOR

0

0 votes
Open, Open, Open, Implementation, Basic Programming, Ad-Hoc, Easy, approved, Basics of Implementation
Problem

You are given an array A of size N. The value of the array is the bitwise XOR of the elements that the array contains. For example, the value of the array [1,2,3] = 123. Now, you are required to find the bitwise XOR of the value of all subarrays of array A.

Input format

  • First line: A single integer T denoting the number of test cases
  • For each test case:
    • First line: An integer N denoting the size of array A
  • Next line: N space-separated integers, where the ith integer denotes the value A[i]

Output format

For each of the test case, print the required answer in a separate line.

Constraints

1T20

1N105

1A[i]106

Sample Input
1
2
1 2
Sample Output
0
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For the given input following subarrays are possible : [1], [1 2], [2] and when you XOR them answer is 0.

Editor Image

?