Node *intersectionOfTwoLinkedLists(Node *l1, Node *l2)
{
int length1=0,length2=0;
while(l1!=NULL){
length1++;
l1=l1->next;
}
while(l2!=NULL){
length2++;
l2=l2->next;
}
int d=length1-length2;
if(d>=0){
while(dβ){
l1=l1->next;
}
}
else{
d=-d;
while(dβ){
l2=l2->next;
}
}
while(l1!=l2){
l1=l1->next;
l2=l2->next;
}
return l2;
}
I am getting tle error
Pls share the complete code by saving on ide so that I could check itβ¦