[Java] Photo explained code
\n\n    public int findMaximumXOR(int[] nums) {\n        int result = 0;\n        int mask = 0;\n        for (int i = 31; i >= 0; i--) {\n            mask |= (1
![image](https://assets.leetcode.com/users/images/ff46f44b-4543-48d2-97ac-ce58f301e47a_1600252667.5149417.png)\n```\n    public int findMaximumXOR(int[] nums) {\n        int result = 0;\n        int mask = 0;\n        for (int i = 31; i >= 0; i--) {\n            mask |= (1 << i);\n            final HashSet<Integer> set = new HashSet<>();\n            for (int n : nums) {\n                set.add(n & mask);\n            }\n            int temp = result | (1 << i);\n            for (int it : set) {\n                if (set.contains(it ^ temp)) {\n                    result = temp;\n                    break;\n                }\n            }\n        }\n        return result;\n    }\n```
['Java']