1 statement in Python


  • 1
    from collections import Counter as C
    
    class Solution(object):
        def canPermutePalindrome(self, s):
            return not sum(e % 2 for e in C(s).values()) ^ (len(s) % 2)

Log in to reply
 

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