Check if we have to move forward to the next characters or not
(i: int, z_result: list[int], s: str)
| 50 | |
| 51 | |
| 52 | def 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 | |
| 59 | def find_pattern(pattern: str, input_str: str) -> int: |