You're given a node in a connected undirected graph. Each node contains a value and a list of neighbors. Your task: return a deep copy of the graph.
This means creating completely new node objects with the same values and connections as the original. If node connects to node in the original, your copied node must connect to your copied node .
The challenge: as you traverse the graph with DFS, how do you avoid creating duplicate copies of the same node? If node and node both reference node , you need exactly one copy of node .