# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
#
#
# @param pHead1 ListNode类
# @param pHead2 ListNode类
# @return ListNode类
#
class Solution:
def FindFirstCommonNode(self , pHead1 , pHead2 ):
# write code here
if not pHead1 or not pHead2:
return None
l1 = list()
cur = pHead1
while cur:
l1 += [cur]
cur = cur.next
cur = pHead2
while cur:
if cur in l1:
return cur
cur = cur.next
return None



京公网安备 11010502036488号