[C++] Trie Solution
\nclass TrieNode {\npublic:\n    TrieNode* children[26];\n    bool isEnd;\n    \n    TrieNode() {\n        for(int i=0; i < 26; i++) {\n            children[i] 
```\nclass TrieNode {\npublic:\n    TrieNode* children[26];\n    bool isEnd;\n    \n    TrieNode() {\n        for(int i=0; i < 26; i++) {\n            children[i] = NULL;\n        }\n        isEnd = false;\n    }\n};\n\n\nclass MagicDictionary {\npublic:\n    \n    TrieNode* head;\n    MagicDictionary() {\n        head = new TrieNode();\n    }\n    \n    void buildDict(vector<string> dictionary) {\n        for(auto word: dictionary) {\n            insertWord(head, word);\n        }\n    }\n    \n    bool search(string searchWord) {\n        return searchHelper(head, searchWord, 0, false);\n    }\n    \n    bool searchHelper(TrieNode* head, string word, int i, bool isChanged) {\n        if(i >= word.length()) return head->isEnd && isChanged;\n        TrieNode* cur = head;\n        int curInx = word[i] - \'a\';\n        bool res = false;\n        for(int j=0; j < 26; j++) {\n            if(cur->children[j]) {\n                if(j == curInx) {\n                    res = searchHelper(cur->children[j], word, i+1, isChanged);\n                } else if(!isChanged) {\n                    res = searchHelper(cur->children[j], word, i+1, true);\n                }\n             }\n            \n            if(res) return true;\n                \n        }\n        \n        return false;\n        \n    }\n    \n    void insertWord(TrieNode* head, string word) {\n        TrieNode* cur = head;\n        for(auto ch: word) {\n            if(cur->children[ch - \'a\'] == NULL) {\n                cur->children[ch - \'a\'] = new TrieNode();\n            }\n            cur = cur->children[ch - \'a\'];\n        }\n        cur->isEnd = true;\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```
['Trie', 'C++']