My fast Python solution
Intuition\n Describe your first thoughts on how to solve this problem. \nMy first thoughts on how to solve this problem is to create a data structure that store
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nMy first thoughts on how to solve this problem is to create a data structure that stores all the words in the dictionary. Then, when searching for a word, I will iterate through each word in the data structure and compare it to the search word. If the two words have a difference of only one character, I will return true.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe approach I will take is to first create a data structure to store the dictionary words, in this case a set. Then, I will implement the search function which will iterate through each word in the data structure and compare it to the search word. If the two words have a difference of only one character, the function will return true, otherwise it will return false.\n\n\n# Complexity\n- Time complexity: O(n*m)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass MagicDictionary:\n\n    def __init__(self):\n        """\n        Initialize your data structure here.\n        """\n        self.dic = set()\n\n    def buildDict(self, dictionary: List[str]) -> None:\n        self.dic = set(dictionary)\n\n    def search(self, searchWord: str) -> bool:\n        for word in self.dic:\n            if len(word) == len(searchWord):\n                diff = 0\n                for i in range(len(word)):\n                    if word[i] != searchWord[i]:\n                        diff += 1\n                if diff == 1:\n                    return True\n        return False\n# Your MagicDictionary object will be instantiated and called as such:\n# obj = MagicDictionary()\n# obj.buildDict(dictionary)\n# param_2 = obj.search(searchWord)\n```
['Python3']