From ba31161609d4131a5d039046435a8f21805e301d Mon Sep 17 00:00:00 2001 From: JaneyLin <105125897+janeyziqinglin@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:47:49 -0500 Subject: [PATCH] =?UTF-8?q?Update=20=E9=9D=A2=E8=AF=95=E9=A2=9802.07.?= =?UTF-8?q?=E9=93=BE=E8=A1=A8=E7=9B=B8=E4=BA=A4.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/面试题02.07.链表相交.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/problems/面试题02.07.链表相交.md b/problems/面试题02.07.链表相交.md index 0a38cc33..ba6631a4 100644 --- a/problems/面试题02.07.链表相交.md +++ b/problems/面试题02.07.链表相交.md @@ -160,6 +160,8 @@ class Solution: 那么,只要其中一个链表走完了,就去走另一条链表的路。如果有交点,他们最终一定会在同一个 位置相遇 """ + if headA is None or headB is None: + return None cur_a, cur_b = headA, headB # 用两个指针代替a和b