🧠C++ Most Intuitive Hashing Solution
\tclass WordDictionary {\n\tpublic:\n\t\tunordered_map> mp;\n\t\tWordDictionary() {\n\t\t\tmp.clear();\n\t\t}\n\n\t\tvoid addWord(string word) {\n\t\t\t//add wo
\tclass WordDictionary {\n\tpublic:\n\t\tunordered_map<int,vector<string>> mp;\n\t\tWordDictionary() {\n\t\t\tmp.clear();\n\t\t}\n\n\t\tvoid addWord(string word) {\n\t\t\t//add word to its corresponding key size\n\t\t\tmp[word.size()].push_back(word);\n\t\t}\n\n\t\t//comparing my search word with all other words having same length\n\t\tbool check(string &s, string &p){\n\t\t\tfor(int i=0;i<p.length();i++){\n\t\t\t\tif(p[i]==\'.\') continue;\n\t\t\t\tif(p[i]!=s[i]) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tbool search(string word) {\n\t\t\t//if any word of same length does not exist return false\n\t\t\tif(mp.find(word.size())==mp.end())  return false;\n\t\t\tvector<string> v=mp[word.size()];\n\t\t\tfor(auto it: v){\n\t\t\t\tif(check(it,word)) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t};\n\n\t**If you like this and if it was helpful DO UPVOTE**
['C']