Score : $300$ points
Given is a number sequence $A$ of length $N$.
Let us divide this sequence into one or more non-empty contiguous intervals.
Then, for each of these intervals, let us compute the bitwise $\mathrm{OR}$ of the numbers in it.
Find the minimum possible value of the bitwise $\mathrm{XOR}$ of the values obtained in this way.
The bitwise $\mathrm{OR}$ of integers $A$ and $B$, $A\ \mathrm{OR}\ B$, is defined as follows:
The bitwise $\mathrm{XOR}$ of integers $A$ and $B$, $A\ \mathrm{XOR}\ B$, is defined as follows:
Input is given from Standard Input in the following format:
$N$ $A_1$ $A_2$ $A_3$ $\dots$ $A_N$
Print the answer.
3 1 5 7
2
If we divide $[1, 5, 7]$ into $[1, 5]$ and $[7]$, their bitwise $\mathrm{OR}$s are $5$ and $7$, whose $\mathrm{XOR}$ is $2$.
It is impossible to get a smaller result, so we print $2$.
3 10 10 10
0
We should divide this sequence into $[10]$ and $[10, 10]$.
4 1 3 3 1
0
We should divide this sequence into $[1, 3]$ and $[3, 1]$.