Python || Bit-Mask
\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n\t    #keeps track of last index where this state was seen\n        last_seen={}\n        ans=0
```\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n\t    #keeps track of last index where this state was seen\n        last_seen={}\n        ans=0\n        mask=0\n        last_seen[mask]=-1\n        for i,c in enumerate(s):\n            c=int(c)\n            mask ^= (1<<c)\n            if mask in last_seen:\n                ans=max(ans,i-last_seen[mask])\n            else:\n                last_seen[mask]=i\n\t\t\t#checking for one odd char in palindrome\n            for x in range(10):\n                new_mask=mask ^ (1<<x)\n                if new_mask in last_seen:\n                    ans=max(ans,i-last_seen[new_mask])\n        return ans\n            \n            \n```
['Dynamic Programming', 'Bit Manipulation', 'Bitmask', 'Python']