input: Write a python function to perform depth-first search (DFS) on a graph and return the set of visited nodes.
  assert dfs({'A': {'B', 'C'}, 'B': {'A', 'D', 'E'}, 'C': {'A', 'F'}, 'D': {'B'}, 'E': {'B', 'F'}, 'F': {'C', 'E'}}, 'A') == {'A', 'B', 'C', 'D', 'E', 'F'}
  assert dfs({'1': {'2', '3'}, '2': {'1', '4'}, '3': {'1', '5'}, '4': {'2', '5'}, '5': {'3', '4'}}, '1') == {'1', '2', '3', '4', '5'}
  assert dfs({'X': {'Y'}, 'Y': {'X', 'Z'}, 'Z': {'Y'}}, 'X') == {'X', 'Y', 'Z'}
output: def dfs(graph, start):
      visited = set()
      stack = [start]
  
      while stack:
          node = stack.pop()
          if node not in visited:
              visited.add(node)
              stack.extend(graph[node] - visited)
      
      return visited