Javascript beats 100% , easy to understand
\nvar WordDictionary = function() {\n\t//using an obj to store added strings\n    this.map = {}\n};\n\n/**\n * Adds a word into the data structure. \n * @param 
```\nvar WordDictionary = function() {\n\t//using an obj to store added strings\n    this.map = {}\n};\n\n/**\n * Adds a word into the data structure. \n * @param {string} word\n * @return {void}\n */\nWordDictionary.prototype.addWord = function(word) {\n    //using the length of stings as index to avoid full traversal\n    if (word.length in this.map) {\n        this.map[word.length].push(word)\n    } else {\n        this.map[word.length] = [word]\n    }\n};\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 * @param {string} word\n * @return {boolean}\n */\nWordDictionary.prototype.search = function(word) {\n    let len = word.length\n    if (len in this.map) {\n        for (let i = 0; i < this.map[len].length; i++) {\n            for (var j = 0; j < len; j++) {\n                //compare with the stored strings which have same length\n                if (word[j] !== \'.\' && word[j] !== this.map[len][i][j]) {\n                    break\n                }\n            }\n            if (j === len) {\n                return true\n            }            \n        }\n    }\n    return false\n\n};\n```
[]