Python solution, hashtable, 196ms
Use dictionary self.len2words, key is length, value is word.\n\n    class WordDictionary(object):\n        def init(self):\n            self.len2words = collect
Use dictionary `self.len2words`, key is length, value is word.\n\n    class WordDictionary(object):\n        def __init__(self):\n            self.len2words = collections.defaultdict(list) \n    \n        def addWord(self, word):\n            self.len2words[len(word)].append(word)\n    \n        def search(self, word):\n            words = self.len2words[len(word)]\n            for i, char in enumerate(word):\n                words = [w for w in words if char in ('.', w[i])]\n                if not words: return False\n            return True
['Hash Table', 'Python']