Intersection point of two linked list

Why i am getting wrong output

hello @vaishnavtannu ,
image

you are not updating diff variable in these two while loop.

add diff- -; inside both the loops.

Now I am getting -1 for the sample test case https://ide.codingblocks.com/s/218145

@vaishnavtannu
here u are modiying ur n1 and n2
image

both will become 0 after while loop.

so store their values somewhere for later uses.

refer this -> https://ide.codingblocks.com/s/218151