package leetcode;

/**
 * https://leetcode.com/problems/add-two-numbers-ii/
 */
public class Problem445 {
    public static class ListNode {
        int val;
        ListNode next;

        ListNode(int x) {
            val = x;
        }
    }

    public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem445 prob = new Problem445();
        ListNode l1 = new ListNode(7);
        l1.next = new ListNode(2);
        l1.next.next = new ListNode(4);
        l1.next.next.next = new ListNode(3);

        ListNode l2 = new ListNode(5);
        l2.next = new ListNode(6);
        l2.next.next = new ListNode(4);

        System.out.println(prob.addTwoNumbers(l1, l2));
    }
}

@@ -313,35 +313,582 @@
     
-// TODO%0A        return null
+Num n1 = getNumber(l1);%0A        Num n2 = getNumber(l2);%0A        long sum = n1.n + n2.n;%0A        // TODO%0A        return null;%0A    %7D%0A%0A    private static class Num %7B%0A        private long n;%0A        private int digit;%0A%0A        public Num(long n, int digit) %7B%0A            this.n = n;%0A            this.digit = digit;%0A        %7D%0A    %7D%0A%0A    private static Num getNumber(ListNode node) %7B%0A        if (node == null) %7B%0A            return new Num(0, 1);%0A        %7D%0A        Num num = getNumber(node.next);%0A        num.n += (node.val * num.digit);%0A        num.digit *= 10;%0A        return num
 ;%0A  

Update problem 445