2 ms·
The Haskell programmer in me can't resist---eta reduce your functions! :P from functools import partial def odd_count(letters, ch): return
by burntsushi 12y ago
The Haskell programmer in me can't resist---eta reduce your functions! :P
from functools import partial
def odd_count(letters, ch):
return letters.count(ch) % 2
def anagram_of_palindrome(letters):
return sum(map(partial(odd_count, letters), set(letters))) <= 1