






"""simple docstring"""
def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	A_		:						Optional[int]	    =   len(snake_case__					)
	A_		:						Dict	    =   [[False] * (required_sum + 1) for _ in range(arr_len + 1					)]

	# for each arr value, a sum of zero(0) can be formed by not taking any element
	# hence True/1
	for i in range(arr_len + 1					):
		A_		:						str	    =   True

	# sum is not zero and set is empty then false
	for i in range(1   ,   required_sum + 1					):
		A_		:						Tuple	    =   False

	for i in range(1   ,   arr_len + 1					):
		for j in range(1   ,   required_sum + 1					):
			if arr[i - 1] > j:
				A_		:						Any	    =   subset[i - 1][j]
			if arr[i - 1] <= j:
				A_		:						Union[str, Any]	    =   subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

	return subset[arr_len][required_sum]


if __name__ == "__main__":
							import doctest

							doctest.testmod()









"""simple docstring"""
_lowerCAmelCase         =							{"a": ["c", "b"], "b": ["d", "e"], "c": [], "d": [], "e": []}
_lowerCAmelCase         =							["a", "b", "c", "d", "e"]






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__					):
	A_		:						int	    =   start
	# add current to visited
	visited.append(snake_case__					)
	A_		:						Any	    =   edges[current]
	for neighbor in neighbors:
		# if neighbor not in visited, visit
		if neighbor not in visited:
			A_		:						Optional[Any]	    =   topological_sort(snake_case__   ,   snake_case__   ,   snake_case__					)
    # if all neighbors visited add current to sort
	sort.append(snake_case__					)
	# if all vertices haven't been visited select a new one to visit
	if len(snake_case__					) != len(snake_case__					):
		for vertice in vertices:
			if vertice not in visited:
				A_		:						Optional[Any]	    =   topological_sort(snake_case__   ,   snake_case__   ,   snake_case__					)
    # return sort
	return sort


if __name__ == "__main__":
							_lowerCAmelCase         =							topological_sort("a", [], [])
							print(sort)

