






'''simple docstring'''


from functools import lru_cache






@lru_cache
def   lowerCAmelCase__			(					SCREAMING_SNAKE_CASE__		):
 if not isinstance(SCREAMING_SNAKE_CASE__       ,		SCREAMING_SNAKE_CASE__		):
  raise TypeError('k must be an integer.'		)
 if k < 0:
  raise ValueError('k integer must be greater or equal to zero.'		)
 if k == 0:
  return 0
 elif k == 1:
  return 1
 else:
  return fibonacci(k - 1		) + fibonacci(k - 2		)






def   lowerCAmelCase__			(					SCREAMING_SNAKE_CASE__       ,		SCREAMING_SNAKE_CASE__		):
 __a    :	List[Any]									=						len(SCREAMING_SNAKE_CASE__		)
 # Find m such that F_m >= n where F_i is the i_th fibonacci number.
 __a    :	Optional[Any]									=						0
 while True:
  if fibonacci(SCREAMING_SNAKE_CASE__		) >= len_list:
   __a    :	str									=						i
   break
  i += 1
 __a    :	Tuple									=						0
 while fibb_k > 0:
  __a    :	int									=						min(
      offset + fibonacci(fibb_k - 1		)       ,		len_list - 1		)  # Prevent out of range
  __a    :	List[Any]									=						arr[index_k]
  if item_k_1 == val:
   return index_k
  elif val < item_k_1:
   fibb_k -= 1
  elif val > item_k_1:
   offset += fibonacci(fibb_k - 1		)
   fibb_k -= 2
 else:
  return -1


if __name__ == "__main__":
  import doctest

  doctest.testmod()












'''simple docstring'''


import math
from timeit import timeit






def   lowerCAmelCase__			(					SCREAMING_SNAKE_CASE__		):
 __a    :	Any									=						0
 __a    :	List[Any]									=						abs(SCREAMING_SNAKE_CASE__		)
 while True:
  __a    :	int									=						n // 10
  digits += 1
  if n == 0:
   break
 return digits






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






def   lowerCAmelCase__			(					SCREAMING_SNAKE_CASE__		):
 return len(str(abs(SCREAMING_SNAKE_CASE__		)		)		)






def   lowerCAmelCase__			(					):
 from collections.abc import Callable

 def benchmark_a_function(SCREAMING_SNAKE_CASE__       ,		SCREAMING_SNAKE_CASE__		) -> None:
  __a    :	Tuple									=						f'''{func.__name__}({value})'''
  __a    :	List[Any]									=						timeit(f'''__main__.{call}'''       ,		setup='import __main__'		)
  print(f'''{call}: {func(SCREAMING_SNAKE_CASE__		)} -- {timing} seconds'''		)

 for value in (262144, 1125899906842624, 1267650600228229401496703205376):
  for func in (num_digits, num_digits_fast, num_digits_faster):
   benchmark_a_function(SCREAMING_SNAKE_CASE__       ,		SCREAMING_SNAKE_CASE__		)
  print()


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  benchmark()




