# Algorithm for the pigeonhole sorting





def lowerCamelCase  (   SCREAMING_SNAKE_CASE	):
    '''simple docstring'''







    __UpperCamelCase     :Optional[Any]			  =		min(SCREAMING_SNAKE_CASE	)  # min() finds the minimum value
    __UpperCamelCase     :List[Any]			  =		max(SCREAMING_SNAKE_CASE	)  # max() finds the maximum value

    __UpperCamelCase     :List[Any]			  =		max_val - min_val + 1  # size is difference of max and min values plus one

    # list of pigeonholes of size equal to the variable size
    __UpperCamelCase     :List[Any]			  =		[0] * size

    # Populate the pigeonholes.
    for x in a:
        assert isinstance(SCREAMING_SNAKE_CASE  ,			SCREAMING_SNAKE_CASE	), "integers only please"
        holes[x - min_val] += 1

    # Putting the elements back into the array in an order.
    __UpperCamelCase     :Optional[Any]			  =		0
    for count in range(SCREAMING_SNAKE_CASE	):
        while holes[count] > 0:
            holes[count] -= 1
            __UpperCamelCase     :int			  =		count + min_val
            i += 1



def lowerCamelCase  (   ):
    '''simple docstring'''







    __UpperCamelCase     :Optional[Any]			  =		[8, 3, 2, 7, 4, 6, 8]
    pigeonhole_sort(SCREAMING_SNAKE_CASE	)
    print('''Sorted order is:'''  ,			''' '''.join(SCREAMING_SNAKE_CASE	)	)


if __name__ == "__main__":
    main()






def lowerCamelCase  (   SCREAMING_SNAKE_CASE = 1  ,			SCREAMING_SNAKE_CASE = 1_000	):
    '''simple docstring'''







    __UpperCamelCase     :Union[str, Any]			  =		1
    __UpperCamelCase     :Any			  =		0

    for divide_by_number in range(SCREAMING_SNAKE_CASE  ,			digit + 1	):
        __UpperCamelCase     :list[int]			  =		[]
        __UpperCamelCase     :Optional[int]			  =		numerator
        for _ in range(1  ,			digit + 1	):
            if now_divide in has_been_divided:
                if longest_list_length < len(SCREAMING_SNAKE_CASE	):
                    __UpperCamelCase     :Optional[Any]			  =		len(SCREAMING_SNAKE_CASE	)
                    __UpperCamelCase     :int			  =		divide_by_number
            else:
                has_been_divided.append(SCREAMING_SNAKE_CASE	)
                __UpperCamelCase     :Any			  =		now_divide * 10 % divide_by_number

    return the_digit


# Tests
if __name__ == "__main__":
    import doctest

    doctest.testmod()





