Java HashMap Bits Xor | Explaination
We use Xor operation to add/include elements. We check in the hashmap if at some previous index \'n\' we found the same Xor as current Xor. If yes then it mean 
We use Xor operation to add/include elements. We check in the hashmap if at some previous index \'n\' we found the same Xor as current Xor. If yes then it mean all elements from index \'n\' to current index have even frequencies since their Xor is zero. but we can have atmost one digit with odd frequency. So for that we will use a for loop and check in th map for currXor Xored with any one digit. this is done to check odd length palindrome. Algorithm is similar to finding max Length subarray with sum equal to k OR 0.\n```\n\tpublic int longestAwesome(String s) {\n        Map<Integer,Integer> bitXor= new HashMap<>();\n        bitXor.put(0,-1);\n        int currXor= 0, maxLength= 0;\n        for(int i=0; i<s.length(); i++){\n            currXor^= (1<<(s.charAt(i)-\'0\'));\n            if(bitXor.containsKey(currXor)) maxLength= Math.max(maxLength,i-bitXor.get(currXor));\n            for(int j=0; j<=9; j++){\n                int oddLength= currXor^(1<<j);\n                if(bitXor.containsKey(oddLength)){\n                    maxLength= Math.max(maxLength,i-bitXor.get(oddLength));\n                }\n            }\n            bitXor.putIfAbsent(currXor,i);\n        }\n        return maxLength;\n    }\n
[]