Skip to content

Commit 1ed270b

Browse files
authored
Update string-matching-in-an-array.py
1 parent a754fea commit 1ed270b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/string-matching-in-an-array.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Time: O(n + m + z) = O(n), n is the total size of patterns
2-
# , m is the total size of query string
3-
# , z is the number of all matched strings
4-
# , O(n) = O(m) = O(z) in this problem
1+
# Time: O(n + m + z) = O(n) ~ O(n^2), n is the total size of patterns
2+
# , m is the total size of query string
3+
# , z is the number of all matched strings
4+
# , O(n) = O(m), O(z) = O(1) ~ O(n^2) in this problem
55
# Space: O(t), t is the total size of ac automata trie
66

77
import collections

0 commit comments

Comments
 (0)