题解 | #复杂链表的复制#
复杂链表的复制
http://www.nowcoder.com/practice/f836b2c43afc4b35ad6adc41ec941dba
# -*- coding:utf-8 -*-
# class RandomListNode:
# def __init__(self, x):
# self.label = x
# self.next = None
# self.random = None
import copy
class Solution:
# 返回 RandomListNode
def Clone(self, pHead):
# write code here
ret=copy.deepcopy(pHead)
return ret