





"""simple docstring"""



def 						__lowercase	(  snake_case_    :    int		)  ->int:



    '''simple docstring'''







    __A       :		str							=	abs(snake_case_		)
    __A       :		Union[str, Any]							=	0
    while n > 0:
        res += n % 10
        n //= 10
    return res







def 						__lowercase	(  snake_case_    :    int		)  ->int:



    '''simple docstring'''







    __A       :		Optional[Any]							=	abs(snake_case_		)
    return n if n < 10 else n % 10 + sum_of_digits(n // 10		)







def 						__lowercase	(  snake_case_    :    int		)  ->int:



    '''simple docstring'''







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







def 						__lowercase	(  )  ->None:



    '''simple docstring'''







    from collections.abc import Callable
    from timeit import timeit

    def benchmark_a_function(snake_case_    :    Callable							,snake_case_    :    int		) -> None:
        __A       :		int							=	F"""{func.__name__}({value})"""
        __A       :		List[str]							=	timeit(F"""__main__.{call}"""							,setup='''import __main__'''		)
        print(F"""{call:56} = {func(snake_case_		)} -- {timing:.4f} seconds"""		)

    for value in (262144, 1125899906842624, 1267650600228229401496703205376):
        for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
            benchmark_a_function(snake_case_							,snake_case_		)
        print()


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       benchmark()











"""simple docstring"""



def 						__lowercase	(  snake_case_    :    list		)  ->float:



    '''simple docstring'''







    __A       :		Tuple							=	0
    while len(snake_case_		) > 1:
        __A       :		List[Any]							=	0
        # Consider two files with minimum cost to be merged
        for _ in range(2		):
            __A       :		Dict							=	files.index(min(snake_case_		)		)
            temp += files[min_index]
            files.pop(snake_case_		)
        files.append(snake_case_		)
        optimal_merge_cost += temp
    return optimal_merge_cost


if __name__ == "__main__":
       import doctest

       doctest.testmod()




