The idea is going through both list and sum up. Then minus one node at a time for which is bigger.

You'll get the intersection if two number are the same. That's also the sum of those same nodes :)

```
public class Solution {
public static ListNode getIntersectionNode(ListNode headA, ListNode headB) {
if(headA==null||headB==null)return null;
ListNode a=headA;
ListNode b=headB;
int ca=0,cb=0; //count the sum
while(a!=null||b!=null){
if(a!=null){
ca+=a.val;
a=a.next;
}
if(b!=null){
cb+=b.val;
b=b.next;
}
}
a=headA;
b=headB;
while(ca>0&&cb>0){
if(ca==cb&&a==b)return a;
else if(ca>cb){
ca-=a.val;
a=a.next;
}else{
cb-=b.val;
b=b.next;
}
}
return null;
}
```

}