mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-06 07:14:56 -06:00
4 lines
360 B
Python
4 lines
360 B
Python
def find_anagrams(word, candidates):
|
|
word, lowercandidates = word.lower(), list(map(lambda item : item.lower(), candidates))
|
|
build = {char : word.count(char) for char in word.lower()}
|
|
return [candidates[index] for index, candidate in enumerate(lowercandidates) if {char : candidate.count(char) for char in candidate} == build and candidate != word] |