[C++] Trie + DFS | Try all combinations
```\nclass MagicDictionary {\nprivate:\n    struct Node{\n        Node arr[26];\n        bool end = false;\n    };\n    Node root;\npublic:\n    MagicDictionary
```\nclass MagicDictionary {\nprivate:\n    struct Node{\n        Node* arr[26];\n        bool end = false;\n    };\n    Node* root;\npublic:\n    MagicDictionary() {\n        root = new Node();\n    }\n    \n    void trie_insert(string &word){\n        Node* node = root;\n        for(int i = 0; i < word.size(); i++){\n            if(node->arr[word[i] - \'a\'] == NULL){\n                node->arr[word[i] - \'a\'] = new Node();\n            }\n            node = node->arr[word[i] - \'a\'];\n        }\n        node->end = true;\n    }\n    \n    void buildDict(vector<string> dictionary) {\n        for(auto w: dictionary){ \n            trie_insert(w);\n        }\n    }\n    \n    bool trie_search(string &word, Node* cur){\n        for(int i = 0; i < word.size(); i++){\n            if(cur->arr[word[i] - \'a\'] == NULL) return false;\n            cur = cur->arr[word[i] - \'a\'];\n        }\n        return cur->end;\n    }\n    \n    bool search(string searchWord) {\n        for(int i = 0; i < searchWord.size(); i++){\n            string temp = searchWord;\n            for(int j = 0; j < 26; j++){\n                char c = temp[i];\n                temp[i] = \'a\' + j;\n                if(temp == searchWord){\n                    temp[i] = c;\n                    continue;\n                }\n                if(trie_search(temp, root)) return true;\n                temp[i] = c;\n            }\n        }\n        return false;\n    }\n};
['Depth-First Search', 'Trie']