"""simple docstring"""






from __future__ import annotations


def      UpperCAmelCase__			(							lowerCAmelCase__	:list						)					->       list:
      '''simple docstring'''


      if len(lowerCAmelCase__						) == 0:
            return []
      lowercase				,				lowercase								=      min(lowerCAmelCase__						), max(lowerCAmelCase__						)
      lowercase								=      int(max_value - min_value						) + 1
      lowercase								=      [[] for _ in range(lowerCAmelCase__						)]

      for i in my_list:
            buckets[int(i - min_value						)].append(lowerCAmelCase__						)

      return [v for bucket in buckets for v in sorted(lowerCAmelCase__						)]


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

       testmod()
       assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
       assert bucket_sort([0, 1, -1_0, 1_5, 2, -2]) == [-1_0, -2, 0, 1, 2, 1_5]




"""simple docstring"""






from __future__ import annotations


def      UpperCAmelCase__			(							lowerCAmelCase__	:dict   ,						lowerCAmelCase__	:str						)					->       set[str]:
      '''simple docstring'''


      lowercase				,				lowercase								=      set(lowerCAmelCase__						), [start]

      while stack:
            lowercase								=      stack.pop()
            explored.add(lowerCAmelCase__						)
            # Differences from BFS:
            # 1) pop last element instead of first one
            # 2) add adjacent elements to stack without exploring them
            for adj in reversed(graph[v]						):
                  if adj not in explored:
                        stack.append(lowerCAmelCase__						)
      return explored


__lowerCAmelCase       :			str   	={
    """A""": ["""B""", """C""", """D"""],
    """B""": ["""A""", """D""", """E"""],
    """C""": ["""A""", """F"""],
    """D""": ["""B""", """D"""],
    """E""": ["""B""", """F"""],
    """F""": ["""C""", """E""", """G"""],
    """G""": ["""F"""],
}

if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(depth_first_search(G, """A"""))



