Leetcode, Add Two Numbers, Programming, Leetcode Medium, Java.
current.next; // Move to the next node in the result list if (l1 != null) l1 = l1.next; // Move to the next node in l1 if (l2 != null) l2 = l2.next; // Move to the next node in l2 } if (carry > 0) { // If there is a remaining carry, create a new node for it current.next = new ListNode(carry); }