





def 			__UpperCamelCase				(			lowercase__	:       Tuple		,    lowercase__	:       List[Any]		,    lowercase__	:       Tuple		,    lowercase__	:       str		)	->      Union[str, Any]:
    '''simple docstring'''





    if start == end:
        return start if lst[start] > item else start + 1
    if start > end:
        return start

    lowerCAmelCase_					:	str						=   (start + end) // 2
    if lst[mid] < item:
        return binary_search(lowercase__		,    lowercase__		,    mid + 1		,    lowercase__		)
    elif lst[mid] > item:
        return binary_search(lowercase__		,    lowercase__		,    lowercase__		,    mid - 1		)
    else:
        return mid
def 			__UpperCamelCase				(			lowercase__	:       int		)	->      int:
    '''simple docstring'''





    lowerCAmelCase_					:	Optional[Any]						=   len(lowercase__		)

    for index in range(1		,    lowercase__		):
        lowerCAmelCase_					:	Union[str, Any]						=   lst[index]
        lowerCAmelCase_					:	int						=   binary_search(lowercase__		,    lowercase__		,    0		,    index - 1		)
        lowerCAmelCase_					:	Optional[Any]						=   lst[:pos] + [value] + lst[pos:index] + lst[index + 1 :]

    return lst
def 			__UpperCamelCase				(			lowercase__	:       Any		,    lowercase__	:       Optional[int]		)	->      int:
    '''simple docstring'''





    if not left:
        return right

    if not right:
        return left

    if left[0] < right[0]:
        return [left[0], *merge(left[1:]		,    lowercase__		)]

    return [right[0], *merge(lowercase__		,    right[1:]		)]
def 			__UpperCamelCase				(			lowercase__	:       Optional[int]		)	->      List[Any]:
    '''simple docstring'''





    lowerCAmelCase_					:	Optional[int]						=   len(lowercase__		)
    lowerCAmelCase_		,		lowerCAmelCase_					:	int						=   [], []
    lowerCAmelCase_					:	List[str]						=   [lst[0]]
    lowerCAmelCase_					:	Union[str, Any]						=   []
    lowerCAmelCase_					:	Union[str, Any]						=   1
    while i < length:
        if lst[i] < lst[i - 1]:
            runs.append(lowercase__		)
            lowerCAmelCase_					:	Tuple						=   [lst[i]]
        else:
            new_run.append(lst[i]		)
        i += 1
    runs.append(lowercase__		)

    for run in runs:
        sorted_runs.append(insertion_sort(lowercase__		)		)
    for run in sorted_runs:
        lowerCAmelCase_					:	List[Any]						=   merge(lowercase__		,    lowercase__		)

    return sorted_array
def 			__UpperCamelCase				(			)	->      Dict:
    '''simple docstring'''





    lowerCAmelCase_					:	Any						=   [5, 9, 10, 3, -4, 5, 178, 92, 46, -18, 0, 7]
    lowerCAmelCase_					:	List[Any]						=   tim_sort(lowercase__		)
    print(lowercase__		)


if __name__ == "__main__":
  main()









from __future__ import annotations

import math
from itertools import permutations
def 			__UpperCamelCase				(			lowercase__	:       int		)	->      bool:
    '''simple docstring'''





    if 1 < number < 4:
        # 2 and 3 are primes
        return True
    elif number < 2 or number % 2 == 0 or number % 3 == 0:
        # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
        return False

    # All primes number are in format of 6k +/- 1
    for i in range(5		,    int(math.sqrt(lowercase__		) + 1		)		,    6		):
        if number % i == 0 or number % (i + 2) == 0:
            return False
    return True
def 			__UpperCamelCase				(			lowercase__	:       int = 7		)	->      int:
    '''simple docstring'''





    lowerCAmelCase_					:	str						=   """""".join(str(lowercase__		) for i in range(1		,    n + 1		)		)
    lowerCAmelCase_					:	Any						=   [int("""""".join(lowercase__		)		) for i in permutations(lowercase__		,    lowercase__		)]
    lowerCAmelCase_					:	List[Any]						=   [num for num in perm_list if is_prime(lowercase__		)]
    return max(lowercase__		) if pandigitals else 0


if __name__ == "__main__":
  print(f"""{solution() = }""")


