Incorrect input error occur
@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.
@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;
}