Intersection point of two LL

My program is not working for the test cases, when head of one LL and tail of other meet. I have already tried the approach which uses the difference of two LL’s, but that doesn’t seem to work. I was told to do it like this. Getting wrong ans in one of the test cases.
Here is the code

This is the previous one