


def   _SCREAMING_SNAKE_CASE	( SCREAMING_SNAKE_CASE       ):
  A_      :				Optional[int]		     =					[0] * len(SCREAMING_SNAKE_CASE       )

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

    if input_string[i] == input_string[j]:
      j += 1
    A_      :				int		     =					j

  return prefix_result


def   _SCREAMING_SNAKE_CASE	( SCREAMING_SNAKE_CASE       ):
  return max(prefix_function(SCREAMING_SNAKE_CASE       )       )


if __name__ == "__main__":
     import doctest

     doctest.testmod()








def   _SCREAMING_SNAKE_CASE	( SCREAMING_SNAKE_CASE       ):
  if not nums:  # Makes sure that the list is not empty
    raise ValueError('''List is empty'''       )

  A_      :				Optional[int]		     =					sum(SCREAMING_SNAKE_CASE       ) / len(SCREAMING_SNAKE_CASE       )  # Calculate the average
  return sum(abs(x - average       ) for x in nums       ) / len(SCREAMING_SNAKE_CASE       )


if __name__ == "__main__":
     import doctest

     doctest.testmod()




