Problem Description :
Given an integer array 'nums', return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.
Example :
Input : nums = [3,10,5,25,2,8]
Output : 28
Explanation : The maximum result is 5 XOR 25 = 28.
My Contribution Details :
I'll provide the well commented C++ code with the most optimal Time Complexity of O(n) and Space Complexity of O(1) using the Trie approach.
Problem Description : Given an integer array 'nums', return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.
Example : Input : nums = [3,10,5,25,2,8] Output : 28 Explanation : The maximum result is 5 XOR 25 = 28.
My Contribution Details : I'll provide the well commented C++ code with the most optimal Time Complexity of O(n) and Space Complexity of O(1) using the Trie approach.
Kindly assign this issue to me.