python solution beats 100%
\nclass WordDictionary:\n\n    def __init__(self):\n        """\n        Initialize your data structure here.\n        """\n        self.map = collections.defau
```\nclass WordDictionary:\n\n    def __init__(self):\n        """\n        Initialize your data structure here.\n        """\n        self.map = collections.defaultdict(set)\n\n    def addWord(self, word):\n        """\n        Adds a word into the data structure.\n        :type word: str\n        :rtype: void\n        """\n        k = len(word)\n        self.map[k].add(word)\n\n    def search(self, word):\n        """\n        Returns if the word is in the data structure. A word could contain the dot character \'.\' to represent any one letter.\n        :type word: str\n        :rtype: bool\n        """\n        k = len(word)\n        \n        p = self.map[k]\n        if not p:\n            return False\n        if word in p:\n            return True\n        \n        for i in range(k):\n            if word[i] == \'.\':\n                continue\n            p = {x for x in p if x[i] == word[i]}\n            if not p:\n                return False\n        return True\n```
[]