MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / go_next

Function go_next

strings/z_function.py:52–56  ·  view source on GitHub ↗

Check if we have to move forward to the next characters or not

(i: int, z_result: list[int], s: str)

Source from the content-addressed store, hash-verified

50
51
52def go_next(i: int, z_result: list[int], s: str) -> bool:
53 """
54 Check if we have to move forward to the next characters or not
55 """
56 return i + z_result[i] < len(s) and s[z_result[i]] == s[i + z_result[i]]
57
58
59def find_pattern(pattern: str, input_str: str) -> int:

Callers 1

z_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected