Maximum XOR of Two Numbers in an Array
Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.
Maximum XOR of Two Numbers in an Array

Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.

Example 1:
Input: [3,10,5,25,2,8]
Output: 28
Input
arr =[3,10,5,25,2,8]

Starting with 6 numbers. Will check bit by bit from MSB.

Numbers (Binary)
3
0
0
0
0
0
0
1
1
10
0
0
0
0
1
0
1
0
5
0
0
0
0
0
1
0
1
25
0
0
0
1
1
0
0
1
2
0
0
0
0
0
0
1
0
8
0
0
0
0
1
0
0
0
Bit-by-Bit Processing
Current Bit
-
Prefix Mask

00000000

Prefixes in Set (0)
Maximum XOR

0

(00000000)

Variables
No variables to display
DepthFunction Call
Stack empty
0/6