Python, modified search in Trie, O(AL) search
python\nclass TrieNode(object):\n    def __init__(self):\n        self.nxts = dict()\n        self.isword = False\n        \n    def insert(self, word):\n      
```python\nclass TrieNode(object):\n    def __init__(self):\n        self.nxts = dict()\n        self.isword = False\n        \n    def insert(self, word):\n        cur = self\n        for c in word:\n            if c not in cur.nxts:\n                cur.nxts[c] = TrieNode()\n            cur = cur.nxts[c]\n        cur.isword = True\n\n    def search(self, word, i, skipn):\n        if i == len(word):\n            return self.isword and skipn == 1\n    \n        if skipn == 1:\n            if word[i] not in self.nxts:\n                return False\n            return self.nxts[word[i]].search(word, i+1, skipn)\n        \n        for c in self.nxts:\n            if self.nxts[c].search(word, i+1, skipn + int(c != word[i])):\n                return True\n        return False\n            \nclass MagicDictionary(object):\n\n    def __init__(self):\n        """\n        Initialize your data structure here.\n        """\n        \n\n    def buildDict(self, dict):\n        """\n        Build a dictionary through a list of words\n        :type dict: List[str]\n        :rtype: None\n        """\n        self.trie = TrieNode()\n        for word in dict:\n            self.trie.insert(word)\n        \n\n    def search(self, word):\n        """\n        Returns if there is any word in the trie that equals to the given word after modifying exactly one character\n        :type word: str\n        :rtype: bool\n        """\n        return self.trie.search(word, 0, 0)\n\n\n# Your MagicDictionary object will be instantiated and called as such:\n# obj = MagicDictionary()\n# obj.buildDict(dict)\n# param_2 = obj.search(word)\n```
[]