Python3 O(n) using dict
\ndef longestPalindrome(s):\n        letters = {}\n        \n        max = 0\n        for c in s:\n            if c in letters:\n                letters.pop(c)\
```\ndef longestPalindrome(s):\n        letters = {}\n        \n        max = 0\n        for c in s:\n            if c in letters:\n                letters.pop(c)\n                max += 2\n            else:\n                letters[c] = 1\n        \n        if letters:\n            max += 1\n        \n        return max\n```
[]