




'''simple docstring'''



from __future__ import annotations

from collections import deque
from queue import Queue
from timeit import timeit

UpperCAmelCase_				:     List[Any]     			=						{
    '''A''': ['''B''', '''C'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F'''],
    '''D''': ['''B'''],
    '''E''': ['''B''', '''F'''],
    '''F''': ['''C''', '''E'''],
}







def 	_UpperCamelCase       (_lowerCamelCase							:   dict      ,		_lowerCamelCase							:   str		)->      list[str]:




     '''simple docstring'''





     __snake_case			    =     {start}
     __snake_case			    =     [start]
     __snake_case			    =     Queue()
     queue.put(_lowerCamelCase		)
     while not queue.empty():
          __snake_case			    =     queue.get()
          for w in graph[v]:
               if w not in explored:
                    explored.add(_lowerCamelCase		)
                    result.append(_lowerCamelCase		)
                    queue.put(_lowerCamelCase		)
     return result







def 	_UpperCamelCase       (_lowerCamelCase							:   dict      ,		_lowerCamelCase							:   str		)->      list[str]:




     '''simple docstring'''





     __snake_case			    =     {start}
     __snake_case			    =     [start]
     __snake_case			    =     deque([start]		)
     while queue:
          __snake_case			    =     queue.popleft()
          for child in graph[v]:
               if child not in visited:
                    visited.add(_lowerCamelCase		)
                    result.append(_lowerCamelCase		)
                    queue.append(_lowerCamelCase		)
     return result







def 	_UpperCamelCase       (_lowerCamelCase							:   str		)->      None:




     '''simple docstring'''





     __snake_case			    =     f'''from __main__ import G, {name}'''
     __snake_case			    =     1_00_00
     __snake_case			    =     timeit(f'''{name}(G, \'A\')'''      ,		setup=_lowerCamelCase      ,		number=_lowerCamelCase		)
     print(f'''{name:<35} finished {number} runs in {res:.5f} seconds'''		)


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     benchmark_function('''breadth_first_search''')
     benchmark_function('''breadth_first_search_with_deque''')
     # breadth_first_search                finished 10000 runs in 0.20999 seconds
     # breadth_first_search_with_deque     finished 10000 runs in 0.01421 seconds












'''simple docstring'''



from __future__ import annotations

import math
from itertools import permutations







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







def 	_UpperCamelCase       (_lowerCamelCase							:   int = 7		)->      int:




     '''simple docstring'''





     __snake_case			    =     ''''''.join(str(_lowerCamelCase		) for i in range(1      ,		n + 1		)		)
     __snake_case			    =     [int(''''''.join(_lowerCamelCase		)		) for i in permutations(_lowerCamelCase      ,		_lowerCamelCase		)]
     __snake_case			    =     [num for num in perm_list if is_prime(_lowerCamelCase		)]
     return max(_lowerCamelCase		) if pandigitals else 0


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






