






"""simple docstring"""
def 							snake_case (  A__		):
			# if the collection is empty, returns empty
			if collection == []:
						return []

			# get some information about the collection
			UpperCAmelCase_	:					str     	=   len(A__		)
			UpperCAmelCase_	:					Union[str, Any]     	=   max(A__		)
			UpperCAmelCase_	:					Union[str, Any]     	=   min(A__		)

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

			return ordered

def 							snake_case (  A__		):
			return "".join([chr(A__		) for i in counting_sort([ord(A__		) for c in string]		)]		)


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

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











"""simple docstring"""
def 							snake_case (  A__		):
			UpperCAmelCase_	:					int     	=   [0 for i in range(len(A__		)		)]

			# initialize interval's left pointer and right pointer
			UpperCAmelCase_	,      UpperCAmelCase_	:					Optional[int]     	=   0, 0

			for i in range(1      ,len(A__		)		):
						# case when current index is inside the interval
						if i <= right_pointer:
									UpperCAmelCase_	:					Any     	=   min(right_pointer - i + 1      ,z_result[i - left_pointer]		)
									UpperCAmelCase_	:					Union[str, Any]     	=   min_edge

						while go_next(A__      ,A__      ,A__		):
									z_result[i] += 1

						# if new index's result gives us more right interval,
						# we've to update left_pointer and right_pointer
						if i + z_result[i] - 1 > right_pointer:
									UpperCAmelCase_	,      UpperCAmelCase_	:					Union[str, Any]     	=   i, i + z_result[i] - 1

			return z_result

def 							snake_case (  A__      ,A__      ,A__		):
			return i + z_result[i] < len(A__		) and s[z_result[i]] == s[i + z_result[i]]

def 							snake_case (  A__      ,A__		):
			UpperCAmelCase_	:					Optional[int]     	=   0
			# concatenate 'pattern' and 'input_str' and call z_function
			# with concatenated string
			UpperCAmelCase_	:					Tuple     	=   z_function(pattern + input_str		)

			for val in z_result:
						# if value is greater then length of the pattern string
						# that means this index is starting position of substring
						# which is equal to pattern string
						if val >= len(A__		):
									answer += 1

			return answer


if __name__ == "__main__":
			import doctest

			doctest.testmod()



