Maximum XOR Pair


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C++, Python

Maximum XOR Pair Problem

Given N integers A1, A2, …, AN, choose two of them to compute the XOR (exclusive‑or) value. What is the maximum possible result?

Input Format

  • The first line contains an integer N.
  • The second line contains N integers A1 … AN.

Output Format
Output a single integer — the maximum XOR value obtained from two chosen numbers.

Data Range
1 ≤ N ≤ 105
0 ≤ Ai < 231

Sample Input

3
1 2 3

Sample Output

3

Comments

There are no comments at the moment.