def copy_random_pointer_v1(head):
dic = dict()<EOL>m = n = head<EOL>while m:<EOL><INDENT>dic[m] = RandomListNode(m.label)<EOL>m = m.next<EOL><DEDENT>while n:<EOL><INDENT>dic[n].next = dic.get(n.next)<EOL>dic[n].random = dic.get(n.random)<EOL>n = n.next<EOL><DEDENT>return dic.get(head)<EOL>
:type head: RandomListNode
:rtype: RandomListNode