/* * @lc app=leetcode id=160 lang=java * * [160] Intersection of Two Linked Lists */ // @lc code=start /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { * val = x; * next = null; * } * } */ public class Solution { public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if(headA == null || headB == null) { return null; } int la = len(headA), lb = len(headB); ListNode cura = headA, curb = headB; if(la < lb) { // move curB for(int i=0; i