Node *intersectionOfTwoLinkedLists(Node *l1, Node *l2)
{
stack<Node>s1;
stack<Node>s2;
Node*p=NULL;
while(l1!=NULL)
{
s1.push(l1);
l1=l1->next;
}
while(l2!=NULL)
{
s2.push(l2);
l2=l2->next;
}
while(s1.top()==s2.top())
{
s1.pop();
p=s2.top();
s2.pop();
}
return p;
}