




from __future__ import annotations

import math
from itertools import permutations

def   A   (   _SCREAMING_SNAKE_CASE					)			->				bool:

       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(_SCREAMING_SNAKE_CASE					) + 1					)				,6					):
              if number % i == 0 or number % (i + 2) == 0:
                     return False
       return True

def   A   (   _SCREAMING_SNAKE_CASE = 7					)			->				int:
       lowerCamelCase     :   List[Any]    				=      "".join(str(_SCREAMING_SNAKE_CASE					) for i in range(1				,n + 1					)					)
       lowerCamelCase     :   int    				=      [int("".join(_SCREAMING_SNAKE_CASE					)					) for i in permutations(_SCREAMING_SNAKE_CASE				,_SCREAMING_SNAKE_CASE					)]
       lowerCamelCase     :   int    				=      [num for num in perm_list if is_prime(_SCREAMING_SNAKE_CASE					)]
       return max(_SCREAMING_SNAKE_CASE					) if pandigitals else 0


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












from __future__ import annotations

def   A   (   _SCREAMING_SNAKE_CASE				,_SCREAMING_SNAKE_CASE					)			->				list:
       lowerCamelCase     :   int    				=      [None] * (len(_SCREAMING_SNAKE_CASE					) + len(_SCREAMING_SNAKE_CASE					))

       lowerCamelCase     :   Any    				=      0  # pointer to current index for left Half
       lowerCamelCase     :   int    				=      0  # pointer to current index for the right Half
       lowerCamelCase     :   Optional[int]    				=      0  # pointer to current index for the sorted array Half

       while pointera < len(_SCREAMING_SNAKE_CASE					) and pointera < len(_SCREAMING_SNAKE_CASE					):
              if left_half[pointera] < right_half[pointera]:
                     lowerCamelCase     :   Any    				=      left_half[pointera]
                     pointera += 1
                     index += 1
              else:
                     lowerCamelCase     :   Any    				=      right_half[pointera]
                     pointera += 1
                     index += 1
       while pointera < len(_SCREAMING_SNAKE_CASE					):
              lowerCamelCase     :   Optional[Any]    				=      left_half[pointera]
              pointera += 1
              index += 1

       while pointera < len(_SCREAMING_SNAKE_CASE					):
              lowerCamelCase     :   str    				=      right_half[pointera]
              pointera += 1
              index += 1

       return sorted_array

def   A   (   _SCREAMING_SNAKE_CASE					)			->				list:
       if len(_SCREAMING_SNAKE_CASE					) <= 1:
              return array
       # the actual formula to calculate the middle element = left + (right - left) // 2
       # this avoids integer overflow in case of large N
       lowerCamelCase     :   int    				=      0 + (len(_SCREAMING_SNAKE_CASE					) - 0) // 2

       # Split the array into halves till the array length becomes equal to One
       # merge the arrays of single length returned by mergeSort function and
       # pass them into the merge arrays function which merges the array
       lowerCamelCase     :   Optional[Any]    				=      array[:middle]
       lowerCamelCase     :   Optional[Any]    				=      array[middle:]

       return merge(merge_sort(_SCREAMING_SNAKE_CASE					)				,merge_sort(_SCREAMING_SNAKE_CASE					)					)


if __name__ == "__main__":
       import doctest

       doctest.testmod()






