Failling test cases


can you please check my code

Hey @chitranshanmol07, your code is working perfectly fine. What issues are you facing ?

upon submitting it is not passing any test case

I will debug your code as soon as possible. Just have a little patience.

Hey @chitranshanmol07 , there is only one mistakes in your code and that is in your logic of mergetwoll(), as you have made a new node c, you update it until node a or node b ends which eventually makes your node *c point to tail of your c linked list which you have made while calling recursion and you are returning your tail instead of you should have returned head of c linked list. I would suggest you to make your mergetwoll() function again while correctly implementing your logic. I know you would be able to find your mistake as i see there’s only a logical mistake Happy to help :smile: Keep learning :+1:

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.

not able to figure out how to correct the code

Hey @chitranshanmol07 do you want me , to provide you with the code?

yes code would be heplful

Do you want recursive approach or iterative approach?

i have doubt in recursive approach

Hey @chitranshanmol07 I have coded for recursive approach here: https://ide.codingblocks.com/s/325973 You can check.
I’ll suggest you to dry run it and see where were you wrong :grinning:
Hope it will help you learn this concept better :grinning:

defining node*c before corner case was the mistake ? i cant figure out anything else

Yes it was the only mistake :grinning: