Easy to Understand || Clean Solution || Fully Explained || O(n) || Java😊
Request \uD83D\uDE0A:\n\nIf you find these solutions easy to understand and helpful, then\nPlease Upvote\uD83D\uDC4D\uD83D\uDC4D.\n\n\n# Code (Explained in comm
# Request \uD83D\uDE0A:\n```\nIf you find these solutions easy to understand and helpful, then\nPlease Upvote\uD83D\uDC4D\uD83D\uDC4D.\n```\n\n# Code (Explained in comments) :\n```\nclass Solution \n{\n    public int longestPalindrome(String s) \n    {\n        int count=0;\n        HashSet<Character> data=new HashSet<Character>();\n        for(int i=0;i<s.length();i++)\n        {\n            char c=s.charAt(i);\n            if(data.contains(c))//if contains remove the charcter and increase count\n            {\n                count+=2;//2 for no duplicacy Eg-aa\n                data.remove(c);\n            }\n            else//not contain add thr character\n            {\n                data.add(c);\n            }\n        }\n        if(data.size()>0)\n            count++;\n        return count;\n    }\n}\n```
['Hash Table', 'String', 'Greedy', 'Java']