




import os
from distutils.util import strtobool




def 							_UpperCAmelCase  (UpperCamelCase_ : Tuple      ,    UpperCamelCase_ : Tuple       ):
				'''simple docstring'''
				for e in env_keys:
								_lowerCAmelCase    :    Optional[Any]										=      int(os.environ.get(UpperCamelCase_      ,    -1       )       )
								if val >= 0:
												return val
				return default




def 							_UpperCAmelCase  (UpperCamelCase_ : List[Any]      ,    UpperCamelCase_ : List[str]=False       ):
				'''simple docstring'''
				_lowerCAmelCase    :    List[str]										=      os.environ.get(UpperCamelCase_      ,    str(UpperCamelCase_       )       )
				return strtobool(UpperCamelCase_       ) == 1  # As its name indicates `strtobool` actually returns an int...





def 							_UpperCAmelCase  (UpperCamelCase_ : Optional[Any]      ,    UpperCamelCase_ : int="no"       ):
				'''simple docstring'''
				_lowerCAmelCase    :    int										=      os.environ.get(UpperCamelCase_      ,    str(UpperCamelCase_       )       )
				return value







def 							_UpperCAmelCase  (UpperCamelCase_ : str       ):
				'''simple docstring'''
				_lowerCAmelCase    :    Dict										=      [0] * len(UpperCamelCase_       )

				for i in range(1      ,    len(UpperCamelCase_       )       ):
								# use last results for better performance - dynamic programming
								_lowerCAmelCase    :    Union[str, Any]										=      prefix_result[i - 1]
								while j > 0 and input_string[i] != input_string[j]:
												_lowerCAmelCase    :    str										=      prefix_result[j - 1]

								if input_string[i] == input_string[j]:
												j += 1
								_lowerCAmelCase    :    Optional[int]										=      j

				return prefix_result




def 							_UpperCAmelCase  (UpperCamelCase_ : str       ):
				'''simple docstring'''
				return max(prefix_function(UpperCamelCase_       )       )


if __name__ == "__main__":
	import doctest

	doctest.testmod()

