160 intersection of 2 linked lists
https://leetcode.com/problems/intersection-of-two-linked-lists/
如图中所示,curA和curB分别走完a + c + b和b + c + a之后会相遇在intersection处,因此让curA走完a和c之后放到headB走一遍b,让curB走完b和c之后放在headA之后走一遍a他们就会相遇
Last updated
https://leetcode.com/problems/intersection-of-two-linked-lists/
如图中所示,curA和curB分别走完a + c + b和b + c + a之后会相遇在intersection处,因此让curA走完a和c之后放到headB走一遍b,让curB走完b和c之后放在headA之后走一遍a他们就会相遇
Last updated