public class Solution { public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if (headA == null || headB == null) { return null; } ListNode pA = headA; ListNode pB = headB; while (pA != pB) { pA = (pA == null) ? headB : pA.next; pB = (pB == null) ? headA : pB.next; } return pA; } }
标签:pB,Java,链表,pA,hot100,headB,headA,ListNode,null From: https://www.cnblogs.com/qzhc/p/17568715.html