leetcode211. 添加與搜索單詞 - 數據結構設計

設計一個支持如下兩種操做的數據結構: void addWord(word) bool search(word) search(word) 能夠搜索文字或正則表達式字符串,字符串只包含字母 . 或 a-z 。 . 能夠表示任何一個字母。node 參考leetcode208. 實現 Trie (前綴樹): class WordDictionary: def __init__(self):
相關文章
相關標籤/搜索