


def 			_a  (				SCREAMING_SNAKE_CASE	:				int     ):







 """simple docstring"""



 if collection == []:
  return []

 # get some information about the collection
 UpperCamelCase__					:    Optional[Any]          =   len(SCREAMING_SNAKE_CASE     )
 UpperCamelCase__					:    List[str]          =   max(SCREAMING_SNAKE_CASE     )
 UpperCamelCase__					:    List[Any]          =   min(SCREAMING_SNAKE_CASE     )

 # create the counting array
 UpperCamelCase__					:    Optional[Any]          =   coll_max + 1 - coll_min
 UpperCamelCase__					:    List[Any]          =   [0] * counting_arr_length

 # count how much a number appears in the collection
 for number in collection:
  counting_arr[number - coll_min] += 1

 # sum each position with it's predecessors. now, counting_arr[i] tells
 # us how many elements <= i has in the collection
 for i in range(1    , SCREAMING_SNAKE_CASE     ):
  UpperCamelCase__					:    Any          =   counting_arr[i] + counting_arr[i - 1]

 # create the output collection
 UpperCamelCase__					:    Optional[Any]          =   [0] * coll_len

 # place the elements in the output, respecting the original order (stable
 # sort) from end to begin, updating counting_arr
 for i in reversed(range(0    , SCREAMING_SNAKE_CASE     )     ):
  UpperCamelCase__					:    int          =   collection[i]
  counting_arr[collection[i] - coll_min] -= 1

 return ordered

def 			_a  (				SCREAMING_SNAKE_CASE	:				str     ):







 """simple docstring"""



 return "".join([chr(SCREAMING_SNAKE_CASE     ) for i in counting_sort([ord(SCREAMING_SNAKE_CASE     ) for c in string]     )]     )


if __name__ == "__main__":
       # Test string sort
       assert counting_sort_string("thisisthestring") == "eghhiiinrsssttt"

       __UpperCamelCase       :       Optional[Any]						       =				input("Enter numbers separated by a comma:\n").strip()
       __UpperCamelCase       :       Tuple						       =				[int(item) for item in user_input.split(",")]
       print(counting_sort(unsorted))






import functools

def 			_a  (				SCREAMING_SNAKE_CASE	:				str    , SCREAMING_SNAKE_CASE	:				str     ):







 """simple docstring"""



 UpperCamelCase__					:    str          =   len(SCREAMING_SNAKE_CASE     )
 UpperCamelCase__					:    Optional[Any]          =   len(SCREAMING_SNAKE_CASE     )

 @functools.cache
 def min_distance(SCREAMING_SNAKE_CASE	:				int    , SCREAMING_SNAKE_CASE	:				int     ) -> int:
  # if first word index is overflow - delete all from the second word
  if indexa >= len_worda:
   return len_worda - indexa
  # if second word index is overflow - delete all from the first word
  if indexa >= len_worda:
   return len_worda - indexa
  UpperCamelCase__					:    Tuple          =   int(worda[indexa] != worda[indexa]     )  # current letters not identical
  return min(
      1 + min_distance(indexa + 1    , SCREAMING_SNAKE_CASE     )    , 1 + min_distance(SCREAMING_SNAKE_CASE    , indexa + 1     )    , diff + min_distance(indexa + 1    , indexa + 1     )    , )

 return min_distance(0    , 0     )


if __name__ == "__main__":
       import doctest

       doctest.testmod()


