Test Case not passing

I have used my own logic to make the entire code but for some reason, my test cases are not clearing. Here is the link to my code. Kindly help. Thanks in advance.

Hey @Divye-Aggarwal-3050062625037589


Updated line 27 & 41 ,rest code is correct :slight_smile:

Sir, can the logic be more optimised ? I mean w.r.t time complexity and space complexity or can I further use a better logic?

U can input them as linked list in reverse order and then store the sum in one of them and print it in reverse order

Say 1 2 3
Then LL should be 3->2->1
Same for other then add them
And print in reverse order

Thankyou Sir, will try and share my code with you. :grin::+1:t2:

1 Like

Hey @Divye-Aggarwal-3050062625037589
If u don’t have any other doubt in this then please mark it as resolved :slight_smile: