Clone Graph

Clone an undirected graph given its adjacency list representation. The input adj lists, for each node, its 1-based neighbor values. Return a deep copy of the graph in the same adjacency list form, preserving node order and neighbor order. Treat the adjacency arrays as the graph itself, so the output must be a new array of new arrays with the same structure as the input.

Examples
Input: [[2,4],[1,3],[2,4],[1,3]]
Output: [[2,4],[1,3],[2,4],[1,3]]
Hints
Related Problems

Clone Graph

Clone an undirected graph given its adjacency list representation. The input `adj` lists, for each node, its 1-based neighbor values. Return a deep copy of the graph in the same adjacency list form, preserving node order and neighbor order. Treat the adjacency arrays as the graph itself, so the output must be a new array of new arrays with the same structure as the input.