Longest prefix match in text
Your task
Given a text s and a pattern t (both non-empty, lowercase letters, total length <= 10^5), return the length of the longest prefix of t that appears starting at SOME position in s. Equivalently, over all start positions in s, the maximum number of leading characters of t that match. Return 0 if no character of t's prefix matches anywhere.
Examples
z_function_max_match(s: str, t: str) -> intExample 1
Input
z_function_max_match("xabcdez", "abcx")Output
3