← All problems

Copy List with Random Pointer

Medium linked listshash maps LeetCode ↗
Deep-copy a list where each node has next and random pointers.

Hints (0/3 revealed)

Log in to reveal hints progressively.

Complexity

Time O(n), Space O(n) map / O(1) interleave

Common pitfalls

  • Shallow-copying random targets
  • Breaking the original list during split

Your solution

Log in to save your code and track progress.