# [Leetcode 421] Maximum XOR of Two Numbers in an Array

[Leetcode 421] Maximum XOR of Two Numbers in an Array

### 题目要求

Given a non-empty array of numbers, $a_{0},a_{1},a_{2},\dots,a_{n-1}$, where $0 \leq a_i<2^{31}$.

Find the maximum result of $a_i\oplus a_j$, where $0\leq i,j< n$.

Could you do this in $O(n)$ runtime?

Example:

Input: [3, 10, 5, 25, 2, 8]

Output: 28

Explanation: The maximum result is $5\oplus25=28$.