getting run time error please help me with this problem, I think my sol is correct please check the sol and let me know about the corrections in the solution.
Intersection point two linked lists
Hi @WARHEAD
In the code you have shared it is getting 1 correct ans and 3 wrong ans because in Dinter function when you are calling length function then you are passing head1 and head2 due which in that function these get reduced to null which is why it is giving -1 as output and hence passing 1 test case and rest are giving wrong answer. And for getting correct answer you need to compare if(temp1->data==temp2->data) then return temp1->data;.