public class Solution {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
//怎么保证a链表上的指针下次指到b链表? 一轮就行了 不用考虑
ListNode a = headA;
ListNode b = headB;
while(a != b){
a = a == null ? headB : a.next;
b = b == null ? headA : b.next;
}
return a;
}
}