C++ [Trie] Clean, easy to read solution
```\nclass TrieNode {\npublic:\n    bool isWord;\n    unordered_map children;\n    \n    TrieNode() {\n        isWord = false;\n    }\n};\n\nclass WordDictionar
```\nclass TrieNode {\npublic:\n    bool isWord;\n    unordered_map<char, TrieNode*> children;\n    \n    TrieNode() {\n        isWord = false;\n    }\n};\n\nclass WordDictionary {\n    TrieNode *root;\n    \n    void addWordToTrie(string word) {\n        auto cur = root;\n        \n        for (auto ch : word) {\n            if (!cur->children.count(ch))\n                cur->children[ch] = new TrieNode();\n            \n            cur = cur->children[ch];\n        }\n        \n        cur->isWord = true;\n    }\n    \n    bool searchTrie(TrieNode* cur, int i, string word) {\n        if (i == word.length())\n            return cur->isWord;\n        \n        if (word[i] != \'.\') {\n\t\t\t// normal letter\n            if (!cur->children.count(word[i]))\n                return false;\n\n            return searchTrie(cur->children[word[i]], i + 1, word);   \n        }\n        \n\t\t// \'.\' encountered. Perform DFS in all children branches\n        for (auto it : cur->children) {\n            if (searchTrie(it.second, i + 1, word))\n                return true;               \n        }\n        \n        return false;\n    }\n    \npublic:\n    /** Initialize your data structure here. */\n    WordDictionary() {\n        root = new TrieNode();\n    }\n    \n    /** Adds a word into the data structure. */\n    void addWord(string word) {\n        addWordToTrie(word);\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    bool search(string word) {\n        return searchTrie(root, 0, word);\n    }\n};
[]