Explain the question


Can somebody explain what does “Clone of graph” mean?


It’s a deep copy of the graph, i.e. you create a new node corresponding to each and every node while linking the cloned node to cloned neighbors of the original graph.


Just iterate over first gaph and maintain a hashMap of original and new nodes. More so like linked list copy with randome pointer question.


From an example I tried with the “See expected output” button, it seems what is expected is converting the adjacency matrix to an adjacency list.