



'''simple docstring'''

from __future__ import annotations

from collections.abc import Iterable
from dataclasses import dataclass
from typing import Any

class __snake_case:


						'''simple docstring'''



						UpperCAmelCase							:    Dict           =		("_front", "_back", "_len")

						@dataclass
						class __snake_case:


												'''simple docstring'''



												UpperCAmelCase							:    Any           =		None
												UpperCAmelCase							:    Deque._Node | None           =		None
												UpperCAmelCase							:    Deque._Node | None           =		None







						class __snake_case:


												'''simple docstring'''



												UpperCAmelCase							:    Tuple           =		("_cur",)


												def __init__(					self	,       A_      )	->	None:
													lowerCAmelCase    =	cur


												def __iter__(					self      )	->	Deque._Iterator:
													return self




												def 				__snake_case    (					self      )	->	Any:
													if self._cur is None:
														# finished iterating
														raise StopIteration
													lowerCAmelCase    =	self._cur.val
													lowerCAmelCase    =	self._cur.next_node

													return val







						def __init__(					self	,       A_ = None      )	->	None:
							lowerCAmelCase    =	None
							lowerCAmelCase    =	None
							lowerCAmelCase    =	0

							if iterable is not None:
								# append every value to the deque
								for val in iterable:
									self.append(A_      )


						def 				__snake_case    (					self	,       A_      )	->	None:
							lowerCAmelCase    =	self._Node(A_	,       A_	,       A_      )
							if self.is_empty():
								# front = back
								lowerCAmelCase    =	lowerCAmelCase    =	node
								lowerCAmelCase    =	1
							else:
								# connect nodes
								lowerCAmelCase    =	node
								lowerCAmelCase    =	self._back
								lowerCAmelCase    =	node  # assign new back to the new node

								self._len += 1

								# make sure there were no errors
								assert not self.is_empty(), "Error on appending value."


						def 				__snake_case    (					self	,       A_      )	->	None:
							lowerCAmelCase    =	self._Node(A_	,       A_	,       A_      )
							if self.is_empty():
								# front = back
								lowerCAmelCase    =	lowerCAmelCase    =	node
								lowerCAmelCase    =	1
							else:
								# connect nodes
								lowerCAmelCase    =	self._front
								lowerCAmelCase    =	node
								lowerCAmelCase    =	node  # assign new front to the new node

								self._len += 1

								# make sure there were no errors
								assert not self.is_empty(), "Error on appending value."


						def 				__snake_case    (					self	,       A_      )	->	None:
							for val in iterable:
								self.append(A_      )


						def 				__snake_case    (					self	,       A_      )	->	None:
							for val in iterable:
								self.appendleft(A_      )


						def 				__snake_case    (					self      )	->	Any:
							assert not self.is_empty(), "Deque is empty."

							lowerCAmelCase    =	self._back
							lowerCAmelCase    =	self._back.prev_node  # set new back
							# drop the last node - python will deallocate memory automatically
							lowerCAmelCase    =	None

							self._len -= 1

							return topop.val


						def 				__snake_case    (					self      )	->	Any:
							assert not self.is_empty(), "Deque is empty."

							lowerCAmelCase    =	self._front
							lowerCAmelCase    =	self._front.next_node  # set new front and drop the first node
							lowerCAmelCase    =	None

							self._len -= 1

							return topop.val


						def 				__snake_case    (					self      )	->	bool:
							return self._front is None


						def __len__(					self      )	->	int:
							return self._len


						def __eq__(					self	,       A_      )	->	bool:

							if not isinstance(A_	,       A_      ):
								return NotImplemented

							lowerCAmelCase    =	self._front
							lowerCAmelCase    =	other._front

							# if the length of the dequeues are not the same, they are not equal
							if len(self      ) != len(A_      ):
								return False

							while me is not None and oth is not None:
								# compare every value
								if me.val != oth.val:
									return False
								lowerCAmelCase    =	me.next_node
								lowerCAmelCase    =	oth.next_node

							return True


						def __iter__(					self      )	->	Deque._Iterator:
							return Deque._Iterator(self._front      )




						def __repr__(					self      )	->	str:
							lowerCAmelCase    =	[]
							lowerCAmelCase    =	self._front
							while aux is not None:
								# append the values in a list to display
								values_list.append(aux.val      )
								lowerCAmelCase    =	aux.next_node

							return f'[{", ".join(repr(A_      ) for val in values_list      )}]'


if __name__ == "__main__":
				import doctest

				doctest.testmod()




'''simple docstring'''

from __future__ import annotations






def 		_snake_case		(					_SCREAMING_SNAKE_CASE     :						list[int]							,		_SCREAMING_SNAKE_CASE     :						int							)			->						list[int]:







	"""simple docstring"""
	lowerCAmelCase    =	{}
	for index, val in enumerate(_SCREAMING_SNAKE_CASE							):
		lowerCAmelCase    =	target - val
		if compl in chk_map:
			return [chk_map[compl], index]
		lowerCAmelCase    =	index
	return []


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				print(F'''{two_sum([2, 7, 11, 15], 9) = }''')