Return a deep copy (clone) of a connected undirected graph. Each node contains a value and a list of its neighbors.
Input: adjList = [[2,4],[1,3],[2,4],[1,3]]
Output: [[2,4],[1,3],[2,4],[1,3]]
Topics: graphs, hash-map
Asked by: Amazon, Google, Meta, Microsoft, Apple, Adobe
Time complexity: O(V+E). Space complexity: O(V).