Interview-code-practice-python
Interview-code-practice-python copied to clipboard
无环链表相交 解法太复杂
class Solution(object):
def getIntersectionNode(self, headA, headB):
cura, curb = headA, headB
while cura is not curb:
cura = cura.next if cura else headB
curb = curb.next if curb else headA
return cura