class Solution:
def longestPalindrome(self, s):
if not s:
return 0
a = set(s)
dict_str = {}
for i
in a:
dict_str[i] = s.count(i)
re_1, re_2, re_3 =
0,
0,
0
for key
in dict_str:
if dict_str[key] %
2 ==
0:
re_2 += dict_str[key]
else:
re_1 = re_1 + dict_str[key] -
1
re_3 =
1
return re_1 + re_2 + re_3