@@ -0,0 +1,1394 @@
+package com.lintcode;%0A%0A/**%0A * @author : Joshua%0A * Date:     1/25/16%0A * @see %3Ca href=%22http://www.lintcode.com/zh-cn/problem/add-two-numbers/%22%3E%E9%93%BE%E8%A1%A8%E6%B1%82%E5%92%8C%3C/a%3E%0A */%0Apublic class AddTwoNumbers %7B%0A%0A    public ListNode addLists(ListNode l1, ListNode l2) %7B%0A        // write your code here%0A        ListNode dummyNode = new ListNode(0);%0A        addListNode(l1, l2, dummyNode, 0);%0A        return dummyNode.next;%0A    %7D%0A%0A    private void addListNode(ListNode l1, ListNode l2, ListNode resultNode, int carry) %7B%0A        if (l1 == null && l2 == null && carry == 0) %7B%0A            return;%0A        %7D%0A%0A        int l1Value = l1 == null ? 0 : l1.val;%0A        int l2Value = l2 == null ? 0 : l2.val;%0A        int resultValue = l1Value + l2Value + carry;%0A%0A        resultNode.next = new ListNode(resultValue %3E 9 ? getSingleNumberValue(resultValue) : resultValue);%0A        addListNode(l1 == null ? null : l1.next,%0A                    l2 == null ? null :l2.next,%0A                    resultNode.next,%0A                    resultValue %3E 9 ? 1 : 0);%0A    %7D%0A%0A    private int getSingleNumberValue(int resultValue) %7B%0A        String resultValueStr = Integer.toString(resultValue);%0A        return Integer.parseInt(resultValueStr.substring(resultValueStr.length() - 1));%0A    %7D%0A%0A    public static class ListNode %7B%0A        int val;%0A        ListNode next;%0A        ListNode(int x) %7B%0A            val = x;%0A            next = null;%0A        %7D%0A    %7D%0A%7D

Add solution of add two numbers with linked list