You are on page 1of 1

Maximum XOR Subarray

Send Feedback
Given an array of n integers, find subarray whose xor is maximum.
Input Format
First line contains single integer n (1<=n<=1000000).
Next line contains n space separated integers.
Output Format
Print xor of the subarray whose xor of all elements in subarray is maximum over all
subarrays.
Constraints
1 <= n <= 1000000
1 <= A[i] <=100000
Sample Input
4
1 2 3 4
Sample Output
7

You might also like