

class      UpperCamelCase :

    def __init__(			self :      Optional[int]							,    snake_case__ :      int    ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE								=			size
     SCREAMING_SNAKE_CASE								=			[0] * size
     SCREAMING_SNAKE_CASE								=			[0] * size

    @staticmethod
    def UpperCamelCase			(			snake_case__ :      int    ):

     """simple docstring"""






     return index | (index + 1)

    @staticmethod
    def UpperCamelCase			(			snake_case__ :      int    ):

     """simple docstring"""






     return (index & (index + 1)) - 1

    def UpperCamelCase			(			self :      int							,    snake_case__ :      int							,    snake_case__ :      int    ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE								=			value
     while index < self.size:
      SCREAMING_SNAKE_CASE								=			self.get_prev(_lowercase    ) + 1
      if current_left_border == index:
       SCREAMING_SNAKE_CASE								=			value
      else:
       SCREAMING_SNAKE_CASE								=			max(_lowercase							,    _lowercase							,    _lowercase    )
      SCREAMING_SNAKE_CASE								=			self.get_next(_lowercase    )




    def UpperCamelCase			(			self :      Dict							,    snake_case__ :      int							,    snake_case__ :      int    ):

     """simple docstring"""






     right -= 1  # Because of right is exclusive
     SCREAMING_SNAKE_CASE								=			0
     while left <= right:
      SCREAMING_SNAKE_CASE								=			self.get_prev(_lowercase    )
      if left <= current_left:
       SCREAMING_SNAKE_CASE								=			max(_lowercase							,    self.tree[right]    )
       SCREAMING_SNAKE_CASE								=			current_left
      else:
       SCREAMING_SNAKE_CASE								=			max(_lowercase							,    self.arr[right]    )
       right -= 1
     return result


if __name__ == "__main__":
      import doctest

      doctest.testmod()


def        __lowerCAmelCase    (       _UpperCamelCase		:  int	)		->							int:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE								=			abs(_UpperCamelCase	)
 SCREAMING_SNAKE_CASE								=			0
 while n > 0:
  res += n % 10
  n //= 10
 return res


def        __lowerCAmelCase    (       _UpperCamelCase		:  int	)		->							int:
 '''simple docstring'''


 SCREAMING_SNAKE_CASE								=			abs(_UpperCamelCase	)
 return n if n < 10 else n % 10 + sum_of_digits(n // 10	)


def        __lowerCAmelCase    (       _UpperCamelCase		:  int	)		->							int:
 '''simple docstring'''


 return sum(int(_UpperCamelCase	) for c in str(abs(_UpperCamelCase	)	)	)


def        __lowerCAmelCase    (       )		->							None:
 '''simple docstring'''


 from collections.abc import Callable
 from timeit import timeit

 def benchmark_a_function(_UpperCamelCase		:  Callable		,							_UpperCamelCase		:  int	) -> None:
  SCREAMING_SNAKE_CASE								=			f"""{func.__name__}({value})"""
  SCREAMING_SNAKE_CASE								=			timeit(f"""__main__.{call}"""		,							setup='import __main__'	)
  print(f"""{call:56} = {func(_UpperCamelCase	)} -- {timing:.4f} seconds"""	)

 for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
  for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
   benchmark_a_function(_UpperCamelCase		,							_UpperCamelCase	)
  print()


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()

