
'''simple docstring'''
from __future__ import annotations

from collections import Counter







def 						A_(			A		:						int):
							UpperCamelCase					       =			[True] * n
							UpperCamelCase					       =			False
							UpperCamelCase					       =			False
							UpperCamelCase					       =			True

							for i in range(3						,			int(n**0.5 + 1)						,			2):
														UpperCamelCase					       =			i * 2
														while index < n:
																					UpperCamelCase					       =			False
																					UpperCamelCase					       =			index + i

							UpperCamelCase					       =			[2]

							for i in range(3						,			A						,			2):
														if is_prime[i]:
																					primes.append(A)

							return primes







def 						A_(			A		:						int):
							UpperCamelCase					       =			str(A)
							UpperCamelCase					       =			[]
							UpperCamelCase					       =			['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

							for duplicate in Counter(A) - Counter(set(A)):
														UpperCamelCase					       =			[int(number_str.replace(A						,			A)) for digit in digits]
														replacements.append(A)

							return replacements







def 						A_(			A		:						int = 8):
							UpperCamelCase					       =			set()

							# Filter primes with less than 3 replaceable digits
							UpperCamelCase					       =			{
							    x for x in set(prime_sieve(100_0000)) if len(str(A)) - len(set(str(A))) >= 3
							}

							for prime in primes:
														if prime in numbers_checked:
																					continue

														UpperCamelCase					       =			digit_replacements(A)

														for family in replacements:
																					numbers_checked.update(A)
																					UpperCamelCase					       =			primes.intersection(A)

																					if len(A) != family_length:
																												continue

																					return min(A)

							return -1


if __name__ == "__main__":
						print(solution())






import json
import os
import tempfile

import datasets
from utils import generate_example_dataset, get_duration


_A  					= 50_00_00

_A					,  _A  					= os.path.split(__file__)
_A  					= os.path.join(RESULTS_BASEPATH, "results", RESULTS_FILENAME.replace(".py", ".json"))



@get_duration
def 						lowercase_			(   A__		)							->							str:
    """simple docstring"""

    snake_case      =					dataset.select(range(0 ,		len(A__		) ,		2		)		)



@get_duration
def 						lowercase_			(   A__		)							->							int:
    """simple docstring"""

    snake_case      =					dataset.sort("numbers"		)



@get_duration
def 						lowercase_			(   A__		)							->							Optional[int]:
    """simple docstring"""

    snake_case      =					dataset.shuffle()



@get_duration
def 						lowercase_			(   A__		)							->							int:
    """simple docstring"""

    snake_case      =					dataset.train_test_split(0.1		)



@get_duration
def 						lowercase_			(   A__ ,		A__=10		)							->							List[Any]:
    """simple docstring"""

    for shard_id in range(A__		):
        snake_case      =					dataset.shard(A__ ,		A__		)



def 						lowercase_			(   )							->							List[str]:
    """simple docstring"""

    snake_case      =					{"num examples": SPEED_TEST_N_EXAMPLES}
    snake_case      =					(select, sort, shuffle, train_test_split, shard)
    with tempfile.TemporaryDirectory() as tmp_dir:
        print("generating dataset"		)
        snake_case      =					datasets.Features({"text": datasets.Value("string"		), "numbers": datasets.Value("float32"		)}		)
        snake_case      =					generate_example_dataset(
            os.path.join(A__ ,		"dataset.arrow"		) ,		A__ ,		num_examples=A__		)
        print("Functions"		)
        for func in functions:
            print(func.__name__		)
            snake_case      =					func(A__		)

    with open(A__ ,		"wb"		) as f:
        f.write(json.dumps(A__		).encode("utf-8"		)		)


if __name__ == "__main__":  # useful to run the profiler
   benchmark_indices_mapping()

