Unable to point out the error


This is my code.It only prints -1 for some cases and no output for others

I have edited your code… Try to submit it now…

Yupp it worked but shouldn’t we compare according to addresses . One case can be when LL can have repeating data but no intersection .

No, you need to work on the data of both linked list… And it would form Y like structure, when both linked list have a common point of intersection between them…