题目:

题解:
class Solution:
def longestPalindrome(self, s: str) -> int:
ans = 0
count = collections.Counter(s)
for v in count.values():
ans += v // 2 * 2
if ans % 2 == 0 and v % 2 == 1:
ans += 1
return ans



















![[Redis] Redis中的set和zset类型](https://i-blog.csdnimg.cn/direct/c1387efae6d74e9c9f00be5bb1727266.png)