
"""simple docstring"""





from __future__ import annotations

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



def 				lowerCamelCase__		(      __snake_case     )							->		list[float]:


					"""simple docstring"""





					_UpperCamelCase										=  []
					_UpperCamelCase										=  len(__snake_case     )

					for i in range(__snake_case     ):
										_UpperCamelCase										=  -1
										for j in range(i + 1,					__snake_case     ):
															if arr[i] < arr[j]:
																				_UpperCamelCase										=  arr[j]
																				break
										result.append(__snake_case     )
					return result



def 				lowerCamelCase__		(      __snake_case     )							->		list[float]:


					"""simple docstring"""





					_UpperCamelCase										=  []
					for i, outer in enumerate(__snake_case     ):
										_UpperCamelCase										=  -1
										for inner in arr[i + 1 :]:
															if outer < inner:
																				_UpperCamelCase										=  inner
																				break
										result.append(__snake_case     )
					return result



def 				lowerCamelCase__		(      __snake_case     )							->		list[float]:


					"""simple docstring"""





					_UpperCamelCase										=  len(__snake_case     )
					_UpperCamelCase										=  []
					_UpperCamelCase										=  [-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:
															_UpperCamelCase										=  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))

				_a														=		(
				    """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),
				)








"""simple docstring"""





def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number < 0 or shift_amount < 0:
										raise ValueError('''both inputs must be positive integers'''     )

					_UpperCamelCase										=  str(bin(__snake_case     )     )
					binary_number += "0" * shift_amount
					return binary_number



def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number < 0 or shift_amount < 0:
										raise ValueError('''both inputs must be positive integers'''     )

					_UpperCamelCase										=  str(bin(__snake_case     )     )[2:]
					if shift_amount >= len(__snake_case     ):
										return "0b0"
					_UpperCamelCase										=  binary_number[: len(__snake_case     ) - shift_amount]
					return "0b" + shifted_binary_number



def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number >= 0:  # Get binary representation of positive number
										_UpperCamelCase										=  '''0''' + str(bin(__snake_case     )     ).strip('''-'''     )[2:]
					else:  # Get binary (2's complement) representation of negative number
										_UpperCamelCase										=  len(bin(__snake_case     )[3:]     )  # Find 2's complement of number
										_UpperCamelCase										=  bin(abs(__snake_case     ) - (1 << binary_number_length)     )[3:]
										_UpperCamelCase										=  (
										    '''1''' + '''0''' * (binary_number_length - len(__snake_case     )) + binary_number
										)

					if shift_amount >= len(__snake_case     ):
										return "0b" + binary_number[0] * len(__snake_case     )
					return (
					    "0b"
					    + binary_number[0] * shift_amount
					    + binary_number[: len(__snake_case     ) - shift_amount]
					)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






