






from .stack import Stack

def    lowerCAmelCase__		(			_a				:	str			):
		snake_case_ :							Stack[str]         =				Stack()
		snake_case_ :							Optional[Any]         =				{"(": ")", "[": "]", "{": "}"}
		for bracket in parentheses:
				if bracket in bracket_pairs:
						stack.push(_a			)
				elif bracket in (")", "]", "}"):
						if stack.is_empty() or bracket_pairs[stack.pop()] != bracket:
								return False
		return stack.is_empty()


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

							testmod()

							lowercase     :							str	     =			['''((()))''', '''((())''', '''(()))''']
							print('''Balanced parentheses demonstration:\n''')
							for example in examples:
														lowercase     :							Tuple	     =			'''''' if balanced_parentheses(example) else '''not '''
														print(F"""{example} is {not_str}balanced""")








from __future__ import annotations

def    lowerCAmelCase__		(			_a				:	list[int]     ,					_a				:	int			):
		snake_case_       ,				snake_case_ :							Tuple         =				0, len(_a			) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
							print(double_linear_search(list(range(1_00)), 40))
