Clean C++ with good naming and clear intermediate variables
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 longest = 0;\n        using hash_t = uint16_t;\n        unordered_map<hash_t, int> idxs; // hash->idx\n        idxs[0] = -1;\n        hash_t psum = 0;\n        hash_t valid_palindromes[] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512};\n        for (int i = 0; i < s.size(); i++) {\n            int digit = s[i]-\'0\';\n            psum ^= 1 << digit;\n            for (hash_t target : valid_palindromes) {\n                hash_t needed = psum ^ target;\n                if (idxs.count(needed)) {\n                    int length = i - idxs[needed];\n                    longest = max(longest, length);\n                }\n            }\n            if (!idxs.count(psum)) {\n                idxs[psum] = i;\n            }\n        }\n        return longest;\n    }\n};\n```
['C++']