



"""simple docstring"""






from __future__ import annotations


def     _lowercase       (						__snake_case      ,__snake_case			)		->     set[str]:
			__lowerCAmelCase   :						Dict				= set(__snake_case			), [start]

			while stack:
						__lowerCAmelCase   :						Optional[int]				= stack.pop()
						explored.add(__snake_case			)
						# Differences from BFS:
						# 1) pop last element instead of first one
						# 2) add adjacent elements to stack without exploring them
						for adj in reversed(graph[v]			):
									if adj not in explored:
												stack.append(__snake_case			)
			return explored


__snake_case							:     List[Any]   =					{
    'A': ['B', 'C', 'D'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B', 'D'],
    'E': ['B', 'F'],
    'F': ['C', 'E', 'G'],
    'G': ['F'],
}

if __name__ == "__main__":
	import doctest

	doctest.testmod()
	print(depth_first_search(G, 'A'))









"""simple docstring"""






import unittest

from knapsack import knapsack as k



class     A__     (						unittest.TestCase							):




	'''simple docstring'''





	def 							_SCREAMING_SNAKE_CASE     (  self:	Optional[int])       -> List[Any]:

				"""simple docstring"""

				__lowerCAmelCase   :						List[Any]				= 0
				__lowerCAmelCase   :						str				= [0]
				__lowerCAmelCase   :						Union[str, Any]				= [0]
				__lowerCAmelCase   :						List[Any]				= len(_SCREAMING_SNAKE_CASE)
				self.assertEqual(k.knapsack(_SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE) ,    0)

				__lowerCAmelCase   :						Dict				= [60]
				__lowerCAmelCase   :						Optional[int]				= [10]
				__lowerCAmelCase   :						Tuple				= len(_SCREAMING_SNAKE_CASE)
				self.assertEqual(k.knapsack(_SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE) ,    0)

	def 							_SCREAMING_SNAKE_CASE     (  self:	Any)       -> int:

				"""simple docstring"""

				__lowerCAmelCase   :						Dict				= 3
				__lowerCAmelCase   :						Dict				= [1, 2, 3]
				__lowerCAmelCase   :						str				= [3, 2, 1]
				__lowerCAmelCase   :						Optional[int]				= len(_SCREAMING_SNAKE_CASE)
				self.assertEqual(k.knapsack(_SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE) ,    5)







	def 							_SCREAMING_SNAKE_CASE     (  self:	Optional[int])       -> Optional[Any]:

				"""simple docstring"""

				__lowerCAmelCase   :						List[str]				= 50
				__lowerCAmelCase   :						Dict				= [60, 100, 120]
				__lowerCAmelCase   :						List[Any]				= [10, 20, 30]
				__lowerCAmelCase   :						int				= len(_SCREAMING_SNAKE_CASE)
				self.assertEqual(k.knapsack(_SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE ,    _SCREAMING_SNAKE_CASE) ,    220)


if __name__ == "__main__":
	unittest.main()