Deep Copy Linked List with Random Pointer

Implement a function that deep-copies a singly linked list in which every node has a random pointer.

The node definition is:

class Node:
    def __init__(self, val: int, next=None, rando...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: