Javascript Trie+DFS approach
\nfunction TrieNode(){\n    this.children = new Map()\n    this.endOfWord = false;\n}\n\nvar MagicDictionary = function() {\n    this.root = new TrieNode()\n};\
```\nfunction TrieNode(){\n    this.children = new Map()\n    this.endOfWord = false;\n}\n\nvar MagicDictionary = function() {\n    this.root = new TrieNode()\n};\n\nMagicDictionary.prototype.buildDict = function(dictionary) {\n    for(let word of dictionary){\n        let curr = this.root\n        for(let letter of word){\n            let map = curr.children\n            if(!map.has(letter)) map.set(letter, new TrieNode())\n            curr = map.get(letter)\n        }\n        curr.endOfWord = true\n    }\n};\n\nMagicDictionary.prototype.search = function(searchWord){\n    return  dfs(this.root, searchWord, 0, 0)\n}\n\nfunction dfs(root, str, i, count){\n    if(count>1) return false\n    if(i==str.length) return count == 1 && root.endOfWord\n\t\n    for(let [char, node] of root.children){\n        let c = 0;\n        if(char != str[i]) c = 1\n        if(dfs(node, str, i+1, count+c)) return true;\n    }\n    return false\n}\n```
['Depth-First Search', 'JavaScript']