problem
solution1:
class Solution {
public:
int longestPalindrome(string s) {
map<char, int> temp;
for(auto it:s) temp[it]++;
int even = , odd = , mid=false;
for(auto it=temp.begin(); it!=temp.end(); ++it)
{
if(it->second % ==) even+=it->second;
else
{
mid = true;
odd += it->second-;
} }
return even+(mid?(odd+):);
}
};
参考
1. Leetcode_409. Longest Palindrome;
完