Add two number in reverse


In given problem I have solved but many test cases are failing Please help?? Is my approach is correct ??

Your link is not working in my side. Save your code on ide.codingblocks.com and share its link.

Can you just explain your code or comment it so that i can check it easily.

Here is a simple recursive approach for this question https://ide.codingblocks.com/s/276202
You can refer it.


I have comment down Now please look where I am doing wrong

In variable N1, you are forming the actual number in integer format. This will give runtime error for large test cases.Integers can hold values upto order 10^9. So if number is >10^9, it cannot be stored in N1 and will give runtime error.
So think of another approach, don’t convert the linked list into its integer equivalent .

Here is another approach https://ide.codingblocks.com/s/276364

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.