TLE: the best I could do :(
\nclass Solution {\n    \n    unordered_map<string,int> cache;\n    \n    bool isMapPalindrome(unordered_map<char,int>& myMap) {\n        //one odd or no odd\n 
```\nclass Solution {\n    \n    unordered_map<string,int> cache;\n    \n    bool isMapPalindrome(unordered_map<char,int>& myMap) {\n        //one odd or no odd\n        int oddCount = 0;\n        \n        for(auto& m: myMap) {\n            if(m.second % 2 == 1)\n                oddCount++;\n        }\n        \n        if(oddCount <= 1)\n            return true;\n        else\n            return false;\n    }\n    \npublic:\n    int longestAwesome(string s) {\n        unordered_map<char,int> myMap;\n        \n        if(cache.find(s) != cache.end())\n            return cache[s];\n        \n        for(auto& ch: s)\n            myMap[ch]++;\n        \n        if(isMapPalindrome(myMap)) {\n            \n            cache[s] = s.length();\n            \n            return s.length();\n        }\n        \n        string sleft =  s.substr(0, s.size() - 1);\n        string sright = s.substr(1, s.size() - 1);\n        string middle = s.substr(1, s.size() - 2);\n        \n        \n        cache[s] = max(max(longestAwesome(sleft), longestAwesome(sright)),longestAwesome(middle));\n        return cache[s];\n    }\n};\n```
[]