Count substrings with mask XOR having atmost 1 set bit
\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n        n = len(s)\n        f = {}\n        f[0] = 0\n        p = 0\n        res = 0\n        f
```\nclass Solution:\n    def longestAwesome(self, s: str) -> int:\n        n = len(s)\n        f = {}\n        f[0] = 0\n        p = 0\n        res = 0\n        for i in range(n):\n            p ^= 1 << (ord(s[i]) - ord(\'0\'))\n            res = max(res, i + 1 - f.get(p, n))\n            for c in range(10):\n                res = max(res, i + 1 - f.get(p ^ (1 << c), n))\n            if p not in f:\n                f[p] = i + 1\n \xA0 \xA0 \xA0 \xA0return res \n```
[]