Back to DSA sheet

Copy List with Random Pointer

MediumLinked List
Open on LeetCodeAmazonGoogleMeta

Deep copy a linked list where each node has an extra random pointer to any node or null.

Constraints
  • 0 <= n <= 1000
  • random points to a node in the list or null
Sheets
Blind 75Grind 75NeetCode 150NeetCode 250
copy-list-with-random-pointer.cpp
Loading editor
Custom input (stdin)
Output

Run your code to see its output.