


"""simple docstring"""


from __future__ import annotations







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		Union[str, Any]:







		"""simple docstring"""





		A					       = set(UpperCamelCase__	), [start]

		while stack:
				A					       = stack.pop()
				explored.add(UpperCamelCase__	)
				# 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(UpperCamelCase__	)
		return explored


UpperCamelCase						:				Optional[int]             =      {
    "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"""


def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__ = " "	)      ->		list:







		"""simple docstring"""





		A					       = []

		A					       = 0
		for index, char in enumerate(UpperCamelCase__	):
				if char == separator:
						split_words.append(string[last_index:index]	)
						A					       = index + 1
				elif index + 1 == len(UpperCamelCase__	):
						split_words.append(string[last_index : index + 1]	)
		return split_words


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

	testmod()





