ListNode *getIntersectionNode(ListNode*A,ListNode*B) {
    ListNode*a=A,*b=B;while(a!=b)a=a?a->next:B,b=b?b->next:A;
    return a;

}

极简的代码