Merge 2 LL doubt

i have submitted the code for exercise and it’s showing me MLE but i couln’t able to figure out how to reduce memory

there are multiple testcase
so you have to consider this also

in the function of making linked list
add one more condition
if(n==0) {head=NULL ; return;}

Modified Code

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like :heart:: and don’t forgot to mark doubt as resolved :grinning:

1 Like

thanks a lot buddy…can you pls check where i am gng wrong in floyd cycle algorithm