OR of XOR

3.5

2 votes
Easy
Problem

You are given an array of N integers . Find and output the Bitwise OR of XORs of all the possible subarrays of the given array .

Input Format

The first line will consist of the number of elements in the array i.e N.

The next line will consist of N space separated integers denoting the elements of the array .

Output Format

Output a single value denoting the Bitwise OR of XORs of all the subarrays of the given array

Constraints

1N106

0a[i]103

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

All the possible subarrays of the given array are

1

2

3

1 2

2 3

1 2 3

The Bitwise OR of the XORs of the subarray is 1 OR 2 OR 3 OR 3 OR 1 OR 0 = 3

Editor Image

?