




"""simple docstring"""




def 					a__				(       snake_case__       )		->      Union[str, Any]:
			# if the collection is empty, returns empty
			if collection == []:
						return []

			# get some information about the collection
			lowerCamelCase       =      len(snake_case__       )
			lowerCamelCase       =      max(snake_case__       )
			lowerCamelCase       =      min(snake_case__       )

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

			# create the output collection
			lowerCamelCase       =      [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 ,				snake_case__       )       ):
						lowerCamelCase       =      collection[i]
						counting_arr[collection[i] - coll_min] -= 1

			return ordered



def 					a__				(       snake_case__       )		->      int:
			return "".join([chr(snake_case__       ) for i in counting_sort([ord(snake_case__       ) for c in string]       )]       )


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

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









"""simple docstring"""




from __future__ import annotations



def 					a__				(       snake_case__ ,				snake_case__ = None ,				snake_case__ = None       )		->      None:
			if start is None:
						lowerCamelCase       =      0

			if end is None:
						lowerCamelCase       =      len(snake_case__       ) - 1

			if start >= end:
						return

			lowerCamelCase       =      (start + end) // 2

			slowsort(snake_case__ ,				snake_case__ ,				snake_case__       )
			slowsort(snake_case__ ,				mid + 1 ,				snake_case__       )

			if sequence[end] < sequence[mid]:
						lowerCamelCase   ,     lowerCamelCase       =      sequence[mid], sequence[end]

			slowsort(snake_case__ ,				snake_case__ ,				end - 1       )


if __name__ == "__main__":
					from doctest import testmod

					testmod()



