Problem
Given an array of non-negative integers nums, return the largest value of nums[i] ^ nums[j] over all pairs with 0 <= i <= j < n (so a number may be paired with itself, giving 0).
Example 1
- Input
- nums = [3, 10, 5, 25, 2, 8]
- Output
- 28
- Why
- 5 ^ 25
Example 2
- Input
- nums = [8, 10, 2]
- Output
- 10
- Why
- 8 ^ 2
Example 3
- Input
- nums = [7]
- Output
- 0
Constraints
1 <= nums.length <= 2 * 10^50 <= nums[i] <= 2^31 - 1