
from __future__ import annotations

lowercase  : Union[str, Any]						   =							[-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
lowercase  : List[str]						   =							[-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]







def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   list[float]:
       lowercase							:					str	     =					[]
       lowercase							:					Dict	     =					len(_snake_case    )

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







def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   list[float]:
       lowercase							:					Tuple	     =					[]
       for i, outer in enumerate(_snake_case    ):
              lowercase							:					float	     =					-1
              for inner in arr[i + 1 :]:
                     if outer < inner:
                            lowercase							:					Optional[int]	     =					inner
                            break
              result.append(_snake_case    )
       return result







def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   list[float]:
       lowercase							:					Any	     =					len(_snake_case    )
       lowercase							:					list[float]	     =					[]
       lowercase							:					list[float]	     =					[-1] * arr_size

       for index in reversed(range(_snake_case    )    ):
              if stack:
                     while stack[-1] <= arr[index]:
                            stack.pop()
                            if not stack:
                                   break
              if stack:
                     lowercase							:					int	     =					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))

  lowercase  : Tuple						   =							(
      """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 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   int:
       assert (
           isinstance(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    ) and number_of_steps > 0
       ), f"number_of_steps needs to be positive integer, your input {number_of_steps}"
       if number_of_steps == 1:
              return 1
       lowercase     ,      lowercase							:					Tuple	     =				1, 1
       for _ in range(number_of_steps - 1    ):
              lowercase     ,      lowercase							:					str	     =				current + previous, current
       return current


if __name__ == "__main__":
  import doctest

  doctest.testmod()
