public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
		ListNode head = null, cur = null;
		
		int carry = 0, val;
		while(l1 != null || l2 != null) {
			val = carry;
			if(l1 != null) {
				val += l1.val;
				l1 = l1.next;
			}
			if(l2 != null) {
				val += l2.val;
				l2 = l2.next;
			}
			
			ListNode temp = new ListNode(val % 10);
			carry = val / 10;
			if(cur != null) cur.next = temp;
			cur = temp;
			if(head == null) head = temp;
		}
		
		if(carry == 1) {
			ListNode temp = new ListNode(1);
			cur.next = temp;
		}
		return head;
	}