You are viewing a single comment's thread. Return to all comments →
one line, can you golf it more? ;)
return (sum(s.count(x)%2 for x in set(s) ) <2 and 'YES') or 'NO'
Without using sets (and in Haskell, not Python):
isAnaPalin = bool "YES" "NO" . (>1) . length . filter id . map (odd . length) . group . sort
I'm sure it's possible to do a lot better than that though.