

from __future__ import annotations

SCREAMING_SNAKE_CASE_            = [-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
SCREAMING_SNAKE_CASE_            = [-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]

def 							__SCREAMING_SNAKE_CASE							(			lowerCAmelCase:					list[float]	)				->    list[float]:
				_UpperCAmelCase    :						Any							=      []
				_UpperCAmelCase    :						Any							=      len(lowerCAmelCase	)

				for i in range(lowerCAmelCase	):
								_UpperCAmelCase    :						float							=      -1
								for j in range(i + 1					, lowerCAmelCase	):
												if arr[i] < arr[j]:
																_UpperCAmelCase    :						List[str]							=      arr[j]
																break
								result.append(lowerCAmelCase	)
				return result

def 							__SCREAMING_SNAKE_CASE							(			lowerCAmelCase:					list[float]	)				->    list[float]:
				_UpperCAmelCase    :						str							=      []
				for i, outer in enumerate(lowerCAmelCase	):
								_UpperCAmelCase    :						float							=      -1
								for inner in arr[i + 1 :]:
												if outer < inner:
																_UpperCAmelCase    :						Optional[int]							=      inner
																break
								result.append(lowerCAmelCase	)
				return result

def 							__SCREAMING_SNAKE_CASE							(			lowerCAmelCase:					list[float]	)				->    list[float]:
				_UpperCAmelCase    :						Optional[Any]							=      len(lowerCAmelCase	)
				_UpperCAmelCase    :						list[float]							=      []
				_UpperCAmelCase    :						list[float]							=      [-1] * arr_size

				for index in reversed(range(lowerCAmelCase	)	):
								if stack:
												while stack[-1] <= arr[index]:
																stack.pop()
																if not stack:
																				break
								if stack:
												_UpperCAmelCase    :						str							=      stack[-1]
								stack.append(arr[index]	)
				return result


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

					testmod()
					print(next_greatest_element_slow(arr))
					print(next_greatest_element_fast(arr))
					print(next_greatest_element(arr))

					SCREAMING_SNAKE_CASE_            = (
					    'from __main__ import arr, next_greatest_element_slow, '
					    'next_greatest_element_fast, next_greatest_element'
					)
					print(
					    'next_greatest_element_slow():',
					    timeit('next_greatest_element_slow(arr)', setup=setup),
					)
					print(
					    'next_greatest_element_fast():',
					    timeit('next_greatest_element_fast(arr)', setup=setup),
					)
					print(
					    '     next_greatest_element():',
					    timeit('next_greatest_element(arr)', setup=setup),
					)





def 							__SCREAMING_SNAKE_CASE							(			lowerCAmelCase:					int	)				->    int:
				if not isinstance(lowerCAmelCase					, lowerCAmelCase	):
								raise TypeError("Input value must be an 'int' type"	)

				_UpperCAmelCase    :						List[Any]							=      0
				while number:
								position += 1
								number >>= 1

				return position


if __name__ == "__main__":
					import doctest

					doctest.testmod()


