Back to course home
0% completed
Vote For New Content
My Solution ( because the posted solution is useless, AI can code better than this)
designgurus
Aug 19, 2025
class Solution: def longestPalindrome(self, s: str) -> int: charFreq = Counter(s) result = 0 for char in set(s): if charFreq[char] % 2 == 1: result += charFreq[char] - 1 else: result += charFreq[char] return result + 1 if (len(s) - result) >= 1 else result
0
0
Comments
Comments
On this page