✅✅Python Simple Solution 🔥🔥 Easy to Understand🔥🔥
Please UPVOTE \uD83D\uDC4D\n\n!! BIG ANNOUNCEMENT !!\nI am Giving away my premium content videos related to computer science and data science and also will be s
# Please UPVOTE \uD83D\uDC4D\n\n**!! BIG ANNOUNCEMENT !!**\nI am Giving away my premium content videos related to computer science and data science and also will be sharing well-structured assignments and study materials to clear interviews at top companies to my first 1000 Subscribers. So, **DON\'T FORGET** to Subscribe\n\nhttps://www.youtube.com/@techwired8/?sub_confirmation=1\n```\nclass TrieNode:\n    def __init__(self):\n        self.children = {}\n        self.is_word = False\n        \nclass WordDictionary:\n    def __init__(self):\n        self.root = TrieNode()      \n\n    def addWord(self, word):\n        current_node = self.root\n        for character in word:\n            current_node = current_node.children.setdefault(character, TrieNode())\n        current_node.is_word = True\n        \n    def search(self, word):\n        def dfs(node, index):\n            if index == len(word):\n                return node.is_word\n               \n            if word[index] == ".":\n                for child in node.children.values():\n                    if dfs(child, index+1):\n                        return True\n                    \n            if word[index] in node.children:\n                return dfs(node.children[word[index]], index+1)\n            \n            return False\n    \n        return dfs(self.root, 0)\n\n```\n![image.png](https://assets.leetcode.com/users/images/e2515d84-99cf-4499-80fb-fe458e1bbae2_1678932606.8004954.png)\n\n# Please UPVOTE \uD83D\uDC4D
['String', 'Depth-First Search', 'Trie', 'Python', 'Python3']