✔✔ || C++ || Bit Manipulation + Bitmasking || String
\tclass Solution {\n\tpublic:\n\n\t\tint longestAwesome(string s) {\n\n\t\t\tunordered_map mp;\n\t\t\tmp[0] = -1;\n\n\t\t\tint n = s.size();\n\t\t\tint len = 0;
\tclass Solution {\n\tpublic:\n\n\t\tint longestAwesome(string s) {\n\n\t\t\tunordered_map<int , int> mp;\n\t\t\tmp[0] = -1;\n\n\t\t\tint n = s.size();\n\t\t\tint len = 0;\n\t\t\tint curr = 0;\n\t\t\tfor(int i = 0 ; i < n ; i++){\n\n\t\t\t\tint mask = 1 << (s[i] - \'0\');\n\t\t\t\tcurr ^= mask;\n\n\t\t\t\t/// case : 1\n\t\t\t\t/// To check for all even position\n\t\t\t\tif(mp.count(curr)){\n\t\t\t\t   len = max(len , i - mp[curr]);\n\t\t\t\t}\n\n\t\t\t\t/// case : 2\n\t\t\t\t/// To make exactly one odd position\n\t\t\t\tfor(int j = 0 ; j <= 9 ; j++){\n\t\t\t\t\tmask = 1 << j;\n\t\t\t\t\tif(mp.count(curr ^ mask)){\n\t\t\t\t\t   len = max(len , i - mp[curr ^ mask]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(mp.count(curr) == 0){\n\t\t\t\t   mp[curr] = i;   \n\t\t\t\t}\n\t\t\t}\n\t\t\treturn len;\n\t\t}\n\t};
['String', 'Bit Manipulation', 'C', 'Bitmask']