A palindrome is a series of characters that read the same forwards as backwards such as "hannah", "racecar" and "lol".
For this Kata you need to write a function that takes a string of characters and returns the length, as an integer value, of longest alphanumeric palindrome that could be made by combining the characters in any order but using each character only once. The function should not be case sensitive.
For example if passed "Hannah" it should return 6 and if passed "aabbcc_yYx_" it should return 9 because one possible palindrome would be "abcyxycba".
from collections import Counter

def longest_palindrome(s):
    freq = Counter(c for c in s.lower() if c.isalnum())
    even, odd = [], []
    for k, v in freq.items():
        if v % 2:    odd.append(v-1)
        else:        even.append(v)
    return sum(even) + (sum(odd) + 1 if odd else 0)
from collections import Counter

def longest_palindrome(s):
    freq = Counter(c for c in s.lower() if c.isalnum())
    even, odd = [], []
    for k, v in freq.items():
        if v % 2:    odd.append(v-1)
        else:        even.append(v)
    return sum(even) + (sum(odd) + 1 if odd else 0)