Why my code show segmentation error

@Pritam these error is due to the line 57
if(current2==NULL)
when current2 points to last node in linklist i find it after debugging code it may be due to problem in accessing that variable in that if condition. I didnt find any exact ans anywhere rightnow but i will update it as soon as i find it.

But I wanna tell you that you are going threw right approch but it will not pass your test case.
this double pointer technique works on when you were given a link list that actual merge an point to same pointer.
But in your case two different link list pointing to different nodes with same data.
I think you got my point if not you can reply back

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.