


"""simple docstring"""
UpperCAmelCase				=						{
    """A""": ["""B""", """C""", """E"""],
    """B""": ["""A""", """D""", """E"""],
    """C""": ["""A""", """F""", """G"""],
    """D""": ["""B"""],
    """E""": ["""A""", """B""", """D"""],
    """F""": ["""C"""],
    """G""": ["""C"""],
}

def 				_snake_case      (   __snake_case							:      dict						, __snake_case							:      List[str]						, __snake_case							:      Tuple   ):




   """simple docstring"""







   _lowerCamelCase	:					Tuple   =		set()
   # keep track of all the paths to be checked
   _lowerCamelCase	:					List[Any]   =		[[start]]

   # return path if start is goal
   if start == goal:
      return [start]

   # keeps looping until all possible paths have been checked
   while queue:
      # pop the first path from the queue
      _lowerCamelCase	:					List[str]   =		queue.pop(0   )
      # get the last node from the path
      _lowerCamelCase	:					Optional[Any]   =		path[-1]
      if node not in explored:
         _lowerCamelCase	:					int   =		graph[node]
         # go through all neighbour nodes, construct a new path and
         # push it into the queue
         for neighbour in neighbours:
            _lowerCamelCase	:					Optional[Any]   =		list(__snake_case   )
            new_path.append(__snake_case   )
            queue.append(__snake_case   )
            # return path if neighbour is goal
            if neighbour == goal:
               return new_path

            # mark node as explored
         explored.add(__snake_case   )

    # in case there's no path between the 2 nodes
   return []

def 				_snake_case      (   __snake_case							:      dict						, __snake_case							:      Union[str, Any]						, __snake_case							:      Union[str, Any]   ):




   """simple docstring"""







   if not graph or start not in graph or target not in graph:
      return -1
   if start == target:
      return 0
   _lowerCamelCase	:					Any   =		[start]
   _lowerCamelCase	:					List[Any]   =		set(__snake_case   )
   # Keep tab on distances from `start` node.
   _lowerCamelCase	:					int   =		{start: 0, target: -1}
   while queue:
      _lowerCamelCase	:					List[Any]   =		queue.pop(0   )
      if node == target:
         _lowerCamelCase	:					int   =		(
             dist[node] if dist[target] == -1 else min(dist[target]						, dist[node]   )
         )
      for adjacent in graph[node]:
         if adjacent not in visited:
            visited.add(__snake_case   )
            queue.append(__snake_case   )
            _lowerCamelCase	:					Dict   =		dist[node] + 1
   return dist[target]


if __name__ == "__main__":
 print(bfs_shortest_path(demo_graph, """G""", """D"""))  # returns ['G', 'C', 'A', 'B', 'D']
 print(bfs_shortest_path_distance(demo_graph, """G""", """D"""))  # returns 4





"""simple docstring"""
from collections import defaultdict

def 				_snake_case      (   __snake_case							:      str						, __snake_case							:      str   ):




   """simple docstring"""







   _lowerCamelCase	:					Tuple   =		first_str.lower().strip()
   _lowerCamelCase	:					int   =		second_str.lower().strip()

   # Remove whitespace
   _lowerCamelCase	:					Any   =		first_str.replace(""" """						, """"""   )
   _lowerCamelCase	:					List[str]   =		second_str.replace(""" """						, """"""   )

   # Strings of different lengths are not anagrams
   if len(__snake_case   ) != len(__snake_case   ):
      return False

   # Default values for count should be 0
   _lowerCamelCase	:					defaultdict[str, int]   =		defaultdict(__snake_case   )

   # For each character in input strings,
   # increment count in the corresponding
   for i in range(len(__snake_case   )   ):
      count[first_str[i]] += 1
      count[second_str[i]] -= 1

   return all(_count == 0 for _count in count.values()   )


if __name__ == "__main__":
 from doctest import testmod

 testmod()
 UpperCAmelCase				=						input("""Enter the first string """).strip()
 UpperCAmelCase				=						input("""Enter the second string """).strip()

 UpperCAmelCase				=						check_anagrams(input_a, input_b)
 print(f'''{input_a} and {input_b} are {"" if status else "not "}anagrams.''')

