Java, bit manipulation and divide into two groups.
\npublic class Solution {\n    public int findMaximumXOR(int[] nums) {\n       int max = Integer.MIN_VALUE;\n       int highBit = 0, count = 0;\n       for(int 
```\npublic class Solution {\n    public int findMaximumXOR(int[] nums) {\n       int max = Integer.MIN_VALUE;\n       int highBit = 0, count = 0;\n       for(int num: nums) max = Math.max(max, num);\n       while(count<=31){\n           if((max & (1<<count)) != 0) highBit = count;\n           count++;\n       }\n       List<Integer> isOne = new ArrayList<>();\n       List<Integer> notOne = new ArrayList<>();\n       \n       for(int num: nums){\n           if(((num>>highBit) & 1) == 1) isOne.add(num);\n           else notOne.add(num);\n       }\n       \n       return recur(isOne, notOne, highBit-1);\n    }\n    private int recur(List<Integer> isOne, List<Integer> notOne, int highBit){\n        if(isOne.size()==1 && notOne.size()==1) return isOne.get(0) ^ notOne.get(0);\n        \n        List<Integer> l11 = new ArrayList<>();\n        List<Integer> l10 = new ArrayList<>();\n        List<Integer> l01 = new ArrayList<>();\n        List<Integer> l00 = new ArrayList<>();\n        \n        for(int num: isOne){\n            if(((num>>highBit) & 1) != 0) l11.add(num);\n            else l10.add(num);\n        }\n        \n        for(int num: notOne){\n            if(((num>>highBit) & 1) != 0) l01.add(num);\n            else l00.add(num);\n        }\n        \n        int max = 0;\n        if(l11.size()!=0 && l00.size()!=0) max = recur(l11, l00, highBit-1);\n        if(l10.size()!=0 && l01.size()!=0) max = Math.max(max, recur(l10,l01,highBit-1));\n        return max;\n    }\n}\n\n```\n\nTime: O(nlog(HighestBit))\n\nWelcome any improvement suggestion and welcome to find bugs.\n\nThanks!
[]