Design a data structure that supports:
addWord(word): Add word to the structuresearch(word): Return true if word matches. Word may contain '.' which matches any letter.
Example:
addWord("bad")
addWord("dad")
search("pad") // false
search("bad") // true
search(".ad") // true
search("b..") // true
This extends the basic trie with wildcard matching, requiring backtracking when you encounter '.'.
Constraints: words are lowercase letters only, '.' only appears in search queries, up to operations.