give reference node connect undirected graphReturn deep copy clone graphEach node graph contain value int list ListNode neighborsclass Node public int val public ListNode neighbor test case formatfor simplicity node value nod index 1indexed for example node val 1 second node val 2 the graph represent test case adjacency listan adjacency list collection unordered list represent finite graph each list describe set neighbor node graphthe give node node val 1 you return copy give node reference cloned graph Example 1input adjlist 24132413output 24132413explanation there 4 node graph1st node val 1s neighbor 2nd node val 2 4th node val 42nd node val 2s neighbor 1st node val 1 3rd node val 33rd node val 3s neighbor 2nd node val 2 4th node val 44th node val 4s neighbor 1st node val 1 3rd node val 3example 2input adjlist Output Explanation Note input contain list the graph consist node val 1 neighborsExample 3input adjlist Output Explanation this graph node ConstraintsThe number node graph range 0 1001 Nodeval 100nodeval unique nodeThere repeat edge selfloop graphThe Graph connect node visit start give node