Hash + Bitmask
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int longestAwesome(string s) {\n        int n = s.size();\n        unordered_map<int, int> pos;\n        pos[0] = -1;\n        int mask = 0;\n        int ans = 0;\n        for (int i = 0; i < s.size(); i++) {\n            mask^= 1 << (s[i]-\'0\');\n            if (!pos.count(mask)) pos[mask] = i;\n            ans = max(ans, i - pos[mask]);\n            /*  odd :  different 1 bit */\n            for (int j =0; j <=9; j++) {\n                if (pos.count(mask ^ (1<<j))) {\n                    ans = max(ans, i -pos[mask ^ (1<<j)]);\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'Bit Manipulation', 'Bitmask', 'C++']