parameters: (self, head)
return_statement: return clone[head]
docstring: :type head: RandomListNode
          :rtype: RandomListNode
docstring_summary: :type head: RandomListNode
          :rtype: RandomListNode
docstring_tokens: : type head : RandomListNode : rtype : RandomListNode
function: def copyRandomList(self, head):
          """
          :type head: RandomListNode
          :rtype: RandomListNode
          """
          clone = defaultdict(lambda: Node(0))
          clone[None] = None
          cur = head
  
          while cur:
              clone[cur].val = cur.val
              clone[cur].next = clone[cur.next]
              clone[cur].random = clone[cur.random]
              cur = cur.next
  
          return clone[head]
function_tokens: def copyRandomList ( self , head ) : clone = defaultdict ( lambda : Node ( 0 ) ) clone [ None ] = None cur = head while cur : clone [ cur ] . val = cur . val clone [ cur ] . next = clone [ cur . next ] clone [ cur ] . random = clone [ cur . random ] cur = cur . next return clone [ head ]