Copy List With Random Pointer
Medium
Linked List
Each node has a value and a random pointer to any node in the list (or null). Create a deep copy and print, for each node of the copy in order, its value and the index its random pointer targets (-1 for null).
Constraints
0 <= n <= 1000 -10^4 <= value <= 10^4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.