Test cases problem

Only two of the test cases are passing.

@guptamuskan1305
see sample testcase is also not passing. You code just check if 1st node of first linkedlist exist in second linkedlist or not. For all other nodes of first linkedList, your code don’t check since head2 already become NULL.
So create a temp node = head2; and initialise head2=temp for each iterartion of while loop.
I have modified your code, check it here https://ide.codingblocks.com/s/237223

Okay…it has submitted now.
Thank you.