Given a linked list where each node has an additional random pointer that can point to any node in the list or to null, return a deep copy of the list — a completely new set of nodes with the same values and the same relative next/random structure.
head = [[7,null],[13,0],[11,4],[10,2],[1,0]]a deep-copied list with the same next/random structureSolve it in the editor. Sign in free to run your Python or JavaScript against test cases, get a verdict, and track your attempts.
Solve on FeatCode →A chain of nodes, each pointing to the next. No random access like an array, but insertion and deletion at a known position is O(1), and many classic problems come down to careful pointer rewiring.
Read the full Linked List guide →
Original problem on LeetCode ↗