2018-08-27 14:59:08 -04:00
|
|
|
def find_anagrams(word, candidates):
|
2014-06-28 03:40:14 +02:00
|
|
|
return [candidate
|
|
|
|
|
for candidate in candidates
|
|
|
|
|
if _letters(candidate) == _letters(word)
|
|
|
|
|
if candidate.lower() != word.lower()]
|
2013-07-30 17:14:36 -05:00
|
|
|
|
|
|
|
|
|
2014-06-28 03:40:14 +02:00
|
|
|
def _letters(word):
|
|
|
|
|
return sorted(word.lower())
|