@@ -0,0 +1,1065 @@
+/**%0A * A linked list is given such that each node contains an additional random pointer %0A * which could point to any node in the list or null.%0A * Return a deep copy of the list.%0A */%0Apublic class Solution %7B%0A  public RandomListNode copyRandomList(RandomListNode head) %7B%0A    if (head == null) return null;%0A%0A    HashMap%3CRandomListNode, RandomListNode%3E map = new HashMap%3CRandomListNode, RandomListNode%3E();%0A    RandomListNode temp = head;%0A%0A    // Populate the map and instantiate all new nodes.%0A    while (temp != null) %7B%0A      map.put(temp, new RandomListNode(temp.label));%0A      temp = temp.next;%0A    %7D%0A%0A    temp = head;%0A    RandomListNode newHead = new RandomListNode(-1);%0A    RandomListNode anotherNode = newHead;%0A    while (temp != null) %7B%0A      RandomListNode clone = map.get(temp);%0A      newHead.next = clone;%0A      RandomListNode random = temp.random;%0A%0A      // Assign the random pointer, if it exists.%0A      if (random != null) newHead.next.random = map.get(random);%0A      temp = temp.next;%0A      newHead = newHead.next;%0A    %7D%0A%0A    return anotherNode.next;%0A  %7D%0A%7D

Add linked list deep copy problem