Three Line Python Code (32ms)


  • 1
    R
    class Solution(object):
        def canPermutePalindrome(self, s):
            """
            :type s: str
            :rtype: bool
            """
            Count = collections.Counter(s)
            List = [x for _, x in Count.items() if x % 2]
            return True if len(List) in (0,1) else False
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.