
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     Dict				)			->						Any:
       # if the collection is empty, returns empty
       if collection == []:
              return []

       # get some information about the collection
       SCREAMING_SNAKE_CASE_							:				List[Any]		=len(UpperCAmelCase_				)
       SCREAMING_SNAKE_CASE_							:				Optional[Any]		=max(UpperCAmelCase_				)
       SCREAMING_SNAKE_CASE_							:				List[Any]		=min(UpperCAmelCase_				)

       # create the counting array
       SCREAMING_SNAKE_CASE_							:				List[Any]		=coll_max + 1 - coll_min
       SCREAMING_SNAKE_CASE_							:				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			,							UpperCAmelCase_				):
              SCREAMING_SNAKE_CASE_							:				Any		=counting_arr[i] + counting_arr[i - 1]

       # create the output collection
       SCREAMING_SNAKE_CASE_							:				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			,							UpperCAmelCase_				)				):
              SCREAMING_SNAKE_CASE_							:				Union[str, Any]		=collection[i]
              counting_arr[collection[i] - coll_min] -= 1

       return ordered
def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     List[str]				)			->						Dict:
       return "".join([chr(UpperCAmelCase_				) for i in counting_sort([ord(UpperCAmelCase_				) for c in string]				)]				)


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

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


def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     list				)			->						float:
       SCREAMING_SNAKE_CASE_							:				Dict		=0
       while len(UpperCAmelCase_				) > 1:
              SCREAMING_SNAKE_CASE_							:				Tuple		=0
              # Consider two files with minimum cost to be merged
              for _ in range(2				):
                     SCREAMING_SNAKE_CASE_							:				int		=files.index(min(UpperCAmelCase_				)				)
                     temp += files[min_index]
                     files.pop(UpperCAmelCase_				)
              files.append(UpperCAmelCase_				)
              optimal_merge_cost += temp
       return optimal_merge_cost


if __name__ == "__main__":
 import doctest

 doctest.testmod()
