```
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) {
struct ListNode* l4 = l1;
int carry = 0;
while(l1 != NULL) {
if(l2 != NULL) {
l1->val += l2->val;
carry = l1->val/10;
l1->val %= 10;
}
if(l1->next != NULL) {
l1 = l1->next;
} else
if(l2 != NULL) {
if(l2->next == NULL && carry > 0) {
l1->next = (struct ListNode*)malloc(sizeof(struct ListNode));
l1->val = carry;
break;
}
l1 = l2->next;
}
if(l2 != NULL) l2 = l2->next;
if(l1 != NULL) l1->val += carry;
}
return l4;
}
```

for [5] and [5] my solution produces [1,0] instead of [0,1]