📜  字谜python代码示例

📅  最后修改于: 2022-03-11 14:46:10.727000             🧑  作者: Mango

代码示例2
from collections import defaultdict

def findAnagrams(input_str):
    anagram = defaultdict(list)

    for word in input_str:
        anagram[str(sorted(word))].append(word)
    return list(anagram.values())