Python3 trie solution - Implement Magic Dictionary
\nfrom collections import defaultdict\n\nclass Node:\n    def __init__(self):\n        self.child = defaultdict(Node)\n        self.isEnd = False\n\nclass Magic
```\nfrom collections import defaultdict\n\nclass Node:\n    def __init__(self):\n        self.child = defaultdict(Node)\n        self.isEnd = False\n\nclass MagicDictionary:\n\n    def __init__(self):\n        self.trie = Node()\n    \n    def buildDict(self, words: List[str]) -> None:\n        for w in words:\n            n = self.trie\n            for c in w:\n                n = n.child[c]\n            n.isEnd = True\n            \n    def searchWord(self, n: \'Node\', word: str) -> bool:\n        for c in word:\n            if c not in n.child:\n                return False\n            n = n.child[c]\n        return n.isEnd\n        \n\n    def search(self, word: str) -> bool:\n        n = self.trie\n        for i, c in enumerate(word):\n            if any(self.searchWord(n.child[k], word[i+1:]) for k in n.child if c != k):\n                return True\n            if c not in n.child:\n                return False\n            n = n.child[c]\n```
['Trie', 'Python', 'Python3']