Copy List with Random Pointer
A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Construct a deep copy of the list.
Copy List with Random Pointer

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Construct a deep copy of the list.

Example 1:
Input: [[7,-1],[13,0],[11,4],[10,2],[1,0]]
Output: [[7,null],[13,0],[11,4],[10,2],[1,0]]
Input
arr =[[7,-1],[13,0],[11,4],[10,2],[1,0]]

Deep copy with random pointers

1. Interleave
2. Random
3. Separate
Original:71311101
[7, null]
[13, 0]
[11, 4]
[10, 2]
[1, 0]
Variables
No variables to display
DepthFunction Call
Stack empty
0/4