266. Palindrome Permutation
class Solution:
def canPermutePalindrome(self, s: str) -> bool:
counter = Counter(s)
count = 0
for key in counter:
if counter[key] % 2 == 1:
count += 1
return count <= 1class Solution:
def canPermutePalindrome(self, s: str) -> bool:
counter = Counter(s)
count = 0
for key in counter:
if counter[key] % 2 == 1:
count += 1
if count >= 2:
return False
return TrueLast updated