

'''simple docstring'''







def 					_SCREAMING_SNAKE_CASE		(						snake_case_							,       snake_case_	):
	_lowercase							=     len(__lowerCamelCase	)
	# Create a stack and push index of fist element to it
	_lowercase							=     []
	st.append(0	)

	# Span value of first element is always 1
	_lowercase							=     1

	# Calculate span values for rest of the elements
	for i in range(1							,       __lowerCamelCase	):
		# Pop elements from stack while stack is not
		# empty and top of stack is smaller than price[i]
		while len(__lowerCamelCase	) > 0 and price[st[0]] <= price[i]:
			st.pop()

		# If stack becomes empty, then price[i] is greater
		# than all elements on left of it, i.e. price[0],
		# price[1], ..price[i-1]. Else the price[i]  is
		# greater than elements after top of stack
		_lowercase							=     i + 1 if len(__lowerCamelCase	) <= 0 else (i - st[0])

		# Push this element to stack
		st.append(__lowerCamelCase	)






def 					_SCREAMING_SNAKE_CASE		(						snake_case_							,       snake_case_	):
	for i in range(0							,       __lowerCamelCase	):
		print(arr[i]							,       end=""" """	)


# Driver program to test above function
_lowerCamelCase    =  [1_0, 4, 5, 9_0, 1_2_0, 8_0]
_lowerCamelCase    =  [0 for i in range(len(price) + 1)]

# Fill the span values in array S[]
calculation_span(price, S)





print_array(S, len(price))






"""simple docstring"""





import math
from timeit import timeit







def       __a	(						__lowerCamelCase    ):
   UpperCAmelCase_   :   Tuple     	=       0
   UpperCAmelCase_   :   Any     	=       abs(__lowerCamelCase    )
   while True:
      UpperCAmelCase_   :   Optional[int]     	=       n // 10
      digits += 1
      if n == 0:
         break
   return digits







def       __a	(						__lowerCamelCase    ):
   return 1 if n == 0 else math.floor(math.log(abs(__lowerCamelCase    ),						10    ) + 1    )







def       __a	(						__lowerCamelCase    ):
   return len(str(abs(__lowerCamelCase    )    )    )







def       __a	(						):
   from collections.abc import Callable

   def benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    ) -> None:
      UpperCAmelCase_   :   Optional[Any]     	=       f"""{func.__name__}({value})"""
      UpperCAmelCase_   :   Optional[int]     	=       timeit(f"""__main__.{call}""",						setup="import __main__"    )
      print(f"""{call}: {func(__lowerCamelCase    )} -- {timing} seconds"""    )

   for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
      for func in (num_digits, num_digits_fast, num_digits_faster):
         benchmark_a_function(__lowerCamelCase,						__lowerCamelCase    )
      print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()


