Leetcode, Add Two Numbers, Programming, Leetcode Medium, Java.
node in l1, or 0 if l1 is null int y = (q != null) ? q.val : 0; // Get the value of the current node in l2, or 0 if l2 is null int sum = carry + x + y; // Calculate the sum of the current values and the carry carry = sum / 10; // Update the carry current.next = (p != null) ? p : q; // Reuse the