





def      _A       (		SCREAMING_SNAKE_CASE     :   str						):





  """simple docstring"""



  a__	:					Optional[Any]										=[0] * len(SCREAMING_SNAKE_CASE						)

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

    if input_string[i] == input_string[j]:
      j += 1
    a__	:					str										=j

  return prefix_result
def      _A       (		SCREAMING_SNAKE_CASE     :   str						):





  """simple docstring"""



  return max(prefix_function(SCREAMING_SNAKE_CASE						)						)


if __name__ == "__main__":
     import doctest

     doctest.testmod()













def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  if len(SCREAMING_SNAKE_CASE						) == 1:
    return True
  a__	:					Union[str, Any]										=series[1] - series[0]
  for index in range(len(SCREAMING_SNAKE_CASE						) - 1						):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True
def      _A       (		SCREAMING_SNAKE_CASE     :   list						):





  """simple docstring"""



  if not isinstance(SCREAMING_SNAKE_CASE       ,       SCREAMING_SNAKE_CASE						):
    raise ValueError("Input series is not valid, valid series - [2, 4, 6]"						)
  if len(SCREAMING_SNAKE_CASE						) == 0:
    raise ValueError("Input list must be a non empty list"						)
  a__	:					Any										=0
  for val in series:
    answer += val
  return answer / len(SCREAMING_SNAKE_CASE						)


if __name__ == "__main__":
     import doctest

     doctest.testmod()






