Where is mistake in the code?

@amansanyam,
Check the output for
5
10 20 30 40 50
4
15 25 40 50
It’s intersection point should be 40 and your code is giving -1,
probably in _getintersection function you should compare curr1->data==curr2->data, since you’re creating two entirely different linked lists for the two given list of numbers, their exact pointers will never match i.e. it won’t be the case that curr1==curr2, however the values may match, so use curr1->data==curr2->data.
Hope it helps :slight_smile:

thank you its running now