





import math
from timeit import timeit




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	int:



    """simple docstring"""






    UpperCamelCase_      =	0
    UpperCamelCase_      =	abs(SCREAMING_SNAKE_CASE_ )
    while True:
        UpperCamelCase_      =	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(			)->	None:



    """simple docstring"""






    from collections.abc import Callable

    def benchmark_a_function(SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ ) -> None:
        UpperCamelCase_      =	f"{func.__name__}({value})"
        UpperCamelCase_      =	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()



class 	__magic_name__				:






     def __init__(							self		,	_lowercase  )->    None:
         UpperCamelCase_      =	data
         UpperCamelCase_      =	42
         UpperCamelCase_      =	42




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	None:



    """simple docstring"""






    UpperCamelCase_      =	0
    UpperCamelCase_      =	x




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ )->	None:



    """simple docstring"""






    UpperCamelCase_     ,					UpperCamelCase_      =	find_set(SCREAMING_SNAKE_CASE_ ), find_set(SCREAMING_SNAKE_CASE_ )
    if x == y:
        return

    elif x.rank > y.rank:
        UpperCamelCase_      =	x
    else:
        UpperCamelCase_      =	y
        if x.rank == y.rank:
            y.rank += 1




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	Node:



    """simple docstring"""






    if x != x.parent:
        UpperCamelCase_      =	find_set(x.parent )
    return x.parent




def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ )->	set:



    """simple docstring"""






    UpperCamelCase_      =	({0, 1, 2}, {3, 4, 5})
    for s in sets:
        if node.data in s:
            return s
    UpperCamelCase_      =	f"{node.data} is not in {sets}"
    raise ValueError(SCREAMING_SNAKE_CASE_ )




def  lowerCAmelCase(			)->	None:



    """simple docstring"""






    UpperCamelCase_      =	[Node(SCREAMING_SNAKE_CASE_ ) for i in range(6 )]
    for v in vertex:
        make_set(SCREAMING_SNAKE_CASE_ )

    union_set(vertex[0] ,	vertex[1] )
    union_set(vertex[1] ,	vertex[2] )
    union_set(vertex[3] ,	vertex[4] )
    union_set(vertex[3] ,	vertex[5] )

    for nodea in vertex:
        for nodea in vertex:
            if find_python_set(SCREAMING_SNAKE_CASE_ ).isdisjoint(find_python_set(SCREAMING_SNAKE_CASE_ ) ):
                assert find_set(SCREAMING_SNAKE_CASE_ ) != find_set(SCREAMING_SNAKE_CASE_ )
            else:
                assert find_set(SCREAMING_SNAKE_CASE_ ) == find_set(SCREAMING_SNAKE_CASE_ )


if __name__ == "__main__":
 test_disjoint_set()
