Copy List with Random Pointer at Meta

Medium62.4% acceptance

This problem has 75.0% frequency at Meta.

Problem Description

A linked list of length `n` is given such that each node contains an additional random pointer, which could point to any node in the list, or `null`. Construct a [**deep copy**](<https://en.wikipedia.org/wiki/Object_copying#Deep_copy>) of the list. The deep copy should consist of exactly `n` **bran...

Read full problem and hints

Topics

Also asked at 23 companies


More Meta Questions

View all Meta questions