时隔1年继续力扣刷起来。160 相交链表​ class Solution: def getIntersectionNode(self, headA: ListNode, headB: ListNode) - Optional[ListNode]: p,qheadA,headB; while p is not q: pp.next if p else headB; qq.next if q else headA; return p;206 反转链表判断 head is None 是为了兼容一开始链表就是空的情况递归class Solution: def reverseList(self, head: Optional[ListNode]) - Optional[ListNode]: if head is None or head.next is None: return head; rev_headself.reverseList(head.next); tailhead.next; tail.nexthead; head.nextNone; return rev_head;