@@ -0,0 +1,1332 @@
+package me.wayne.leetcodetop100.listnode;%0A%0Aimport me.wayne.leetcodetop100.ListNode;%0A%0A/**%0A * %E7%BB%99%E4%BD%A0%E4%B8%A4%E4%B8%AA%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E5%A4%B4%E8%8A%82%E7%82%B9 headA %E5%92%8C headB %EF%BC%8C%E8%AF%B7%E4%BD%A0%E6%89%BE%E5%87%BA%E5%B9%B6%E8%BF%94%E5%9B%9E%E4%B8%A4%E4%B8%AA%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9B%B8%E4%BA%A4%E7%9A%84%E8%B5%B7%E5%A7%8B%E8%8A%82%E7%82%B9%E3%80%82%0A * %E5%A6%82%E6%9E%9C%E4%B8%A4%E4%B8%AA%E9%93%BE%E8%A1%A8%E4%B8%8D%E5%AD%98%E5%9C%A8%E7%9B%B8%E4%BA%A4%E8%8A%82%E7%82%B9%EF%BC%8C%E8%BF%94%E5%9B%9E null %E3%80%82%0A * %3Cp%3E%0A * https://leetcode-cn.com/problems/intersection-of-two-linked-lists/%0A */%0Apublic class LC160_GetIntersectionNode %7B%0A%0A    public ListNode getIntersectionNode(ListNode headA, ListNode headB) %7B%0A        int lenA = getLength(headA);%0A        int lenB = getLength(headB);%0A        int step = Math.abs(lenA - lenB);%0A        if (lenA %3C lenB) %7B%0A            headB = forward(headB, step);%0A        %7D else if (lenA %3E lenB) %7B%0A            headA = forward(headA, step);%0A        %7D%0A%0A        ListNode res = null;%0A        while (headA != null && headB != null) %7B%0A            if (headA == headB) %7B%0A                res = headA;%0A                break;%0A            %7D%0A            headA = headA.next;%0A            headB = headB.next;%0A        %7D%0A%0A        return res;%0A    %7D%0A%0A    private ListNode forward(ListNode head, int step) %7B%0A        for (int i = 0; i %3C step; i++) %7B%0A            head = head.next;%0A        %7D%0A        return head;%0A    %7D%0A%0A    private int getLength(ListNode head) %7B%0A        if (head == null) %7B%0A            return 0;%0A        %7D%0A        int result = 0;%0A        while (head != null) %7B%0A            result++;%0A            head = head.next;%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

add LC160_GetIntersectionNode