Incorrect input error occur

https://ide.codingblocks.com/s/681611 it pick last element every time

@deepgarg46 This question is made such that you can only submit it. This means you will always get an error when you use “compile and test”. SO just SUBMIT your code and check if the test cases pass.

https://ide.codingblocks.com/s/681667 please tell me why node n1 show null

@pssharma1410 sir please reply

@deepgarg46 benchmark your code with this :

Node intersectionOfTwoLinkedLists(Node l1, Node l2) {
    if (l1 == null || l2 == null)
        return null;

    Node a = l1;
    Node b = l2;

    while (a != b) {
        a = a == null ? l1 : a.next;
        b = b == null ? l2 : b.next;
    }

    return a;
}