int length1=0,length2=0;
Node* temp1=l1;
Node* temp2=l2;
while(temp1!=NULL){
temp1=temp1->next;
length1++;
}
while(temp2!=NULL){
temp2=temp2->next;
length2++;
}
temp1=l1;
temp2=l2;
if(length1>length2){
int count=length1-length2;
while(count--){
temp1=temp1->next;
}
}
else{
int count=length2-length1;
while(count--){
temp2=temp2->next;
}
}
while(temp1!=temp2){
temp1=temp1->next;
temp2=temp2->next;
}
return temp1;