[C++] Clean Code
\nclass MagicDictionary {\npublic:\n    /** Initialize your data structure here. */\n    MagicDictionary() {\n        \n    }\n    \n    /** Build a dictionary 
```\nclass MagicDictionary {\npublic:\n    /** Initialize your data structure here. */\n    MagicDictionary() {\n        \n    }\n    \n    /** Build a dictionary through a list of words */\n    void buildDict(vector<string> dict) {\n        for (string w : dict) {\n            words.insert(w);\n        }\n    }\n    \n    /** Returns if there is any word in the trie that equals to the given word after modifying exactly one character */\n    bool search(string word) {\n        for (int i = 0; i < word.size(); i++) {\n            char wi = word[i];\n            for (char ch = 'a'; ch <= 'z'; ch++) {\n                if (ch == wi) continue;\n                word[i] = ch;\n                if (words.count(word)) return true;\n            }\n            word[i] = wi;\n        }\n        return false;\n    }\nprivate:\n    unordered_set<string> words;\n};\n```
[]