Game of XOR
Practice
0 (0 votes)
Open
Open
Open
Implementation
Basic programming
Ad Hoc
Easy
Approved
Basics of implementation
Problem
77% Success 109 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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]\) = \( 1 \oplus 2 \oplus 3 \). 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 \(i^{th}\) integer denotes the value \(A[i]\)

Output format

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

Constraints

\( 1 \le T \le 20 \)

\( 1 \le N \le 10^5 \)

\( 1 \le A[i] \le 10^6 \)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
32 votes
Tags:
ApprovedData StructuresEasyOpen
Points:30
2 votes
Tags:
Easy-Medium
Points:30
Tags:
Data StructuresMediumApprovedRecruit