public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        ListNode dummy = new ListNode(-1);
        ListNode dummyHead = dummy;
        int extra = 0;
        while(l1 != null && l2 != null){
            dummy.next = new ListNode((l1.val + l2.val + extra) % 10);
            extra = l1.val + l2.val + extra > 9 ? 1 : 0;
            dummy = dummy.next;
            l1 = l1.next;
            l2 = l2.next;
        }
        ListNode n = l1 != null? l1 : l2;
        while(n != null){
            dummy.next = new ListNode((n.val + extra) % 10);
            extra = n.val + extra > 9 ? 1 : 0;
            n = n.next;
            dummy = dummy.next;
        }
        if(extra == 1) dummy.next = new ListNode(1);
        return dummyHead.next;
    }