Simple Bitmask similar to count subarray sum with 0 count which uses hashmap

```cpp []
class Solution {
public:
    int longestAwesome(string s) {

        unordered_map<int,int>mp; // Bitmask -> First seen position
        int mask = 0;
        int best = 0;

        mp[0] = -1;
        
        for (int i = 0; i < s.size(); i++) {
                mask = (1 << s[i] - '0') ^ mask;
                if (mp.find(mask) != mp.end()) {
                    best = max(best, i - mp[mask]);
                }

                for (int j = 0; j <= 9; j++) {
                    int new_mask = mask ^ (1 << j);
                    if (mp.find(new_mask) != mp.end()) {
                        best = max (best, i - mp[new_mask]);
                    }
                }

                if (mp.find(mask) == mp.end()) {
                    mp[mask] = i;
                }
        }
        return best;
    }
};
```
['C++']