






"""simple docstring"""






def       _A    (__a					,       __a							)				-> str:
    """simple docstring"""






    if not (isinstance(__a					,       __a							) and isinstance(__a					,       __a							)):
        raise ValueError('''longest_common_substring() takes two strings for inputs'''							)

    SCREAMING_SNAKE_CASE_   :						str							=	len(__a							)
    SCREAMING_SNAKE_CASE_   :						Dict							=	len(__a							)

    SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	[[0] * (texta_length + 1) for _ in range(texta_length + 1							)]
    SCREAMING_SNAKE_CASE_   :						List[Any]							=	0
    SCREAMING_SNAKE_CASE_   :						List[Any]							=	0

    for i in range(1					,       texta_length + 1							):
        for j in range(1					,       texta_length + 1							):
            if texta[i - 1] == texta[j - 1]:
                SCREAMING_SNAKE_CASE_   :						str							=	1 + dp[i - 1][j - 1]
                if dp[i][j] > ans_length:
                    SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	i
                    SCREAMING_SNAKE_CASE_   :						Optional[int]							=	dp[i][j]

    return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
  import doctest

  doctest.testmod()










"""simple docstring"""






from __future__ import annotations



def       _A    (__a					,       __a					,       __a							)				-> int | float:
    """simple docstring"""






    if len(__a							) == 0:
        raise ValueError('''find_max() arg is an empty sequence'''							)
    if (
        left >= len(__a							)
        or left < -len(__a							)
        or right >= len(__a							)
        or right < -len(__a							)
    ):
        raise IndexError('''list index out of range'''							)
    if left == right:
        return nums[left]
    SCREAMING_SNAKE_CASE_   :						str							=	(left + right) >> 1  # the middle
    SCREAMING_SNAKE_CASE_   :						int							=	find_max(__a					,       __a					,       __a							)  # find max in range[left, mid]
    SCREAMING_SNAKE_CASE_   :						str							=	find_max(__a					,       mid + 1					,       __a							)  # find max in range[mid + 1, right]

    return left_max if left_max >= right_max else right_max


if __name__ == "__main__":
  import doctest

  doctest.testmod(verbose=True)


