Link list intersection only one test case fails

https://ide.codingblocks.com/s/57483 @ashishnagpal2498 bhaiya only one test case fails help me to debug

Hi , Neeraj , your approach for the given question is bit wrong .
You are calculating the length of two linked list , traversing the linked list which is of greater length till the difference , but it can be possible that the intersection point lie before the difference point.
So instead of calculating length of two linked list , try using two loops , comparing each node value of the 1st linked list with the other linked list .

@ashishnagpal2498 ok bhaiya i got it

@ashishnagpal2498 https://ide.codingblocks.com/s/57695 bhaiya there is little mistake in my code kindly debug it

Your while loop condition should be - a!=NULL and b!=NULL .Otherwise, It will skip the testcase when the intersection point is present at the last of the linked list.