C++ 0ms solution with Hashtable
\tclass MagicDictionary {\n\tpublic:\n\t\t/ Initialize your data structure here. */\n\t\tunordered_map> m;\n\t\tMagicDictionary() {\n\n\t\t}\n\n\t\t/ Build a di
\tclass MagicDictionary {\n\tpublic:\n\t\t/** Initialize your data structure here. */\n\t\tunordered_map<int,vector<string>> m;\n\t\tMagicDictionary() {\n\n\t\t}\n\n\t\t/** Build a dictionary through a list of words */\n\t\tvoid buildDict(vector<string> dict) {\n\t\t\tfor(auto x:dict){\n\t\t\t\tm[x.size()].push_back(x);\n\t\t\t}\n\t\t}\n\n\t\t/** Returns if there is any word in the trie that equals to the given word after modifying exactly one character */\n\t\tbool search(string word) {\n\t\t\tint len=word.size();\n\t\t\tfor(auto v:m[len]){\n\t\t\t\tint count=0;\n\t\t\t\tfor(int i=0;i<v.size();i++){\n\t\t\t\t\tif(v[i]!=word[i]){\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t\tif(count>1) continue;\n\t\t\t\t\tif(i==v.size()-1 && count==1) return true;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n
['Hash Table', 'C', 'C++']