Update 面试题02.07.链表相交.md

This commit is contained in:
JaneyLin
2022-06-08 17:47:49 -05:00
committed by GitHub
parent 87abfa1664
commit ba31161609

View File

@ -160,6 +160,8 @@ class Solution:
那么,只要其中一个链表走完了,就去走另一条链表的路。如果有交点,他们最终一定会在同一个
位置相遇
"""
if headA is None or headB is None:
return None
cur_a, cur_b = headA, headB # 用两个指针代替a和b