C++ Solution using unordered_map / Very Easy to understand / Backtracking
\nclass WordDictionary {\npublic:\n    /** Initialize your data structure here. */\n    \n    struct TrieNode {\n        unordered_map<char, TrieNode*> umap;\n 
```\nclass WordDictionary {\npublic:\n    /** Initialize your data structure here. */\n    \n    struct TrieNode {\n        unordered_map<char, TrieNode*> umap;\n        bool eow;\n        TrieNode(){\n            eow = false;\n        }\n    };\n    \n    TrieNode* root;\n\n    WordDictionary() {\n        root = new TrieNode();\n    }\n    \n    /** Adds a word into the data structure. */\n    void addWord(string word) {\n        TrieNode* tmp = root;\n        for(char ele: word){\n            if(tmp->umap.find(ele) == tmp->umap.end()){\n                tmp->umap[ele] = new TrieNode();\n            }\n            tmp = tmp->umap[ele];\n        }\n        tmp->eow = true;\n    }\n    \n    /** Returns if the word is in the data structure. A word could contain the dot character \'.\' to represent any one letter. */\n    \n    bool search(string word) {\n        bool ans = false;\n        search2(word, 0, root, ans);\n        return ans;\n    }\n    \n    void search2(string word, int i, TrieNode* tmp, bool& ans){\n        if(i<word.length()){\n            if(word[i] == \'.\'){\n                for(auto ptr = tmp->umap.begin(); ptr!=tmp->umap.end(); ptr++){\n                    search2(word, i+1, ptr->second, ans);\n                }\n            }else if(tmp->umap.find(word[i]) != tmp->umap.end()){\n                search2(word, i+1, tmp->umap[word[i]], ans);\n            }\n        }else{\n            ans = ans || tmp->eow;\n        }\n    }\n    \n};\n\n/**\n * Your WordDictionary object will be instantiated and called as such:\n * WordDictionary* obj = new WordDictionary();\n * obj->addWord(word);\n * bool param_2 = obj->search(word);\n */\n```
[]