






'''simple docstring'''







def 		_UpperCAmelCase   (							__A							:   list[int]      ):
				if not numbers:
								return 0

				if not isinstance(__A						,		(list, tuple)      ) or not all(
				    isinstance(__A						,		__A      ) for number in numbers      ):
								raise ValueError('''numbers must be an iterable of integers'''      )

				a_		:  str											=      numbers[0]

				for i in range(1						,		len(__A      )      ):
								# update the maximum and minimum subarray products
								a_		:  Any											=      numbers[i]
								if number < 0:
												a_		:  Optional[int]											=      min_till_now, max_till_now
								a_		:  int											=      max(__A						,		max_till_now * number      )
								a_		:  Optional[Any]											=      min(__A						,		min_till_now * number      )

								# update the maximum product found till now
								a_		:  int											=      max(__A						,		__A      )

				return max_prod












'''simple docstring'''







from __future__ import annotations





def 		_UpperCAmelCase   (							__A							:   list[int]      ):
				a_		:  int											=      len(__A      ) // 2

				# choose the middle 3 elements
				a_		:  Dict											=      lst[m - 1 : m + 2]

				# if middle element is peak
				if three[1] > three[0] and three[1] > three[2]:
								return three[1]

				# if increasing, recurse on right
				elif three[0] < three[2]:
								if len(lst[:m]      ) == 2:
												m -= 1
								return peak(lst[m:]      )

				# decreasing
				else:
								if len(lst[:m]      ) == 2:
												m += 1
								return peak(lst[:m]      )


if __name__ == "__main__":
		import doctest

		doctest.testmod()




