public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
if(headA==null || headB==null) return null;
ListNode curA = headA;
ListNode curB = headB;
int countA = 0;
int countB = 0;
while(curA!=null){
countA++;
curA = ;
}
while(curB!=null){
countB++;
curB = ;
}
int sub=0;
if(countA>=countB){
sub = countA-countB;
}else{
ListNode temp = headA;
headA = headB;
headB = temp;
sub = countB-countA;
}
curA = headA;
curB = headB;
while(sub!=0){
headA = ;
sub--;
}
while(headA!=null){
if(headA==headB) return headA;
headA = ;
headB = ;
}
return null;
}