bitmask
\n\nclass Solution {\npublic:\n    int longestAwesome(string s) {\n\n     unordered_map<int,int>mp;\n        mp[0]=-1;\n      \n         int mask=0; \n         
\n```\nclass Solution {\npublic:\n    int longestAwesome(string s) {\n\n     unordered_map<int,int>mp;\n        mp[0]=-1;\n      \n         int mask=0; \n          int ans=1;\n          \n          for(int i=0;i<s.size();i++){\n            mask=mask ^( 1<<(s[i]-\'0\')); \n            if(mp.find(mask)!=mp.end()) ans=max(ans,i-mp[mask]);\n            else mp[mask]=i;\n        \n            for(int k=0;k<=9;k++){\n                  int num=mask^(1<<k);\n                if(mp.find(num)!=mp.end()) ans=max(i-mp[num],ans);\n            }\n     \n        \n          }\n          return  ans;\n\n\n\n    }\n};\n```
['C++']