力扣 160 - Intersection of Two Linked Lists. (相交链表) Python双指针
原题地址:https://leetcode.com/problems/intersection-of-two-linked-lists/
Given the heads of two singly linked-lists
headA
andheadB
, return the node at which the two lists intersect. If the two linked lists have no intersection at all, returnnull
.For example, the following two linked lists begin to intersect at node
c1
:It is guaranteed that there are no cycles anywhere in the entire linked structure.
Note that the linked lists must retain their original structure after the function returns.
例子
Example 1