Problem 138 · Medium

Copy List with Random Pointer

Interleave cloned nodes with originals to copy random pointers in O(1) space, then separate the lists.

Open the interactive visualisation