【Leetcode】160. Intersection of Two Linked Lists

求两个链表的交点 方法1 长度差法 首先求出长的链表比短的链表长了多少(比如长了m),然后从长链表先走m步,然后两个链表一起走,即可相遇 class Solution1(object): def getIntersectionNode(self,headA, headB): """ :type head1, head1: ListNode :rtype: ListNode
相关文章
相关标签/搜索