We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 115c137 commit e90ae4fCopy full SHA for e90ae4f
design-add-and-search-words-data-structure/sonjh1217.swift
@@ -25,7 +25,7 @@ class WordDictionary {
25
node.isEndOfWord = true
26
}
27
28
- // O(m) ~ O(26^m) time / O(1) space
+ // O(m) ~ O(26^m) time / O(m) space
29
func search(_ word: String) -> Bool {
30
return dfs(word: Array(word), index: 0, node: root)
31
0 commit comments