






'''simple docstring'''







from __future__ import annotations

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

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


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


def 						_UpperCamelCase							(     snake_case__							,			snake_case__							):
      __A		   =      {start}
      __A		   =      [start]
      __A		   =      deque([start]							)
      while queue:
            __A		   =      queue.popleft()
            for child in graph[v]:
                  if child not in visited:
                        visited.add(snake_case__							)
                        result.append(snake_case__							)
                        queue.append(snake_case__							)
      return result


def 						_UpperCamelCase							(     snake_case__							):
      __A		   =      f"from __main__ import G, {name}"
      __A		   =      10_000
      __A		   =      timeit(f"{name}(G, 'A')"							,			setup=snake_case__							,			number=snake_case__							)
      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'''







def 						_UpperCamelCase							(     snake_case__							,			snake_case__							):
      if n < 0:
            return 0
      # table[i] represents the number of ways to get to amount i
      __A		   =      [0] * (n + 1)

      # There is exactly 1 way to get to zero(You pick no coins).
      __A		   =      1

      # Pick all coins one by one and update table[] values
      # after the index greater than or equal to the value of the
      # picked coin
      for coin_val in s:
            for j in range(snake_case__							,			n + 1							):
                  table[j] += table[j - coin_val]

      return table[n]


if __name__ == "__main__":
       import doctest

       doctest.testmod()


