Getting tLE help me sort it out

that’s because your logic is not right for this problem, take this for reference

Node *intersectionOfTwoLinkedLists(Node *l1, Node *l2)
{
    int len1 = length(l1);
    int len2 = length(l2);
    int d;

    if(len1 > len2){
        d = len1 - len2;
        while(d--)
            l1 = l1->next;
    }else{
        d = len2 - len1;
        while(d--)
            l2 = l2->next;
    }
    while(l1 != nullptr and l2 != nullptr){
        if(l1->data == l2->data)
            return l1;
        l1 = l1->next;
        l2 = l2->next;
    }
    return nullptr;
}

I am still unable to get the desired output can some one help with the working code for refrence

You can refer this

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.