题目:
题解:
func longestPalindrome(s string) int {
mp := map[byte]int{}
for i := 0; i < len(s); i++ {
mp[s[i]]++
}
res := 0
for _, v := range mp {
if v&1 == 1 {
res += v - 1
} else {
res += v
}
}
if res<len(s) {
res++
}
return res
}