Leetcode, Add Two Numbers, Programming, Leetcode Medium, Java.
l2.next; } ListNode result = new ListNode(sum % 10); result.next = addTwoNumbers(l1, l2, sum / 10); return result; } public ListNode addTwoNumbers(ListNode l1, ListNode l2) { return addTwoNumbers(l1, l2, 0); } } Time and Space Complexity Time Complexity: O(n), similar to the iterative approach, the