





"""simple docstring"""




from __future__ import annotations

import math





def 	a_    (							_lowercase       ):






						"""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 	a_    (							_lowercase       ):






						"""simple docstring"""




						_UpperCamelCase      : List[str]         =   str(_lowercase       )
						_UpperCamelCase      : str         =   [n]
						for i in range(1	,						len(_lowercase       )       ):
												list_nums.append(int(str_num[i:]       )       )
												list_nums.append(int(str_num[:-i]       )       )
						return list_nums





def 	a_    (							_lowercase       ):






						"""simple docstring"""




						if len(str(_lowercase       )       ) > 3:
												if not is_prime(int(str(_lowercase       )[-3:]       )       ) or not is_prime(int(str(_lowercase       )[:3]       )       ):
																		return False
						return True





def 	a_    (							_lowercase = 11       ):






						"""simple docstring"""




						_UpperCamelCase      : list[int]         =   []
						_UpperCamelCase      : Optional[int]         =   13
						while len(_lowercase       ) != count:
												if validate(_lowercase       ):
																		_UpperCamelCase      : int         =   list_truncated_nums(_lowercase       )
																		if all(is_prime(_lowercase       ) for i in list_nums       ):
																								list_truncated_primes.append(_lowercase       )
												num += 2
						return list_truncated_primes





def 	a_    (							):






						"""simple docstring"""




						return sum(compute_truncated_primes(11       )       )


if __name__ == "__main__":
						print(F"{sum(compute_truncated_primes(11)) = }")










"""simple docstring"""




from __future__ import annotations

from random import choice





def 	a_    (							_lowercase       ):
						return choice(_lowercase       )





def 	a_    (							_lowercase	,						_lowercase       ):
						_UpperCamelCase      : Optional[int]         =   random_pivot(_lowercase       )

						# partition based on pivot
						# linear time
						_UpperCamelCase      : Union[str, Any]         =   [e for e in lst if e < pivot]
						_UpperCamelCase      : int         =   [e for e in lst if e > pivot]

						# if we get lucky, pivot might be the element we want.
						# we can easily see this:
						# small (elements smaller than k)
						# + pivot (kth element)
						# + big (elements larger than k)
						if len(_lowercase       ) == k - 1:
												return pivot
						# pivot is in elements bigger than k
						elif len(_lowercase       ) < k - 1:
												return kth_number(_lowercase	,						k - len(_lowercase       ) - 1       )
						# pivot is in elements smaller than k
						else:
												return kth_number(_lowercase	,						_lowercase       )


if __name__ == "__main__":
						import doctest

						doctest.testmod()



