
'''simple docstring'''
lowerCAmelCase					:    Union[str, Any]           = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}

lowerCAmelCase					:    List[Any]           = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}







def 		A_(     A						:		Union[str, Any]		,     A						:		Dict		,     A						:		Tuple):
							UpperCamelCase   			=     True
							UpperCamelCase   			=     []

							for neighbour in graph[vert]:
														if not visited[neighbour]:
																					order += topology_sort(a__		,     a__		,     a__)

							order.append(a__)

							return order







def 		A_(     A						:		Union[str, Any]		,     A						:		Tuple		,     A						:		int):
							UpperCamelCase   			=     True
							UpperCamelCase   			=     [vert]

							for neighbour in reversed_graph[vert]:
														if not visited[neighbour]:
																					component += find_components(a__		,     a__		,     a__)

							return component







def 		A_(     A						:		str):
							UpperCamelCase   			=     len(a__) * [False]
							UpperCamelCase   			=     {vert: [] for vert in range(len(a__))}

							for vert, neighbours in graph.items():
														for neighbour in neighbours:
																					reversed_graph[neighbour].append(a__)

							UpperCamelCase   			=     []
							for i, was_visited in enumerate(a__):
														if not was_visited:
																					order += topology_sort(a__		,     a__		,     a__)

							UpperCamelCase   			=     []
							UpperCamelCase   			=     len(a__) * [False]

							for i in range(len(a__)):
														UpperCamelCase   			=     order[len(a__) - i - 1]
														if not visited[vert]:
																					UpperCamelCase   			=     find_components(a__		,     a__		,     a__)
																					components_list.append(a__)

							return components_list







from __future__ import annotations


def 					_UpperCAmelCase				(						a__):

			'''simple docstring'''



			if len(a__) == 0:
						return []
			a_							,					a_						:						List[Any] 							= min(a__), max(a__)
			a_						:						Tuple 							= int(max_value - min_value) + 1
			a_						:						list[list] 							= [[] for _ in range(a__)]

			for i in my_list:
						buckets[int(i - min_value)].append(a__)

			return [v for bucket in buckets for v in sorted(a__)]


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

	testmod()
	assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
	assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]


