DEV Community

loading...

Discussion on: Add Two Numbers Problems: How to Sum Two Linked Lists

Collapse
khuongduybui profile image
Duy K. Bui

Code / concept is very clear.
However, it does not make sense why you have sum > 0 in your while loop at first, all the way until you introduce sum = carry.

Collapse
coderishu profile image
ishu mishra

You know what,sum=carry is not here because this answer has been copied from LeetCode just 1 variable changed which is currentNode.