我中有你 你中有我!
题目描述:
public class Solution {
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
if(headA==null||headB==null){
return null;
}else {
ListNode A=headA;
ListNode B=headB;
while (A!=B){
A= A == null ? headB : A.next;
B= B == null ? headA : B.next;
}
return A;
}
}
}