class Solution { public int findMaximumXOR(int[] nums) { Trie dict = new Trie(); int max = Integer.MIN_VALUE; for (int i:nums){ dict.insert(i); } for (int i:nums){ max = Math.max(max,dict.pieceMax(i)); } return max; } } class Trie{ private Node root; public Trie(){ root = new Node(); } public void insert(int n){ Node curr = root; // Build trie include all bit of number follow level for (int i=31; i>=0; i--){ // Split binary code int bit = (n&(1<=0; i--){ int bit = (n&(1< have 0^1 OR 1%0 -> update sum, 1<