simple python solution with hash table
\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        s_dict, l, flag = dict(), len(s), False\n        for c in s:\n            s_dict[c] 
```\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        s_dict, l, flag = dict(), len(s), False\n        for c in s:\n            s_dict[c] = s_dict.get(c, 0) + 1\n        for v in s_dict.values():\n            if v%2 == 1:\n                l -= 1\n                flag = True\n        return l + 1 if flag else l\n```
[]