python3 easy to understand solution 98.12% beats with froop
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n![image.png](https://assets.leetcode.com/users/images/7e2b0569-0ae4-4521-8460-a39c8be76090_1690941548.1367922.png)\nPlease Upvote !!!!!!!!!!!\n\n# Code\n```\nclass Solution:\n    def longestPalindrome(self, s: str) -> int:\n      set_=set()\n      for character in s:\n        if character not in set_:set_.add(character)\n        else:set_.remove(character)\n      if len(set_) != 0:return len(s)-len(set_)+1\n      else:return len(s)\n```
['Python3']