[java] Simple solution, faster than 100%
\nclass Solution {\n    public int longestPalindrome(String s) {\n        boolean[] seen = new boolean[58];\n        int len = 0;     \n        int singles = 0;
```\nclass Solution {\n    public int longestPalindrome(String s) {\n        boolean[] seen = new boolean[58];\n        int len = 0;     \n        int singles = 0;\n        \n        for (char c : s.toCharArray()) {\n            int index = c - \'A\';\n            if (seen[index]) {\n                seen[index] = false;\n                len += 2;\n                singles--;\n            } else {\n                seen[index] = true;\n                singles++;\n            }\n        }\n        \n        return len + (singles > 0 ? 1 : 0);\n    }\n}\n```
[]