Merge Sorted Linked List

Why is it failing few test cases…

Check now if it works.

still not working…

https://ide.codingblocks.com/s/278822?_ga=2.166301111.848224037.1593772448-1643507743.1559746304 still not working…

Your code seems correct.
Check if this passes all the test case.
If it does not then there are some issues with the test cases.

It passed all the test cases… Can you help me know why was mine code not working…

Your merge function is correct.Most probably the arrays are creating the issue.
Also your code is failing for such cases
1
0

5
12 113 134 145 200
Actually you do not have to create an array to take the inputs.
You can follow the approach as in above code.

https://ide.codingblocks.com/s/278793 Thanks for help… I made a change in line 96 and 98 and now it is passing all the test cases…