5 lines C++
\nclass Solution {\npublic:\n    int longestPalindrome(string s) {\n        vector<int> m(256, 0);        \n        for (auto& c : s) m[c-'\\0']++;\n        int
```\nclass Solution {\npublic:\n    int longestPalindrome(string s) {\n        vector<int> m(256, 0);        \n        for (auto& c : s) m[c-'\\0']++;\n        int result = 0;\n        for (auto& i : m) result += i%2 ? (result%2 ? i-1 : i) : i;\n        return result;\n    }\n};\n```
[]