[C++] Easy understanding Explained with Comments using Map
\nclass Solution {\npublic:\n    // Similar to :-\n    // https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/\n\t// To un
```\nclass Solution {\npublic:\n    // Similar to :-\n    // https://leetcode.com/problems/find-the-longest-substring-containing-vowels-in-even-counts/\n\t// To understand logic behind using xor here , see:\n\t// https://leetcode.com/submissions/detail/665490340/\n\t//\n    int longestAwesome(string s) {\n        int parity = 0000000000 ; // 9-8-7..1-0\n        unordered_map <int,int> m ;\n        m[0] = 0; // empty case\n        int ans = 0;\n        for ( int i = 0;i<s.length();i++){\n            int x = s[i]-\'0\';\n            parity ^= (1<<x);\n            if(m.find(parity)!=m.end()){ // for 0 case\n                    ans=max(ans,i+1-m[parity]);\n                    m[parity]=min(m[parity],i+1);\n            }\n            for ( int j=0 ; j<=9;j++)\n                if(m.find(parity^(1<<j))!=m.end())\n                    ans=max(ans,i+1-m[parity^(1<<j)]);\n            if(m.find(parity)==m.end())\n                m[parity]=i+1;\n        }\n        return ans;\n    }\n};\n```
['Dynamic Programming', 'Bit Manipulation', 'C', 'Bitmask']