@@ -0,0 +1,604 @@
+import java.util.HashSet;%0A%0Apublic class Solution %7B%0A%0A    public int longestPalindrome(String s) %7B%0A%0A        HashSet%3CCharacter%3E charactersHs = new HashSet%3CCharacter%3E();%0A%0A        int palindromeLen = 0;%0A%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A%0A            if (charactersHs.contains(s.charAt(i))) %7B%0A%0A                charactersHs.remove(s.charAt(i));%0A                palindromeLen += 2;%0A%0A            %7D else %7B%0A%0A                charactersHs.add(s.charAt(i));%0A%0A            %7D%0A%0A        %7D%0A%0A        if (!charactersHs.isEmpty()) %7B%0A            palindromeLen++;%0A        %7D%0A%0A        return palindromeLen;%0A%0A    %7D%0A%0A%7D%0A

Create : 409 Longest Palindrome