📌📌Python3 || ⚡simple solution uwu
\n\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        char_count = {}\n        for char in s:\n            char_count[char] = char_count
\n```\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        char_count = {}\n        for char in s:\n            char_count[char] = char_count.get(char, 0) + 1\n        \n        odd_count = 0\n        for count in char_count.values():\n            if count % 2 == 1:\n                odd_count += 1\n        \n        if odd_count <= 1:\n            return len(s)\n        else:\n            return len(s) - odd_count + 1\n```
['Python3']