Easy JS Solution using HashMap
\n/**\n * Initialize your data structure here.\n */\nvar WordDictionary = function() {\n    this.m = new Map(); // (length x, list of strings of length x)\n    
```\n/**\n * Initialize your data structure here.\n */\nvar WordDictionary = function() {\n    this.m = new Map(); // (length x, list of strings of length x)\n    // T.C: O(1)\n};\n\n/** \n * @param {string} word\n * @return {void}\n */\nWordDictionary.prototype.addWord = function(word) {\n    let len = word.length;\n    if (this.m.has(len)) {\n        this.m.get(len).push(word);\n    } else {\n        this.m.set(len, [word]);\n    }\n    // T.C: O(1)\n};\n\n/** \n * @param {string} word\n * @return {boolean}\n */\nWordDictionary.prototype.search = function(word) {\n    let len = word.length;\n    if (!this.m.has(len)) {\n        return false;\n    }\n    let words = this.m.get(len);\n    for (let i = 0; i < words.length; i++) {\n        let match = true;\n        for (let j = 0; j < words[i].length; j++) {\n            if (word[j] !== "." && word[j] !== words[i][j]) {\n                match = false;\n                break;\n            }\n        }\n        if (match) {\n            return true;\n        }\n    }\n    return false;\n    // T.C: O(k*N), where k = length of word, N = # of words\n};\n\n/** \n * Your WordDictionary object will be instantiated and called as such:\n * var obj = new WordDictionary()\n * obj.addWord(word)\n * var param_2 = obj.search(word)\n */\n```
['JavaScript']