LeetCode – Add and Search Word – Data structure design (Java)
Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. Java Solution 1 This problem is similar with Implement Trie. The solution 1 below uses … Read more