




'''simple docstring'''

from __future__ import annotations




def    snake_case__     (  a       ,      a	)			->       int:





			'''simple docstring'''






			snake_case__    ,			snake_case__          =						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(100)), 40))







def    UpperCamelCase__  (   UpperCAmelCase     )     ->		tuple[int, int]:







							"""simple docstring"""





							if len(UpperCAmelCase     ) == 1:
														return a[0], a[0]
							else:
														# split A into half.
														_a  :    Union[str, Any]			=						a[: len(UpperCAmelCase     ) // 2]
														_a  :    Optional[Any]			=						a[len(UpperCAmelCase     ) // 2 :]

														# 2 sub problems, 1/2 of original size.
														_a		,					_a  :    Union[str, Any]			=						max_difference(UpperCAmelCase     )
														_a		,					_a  :    List[Any]			=						max_difference(UpperCAmelCase     )

														# get min of first and max of second
														# linear time
														_a  :    Union[str, Any]			=						min(UpperCAmelCase     )
														_a  :    Any			=						max(UpperCAmelCase     )

														# 3 cases, either (small1, big1),
														# (min_first, max_second), (small2, big2)
														# constant comparisons
														if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
																					return smalla, biga
														elif biga - smalla > max_second - min_first:
																					return smalla, biga
														else:
																					return min_first, max_second


if __name__ == "__main__":
						import doctest

						doctest.testmod()