c++ using hashmap
\nclass Solution {\npublic:\n    int longestPalindrome(string s) {\n        unordered_map<char,int> map;\n        for(int i=0;i<s.length();i++){\n            ma
```\nclass Solution {\npublic:\n    int longestPalindrome(string s) {\n        unordered_map<char,int> map;\n        for(int i=0;i<s.length();i++){\n            map[s[i]]++;\n        }\n        int cnt=0;\n        for(auto i:map){\n            if(i.second%2!=0){\n                cnt++;\n            }\n        }\n        if(cnt>1){\n            return s.length()-cnt+1;\n        }\n        return s.length();\n    }\n};\n```
['C']