一、leetcode地址
https://leetcode.com/problems/intersection-of-two-linked-lists/
二、问题描述
三、代码实现
语言:Python3
代码:
class Solution(object):
def getIntersectionNode(self, headA, headB):
tempA = headA;tempB = headB
while tempA != tempB:
tempA = tempA.next if tempA else headB
tempB = tempB.next if tempB else headA
return tempA