#Accepted solution in C++ using Tries data structure (Very easy & intuitive)
\nclass Node {\n    private:\n    Node* links[26];\n    bool flag = false;\n    public:\n    bool containsKey(char ch) {\n        return links[ch-\'a\'] != null
```\nclass Node {\n    private:\n    Node* links[26];\n    bool flag = false;\n    public:\n    bool containsKey(char ch) {\n        return links[ch-\'a\'] != nullptr;\n    }\n    void put(char ch, Node* node) {\n        links[ch-\'a\'] = node;\n    }\n    Node* get(char ch) {\n        return links[ch-\'a\'];\n    }\n    bool isEnd() {\n        return flag;\n    }\n    void setEnd() {\n        flag = true;\n    }\n};\n\nclass MagicDictionary {\nprivate:\n    Node* root;\npublic:\n    MagicDictionary() {\n        root = new Node();\n    }\n    \n    void buildDict(vector<string> dictionary) {\n        for(auto word : dictionary) {\n            Node* node = root;\n            for(int i=0; i<word.length(); i++) {\n                if(!node->containsKey(word[i])) {\n                    node->put(word[i], new Node());\n                }\n                node = node->get(word[i]);\n            }\n            node->setEnd();\n        }\n    }\n    bool dfs(string word) {\n        Node* node = root;\n        for(int i=0; i<word.length(); i++) {\n            if(!node->containsKey(word[i])) return false;\n            node = node->get(word[i]);\n        }\n        return node->isEnd();\n    }\n    bool search(string searchWord) {\n        for(int i=0; i<searchWord.length(); i++) {\n            char back = searchWord[i];\n            for(char j=\'a\'; j<=\'z\'; j++) {\n                if(j == back) continue;\n                searchWord[i] = j;\n                if(dfs(searchWord)) return true;\n            }\n            searchWord[i] = back;\n        }\n        return false;\n    }\n};\n\n/**\n * Your MagicDictionary object will be instantiated and called as such:\n * MagicDictionary* obj = new MagicDictionary();\n * obj->buildDict(dictionary);\n * bool param_2 = obj->search(searchWord);\n */\n```
['Depth-First Search', 'C']