Ad

Write a function that efficiently finds all anagrams of a given word from a large list of words. The solution must be optimized for performance, handling datasets with 100,000+ words in under 1 second.

find_anagrams("race", ["care", "acer", "Race", "carr", "arc"])

➞ ["care", "acer", "Race"]

def find_anagrams(word, word_list):
    pass