Add Two Numbers LeetCode (LinkedList)
Input: l1 = [2,4,3], l2 = [5,6,4]
Explanation: 342 + 465 = 708.
If you see the problem, it is normal with two arrays then we will go with the actual problem.
here I iterate any of the arrays from 0 to n, sum the elements of two arrays with the carry, then I save the face value to the carry (sum/10) and place the value to the result array(result[i]=sum%10) and print the array after the iteration.
Now come back to the linked list, here we have to keep the same logic but here we have to iterate the linked list.
I think you understand the logic, now lets try it with the recurssive approach, I will update it with the recurrsive approach soon.