Skip to content

Commit 73a3a2d

Browse files
committed
fix: space complexity calculation in search method
1 parent 6e0e5b3 commit 73a3a2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

design-add-and-search-words-data-structure/whewchews.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class WordDictionary {
2020
}
2121

2222
// TC: O(m*n) // m: words length, n: word length
23-
// SC: O(1)
23+
// SC: O(n)
2424
search(word: string): boolean {
2525
const len = word.length;
2626
const targetWord = word.replace(/\./g, "");

0 commit comments

Comments
 (0)