class Solution:
def longestPalindrome(self, s: str) -> int:
length = 0
single = False
for c in string.ascii_letters:
count = s.count(c)
length += count - count % 2
if count % 2 == 1:
single = True
if single:
length += 1
return length