30:00
Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph.
The number of nodes is in the range [0,100][0, 100][0,100].
1≤Node.val≤1001 \leq \text{Node.val} \leq 1001≤Node.val≤100
Node.val is unique for each node.
Node.val
There are no repeated edges and no self-loops in the graph.
The graph is connected and all nodes can be visited starting from the given node.
Checking if node 1 is cloned
1
2
3
4