Skip to content

Commit 4ae7614

Browse files
authored
Update z_function.py
1 parent c802884 commit 4ae7614

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

strings/z_function.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ def z_function(input_str: str) -> list:
2626
[0, 3, 2, 1]
2727
>>> z_function("zxxzxxz")
2828
[0, 0, 0, 4, 0, 0, 1]
29-
3029
"""
31-
3230
z_result = [0] * len(input_str)
3331

3432
# initialize interval's left pointer and right pointer
@@ -53,8 +51,7 @@ def z_function(input_str: str) -> list:
5351

5452
def go_next(i, z_result, s):
5553
"""
56-
Helping function, which checks if we have to
57-
move forward to the next characters or not
54+
Check if we have to move forward to the next characters or not
5855
"""
5956
return i + z_result[i] < len(s) and s[z_result[i]] == s[i + z_result[i]]
6057

0 commit comments

Comments
 (0)