code: def copyRandomList(self, head):
      """
      :type head: Node
      :rtype: Node
      """
  
      if not head:
          return head
  
      old_node = head
      # Creating the new head node.
      new_node = Node(old_node.val, None, None)
      self.visited[old_node] = new_node
  
      # Iterate on the linked list until all nodes are cloned.
      while old_node != None:
          # Get the clones of the nodes referenced by random and next pointers.
          new_node.random = self.getClonedNode(old_node.random)
          new_node.next = self.getClonedNode(old_node.next)
  
          # Move one step ahead in the linked list.
          old_node = old_node.next
          new_node = new_node.next
  
      return self.visited[head]
  
label_desc: Use image node_id 3 for calling the Solution obj's underlying member method code with example usage: obj.copyRandomList(head) and returns: self, head