Python | Trie
\tclass Trie:\n\n\t\tdef init(self):\n\t\t\tself.root = dict()\n\n\t\tdef insert(self, words):\n\t\t\tfor word in words:\n\t\t\t\tcurrent = self.root\n\t\t\t\tf
\tclass Trie:\n\n\t\tdef __init__(self):\n\t\t\tself.root = dict()\n\n\t\tdef insert(self, words):\n\t\t\tfor word in words:\n\t\t\t\tcurrent = self.root\n\t\t\t\tfor char in word:\n\t\t\t\t\tif char not in current:\n\t\t\t\t\t\tcurrent[char] = dict()\n\t\t\t\t\tcurrent = current[char]\n\t\t\t\tcurrent[\'*\'] = \'*\'\n\n\t\t@lru_cache()\n\t\tdef search(self, target):\n\t\t\tif target == \'\':\n\t\t\t\treturn True\n\n\t\t\tresult = False\n\t\t\tnode = self.root\n\n\t\t\tfor index, char in enumerate(target):\n\t\t\t\tif char not in node:\n\t\t\t\t\tbreak\n\t\t\t\tnode = node[char]\n\t\t\t\tif \'*\' in node:\n\t\t\t\t\tresult = result or self.search(target[index+1:])\n\t\t\t\t\tif result:\n\t\t\t\t\t\tbreak\n\t\t\treturn result\n\n\tclass Solution:\n\t\tdef findAllConcatenatedWordsInADict(self, words: List[str]) -> List[str]:\n\t\t\tobj = Trie()\n\t\t\tobj.insert(words)\n\t\t\tfinal = []\n\t\t\tfor word in words:\n\t\t\t\tnode = obj.root\n\t\t\t\tfor index , char in enumerate(word):\n\t\t\t\t\tnode=node[char]\n\t\t\t\t\tif "*" in node:\n\t\t\t\t\t\tif index!=len(word)-1 and obj.search(word[index+1:]):\n\t\t\t\t\t\t\tfinal.append(word)\n\t\t\t\t\t\t\tbreak\n\t\t\treturn final\n\t\t\t\n**If You Like The Solution Upvote.**
['Trie', 'Python', 'Python3']