✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1\nTime complexity: O(n). Space complexi
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        return min(sum(v&~1 for v in Counter(s).values())+1,len(s))\n```\nSeen [here](https://leetcode.com/problems/longest-palindrome/solutions/89587/what-are-the-odds-python-c/comments/94209)\n\n# Code #2\nTime complexity: $$O(n)$$. Space complexity: $$O(1)$$.\n```\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n        return sum(reduce(lambda q,v:(q[0]+v&~1,q[1]|v&1),Counter(s).values(),(0,0)))\n```\n\n(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be \'true\' oneliners - please, remind about drawbacks only if you know how to make it better)
['Hash Table', 'String', 'Python', 'Python3']