def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					list[int]   ):







    '''simple docstring'''
    if len(__SCREAMING_SNAKE_CASE   ) > 1:
        __snake_case       :				Optional[int] 			=    len(__SCREAMING_SNAKE_CASE   ) // 2  # Finds the middle of the array
        __snake_case       :				Optional[Any] 			=    arr[
            :middle_length
        ]  # Creates an array of the elements in the first half.
        __snake_case       :				Any 			=    arr[
            middle_length:
        ]  # Creates an array of the elements in the second half.
        __snake_case       :				List[str] 			=    len(__SCREAMING_SNAKE_CASE   )
        __snake_case       :				Tuple 			=    len(__SCREAMING_SNAKE_CASE   )
        merge(__SCREAMING_SNAKE_CASE   )  # Starts sorting the left.
        merge(__SCREAMING_SNAKE_CASE   )  # Starts sorting the right
        __snake_case       :				Optional[int] 			=    0  # Left Counter
        __snake_case       :				int 			=    0  # Right Counter
        __snake_case       :				str 			=    0  # Position Counter
        while (
            left_index < left_size and right_index < right_size
        ):  # Runs until the lowers size of the left and right are sorted.
            if left_array[left_index] < right_array[right_index]:
                __snake_case       :				int 			=    left_array[left_index]
                left_index += 1
            else:
                __snake_case       :				Union[str, Any] 			=    right_array[right_index]
                right_index += 1
            index += 1
        while (
            left_index < left_size
        ):  # Adds the left over elements in the left half of the array
            __snake_case       :				Any 			=    left_array[left_index]
            left_index += 1
            index += 1
        while (
            right_index < right_size
        ):  # Adds the left over elements in the right half of the array
            __snake_case       :				List[Any] 			=    right_array[right_index]
            right_index += 1
            index += 1
    return arr


if __name__ == "__main__":
     import doctest

     doctest.testmod()




import math
from timeit import timeit







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    __snake_case       :				Optional[Any] 			=    0
    __snake_case       :				Union[str, Any] 			=    abs(__SCREAMING_SNAKE_CASE   )
    while True:
        __snake_case       :				List[str] 			=    n // 1_0
        digits += 1
        if n == 0:
            break
    return digits







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return 1 if n == 0 else math.floor(math.log(abs(__SCREAMING_SNAKE_CASE   )		,							1_0   ) + 1   )







def 					__lowerCAmelCase				(		__SCREAMING_SNAKE_CASE       :					int   ):







    '''simple docstring'''
    return len(str(abs(__SCREAMING_SNAKE_CASE   )   )   )







def 					__lowerCAmelCase				(		):







    '''simple docstring'''
    from collections.abc import Callable

    def benchmark_a_function(__SCREAMING_SNAKE_CASE       :					Callable		,							__SCREAMING_SNAKE_CASE       :					int   ) -> None:
        __snake_case       :				Tuple 			=    F'''{func.__name__}({value})'''
        __snake_case       :				Union[str, Any] 			=    timeit(F'''__main__.{call}'''		,							setup="""import __main__"""   )
        print(F'''{call}: {func(__SCREAMING_SNAKE_CASE   )} -- {timing} seconds'''   )

    for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
        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()



