← Home
write a go solution for Description:
Today, as a friendship gift, Bakry gave Badawy n integers a_1,a_2,...,a_n and challenged him to choose an integer X such that the value underset1<=i<=nmax(a_ioplusX) is minimum possible, where oplus denotes the bitwise XOR operation.

As always, Badawy is too lazy, so you decided to help him and find the minimum possible value of underset1<=i<=nmax(a_ioplusX).

Input Format:
The first line contains integer n (1<=n<=10^5).

The second line contains n integers a_1,a_2,...,a_n (0<=a_i<=2^30-1).

Output Format:
Print one integer — the minimum possible value of underset1<=i<=nmax(a_ioplusX).

Note:
In the first sample, we can choose X=3.

In the second sample, we can choose X=5.. Output only the code with no comments, explanation, or additional text.