Python [Simple Bit manipulation]
\n\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n        d,mask,ans={},0,0\n        d[0]=-1\n        for i in range(len(s)):\n            num=
```\n\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n        d,mask,ans={},0,0\n        d[0]=-1\n        for i in range(len(s)):\n            num=ord(s[i])-ord(\'0\')\n            mask=mask^(1<<num)\n            if mask in d:\n                ans=max(ans,i-d[mask])\n            else:\n                d[mask]=i\n            for j in range(0,10):\n                temp=mask^(1<<j)\n                if temp in d:\n                    ans=max(ans,i-d[temp])\n        return ans \n                    \n```\nPlease upvote
['Bitmask', 'Python']