[C++] Trie + Backtracking solution
\nclass Trie {\nprivate:\n    vector<Trie *> child;\n    bool isEnd;\npublic:\n    Trie () : child(26, NULL) {\n        isEnd = false;\n    }\n    \n    void in
```\nclass Trie {\nprivate:\n    vector<Trie *> child;\n    bool isEnd;\npublic:\n    Trie () : child(26, NULL) {\n        isEnd = false;\n    }\n    \n    void insert(string &s) {\n        Trie *curr = this;\n        for (char &c : s) {\n            int cIndex = c - \'a\';\n            if (curr->child[cIndex] == NULL) {\n                curr->child[cIndex] = new Trie();\n            }\n            curr = curr->child[cIndex];\n        }\n        curr->isEnd = true;\n    }\n    \n    bool helper(Trie *curr, string &s, int i, int cnt) {\n        \n        if (cnt > 1) return false;\n        \n        if (i == s.size()) {\n            if (curr->isEnd && cnt == 1) return true;\n            return false;\n        }\n        \n        for (int k = 0; k < 26; k++) {\n            if (curr->child[k] == NULL) continue;\n            if (helper(curr->child[k], s, i + 1, (k == s[i] - \'a\' ? cnt : cnt + 1))) return true;\n        }\n        \n        return false;\n    }\n    \n    bool strangeSearch(string &s) {\n        return helper(this, s, 0, 0);\n    }\n};\n\nclass MagicDictionary {\nprivate:\n    Trie trie;\npublic:\n    MagicDictionary() {\n        \n    }\n    \n    void buildDict(vector<string> dictionary) {\n        for (string &eachS : dictionary) {\n            trie.insert(eachS);\n        }\n    }\n    \n    bool search(string searchWord) {\n        return trie.strangeSearch(searchWord);\n    }\n};\n```
['Backtracking', 'Trie', 'C', 'C++']