Simple Java Solution
\npublic int longestPalindrome(String s) {\n\tif(s==null || s.length()==0) return 0;\n\tSet<Character> set = new HashSet<>();\n\tint count = 0;\n\tchar[] chars 
```\npublic int longestPalindrome(String s) {\n\tif(s==null || s.length()==0) return 0;\n\tSet<Character> set = new HashSet<>();\n\tint count = 0;\n\tchar[] chars = s.toCharArray();\n\tfor(char c: chars) {\n\t\tif(set.remove(c)) {\n\t\t\tcount++;\n\t\t} else {\n\t\t\tset.add(c);\n\t\t}\n\t}\n\treturn set.isEmpty() ? count*2 : count*2+1;\n}\n```
['Hash Table', 'Java']