Loading...
Given an adjacency list representation of an undirected graph, create a deep copy (clone) of the graph.
Input: each line is a node's neighbors as comma-separated indices (1-indexed). Output the same adjacency list.
2,4 1,3 2,4 1,3
2 4 1 3 2 4 1 3
2,4, 1,3, 2,4, 1,3 represents a graph with 4 nodes, where node 1 is connected to nodes 2 and 4, node 2 is connected to nodes 1 and 3, node 3 is connected to nodes 2 and 4, and node 4 is connected to nodes 1 and 3.2 4, 1 3, 2 4, 1 3