




# Algorithm for the pigeonhole sorting













def   _snake_case    (       lowercase__	):
				_lowerCamelCase  :    int					=					min(_SCREAMING_SNAKE_CASE	)  # min() finds the minimum value
				_lowerCamelCase  :    Optional[Any]					=					max(_SCREAMING_SNAKE_CASE	)  # max() finds the maximum value

				_lowerCamelCase  :    Tuple					=					max_val - min_val + 1  # size is difference of max and min values plus one

				# list of pigeonholes of size equal to the variable size
				_lowerCamelCase  :    Union[str, Any]					=					[0] * size

				# Populate the pigeonholes.
				for x in a:
								assert isinstance(_SCREAMING_SNAKE_CASE							,					_SCREAMING_SNAKE_CASE	), "integers only please"
								holes[x - min_val] += 1

				# Putting the elements back into the array in an order.
				_lowerCamelCase  :    Union[str, Any]					=					0
				for count in range(_SCREAMING_SNAKE_CASE	):
								while holes[count] > 0:
												holes[count] -= 1
												_lowerCamelCase  :    Optional[Any]					=					count + min_val
												i += 1







def   _snake_case    (       ):
				_lowerCamelCase  :    Dict					=					[8, 3, 2, 7, 4, 6, 8]
				pigeonhole_sort(_SCREAMING_SNAKE_CASE	)
				print('Sorted order is:'							,					' '.join(_SCREAMING_SNAKE_CASE	)	)


if __name__ == "__main__":
			main()





"""simple docstring"""






from __future__ import annotations

lowercase__  		=		10







def   _snake_case    (       lowercase__	):
				_lowerCamelCase  :    List[Any]					=					1
				_lowerCamelCase  :    Optional[int]					=					max(lowercase__	)
				while placement <= max_digit:
								# declare and initialize empty buckets
								_lowerCamelCase  :    list[list]					=					[[] for _ in range(lowercase__	)]
								# split list_of_ints between the buckets
								for i in list_of_ints:
												_lowerCamelCase  :    Dict					=					int((i / placement) % RADIX	)
												buckets[tmp].append(lowercase__	)
								# put each buckets' contents into list_of_ints
								_lowerCamelCase  :    str					=					0
								for b in range(lowercase__	):
												for i in buckets[b]:
																_lowerCamelCase  :    str					=					i
																a += 1
        # move to next
								placement *= RADIX
				return list_of_ints


if __name__ == "__main__":
			import doctest

			doctest.testmod()