Easy C++ Solution
\n\n# Code\n\nclass Solution {\npublic:\n    int longestAwesome(string s) {\n        // 3 2 4 2 4 1 5\n        unordered_map<int,int>mp;\n        int ans=1;\n  
\n\n# Code\n```\nclass Solution {\npublic:\n    int longestAwesome(string s) {\n        // 3 2 4 2 4 1 5\n        unordered_map<int,int>mp;\n        int ans=1;\n        int num=0;\n        mp[0]=-1;\n        for(int i=0;i<s.length();i++)\n        {\n            num=num^(1<<(s[i]-\'0\'));\n            // case 1\n            if(mp.find(num)!=mp.end())\n            {\n                ans=max(ans,i-mp[num]);\n            }\n            // checking for palindrome\n            for(int j=0;j<=9;j++)\n            {\n                int mask=num^(1<<j);\n                if(mp.find(mask)!=mp.end())\n                {\n                    ans=max(ans,i-mp[mask]);\n                }\n            }\n            if(mp.find(num)==mp.end())\n            {\n                mp[num]=i;\n            }\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'Bit Manipulation', 'C++']