gary@interview:~/interview/coding/409-longest-pali….md$
$ cat ./coding/409-longest-palindrome.md
[Coding]

409. Longest Palindrome

────────────────────────────────────────────────────────────

409. Longest Palindrome

from collections import Counter

class Solution:
    def longestPalindrome(self, s):
        """
        :type s: str
        :rtype: int
        """
        counter = Counter(s)
        
        r = 0
        for c in counter:
            r += counter[c] // 2 * 2
            if r % 2 == 0 and counter[c] % 2 == 1:
                r += 1
        return r
--tags#Hash Table
$ ls ./coding/ | grep -v 409-longest-palindrome
265. Paint House II256. Paint House143. Reorder List1762. Buildings With an Ocean View
← cd ../codingcd ~