diff --git a/001. Add Two Numbers/solution.h b/001. Add Two Numbers/solution.h index 69e0a0a..f823c2d 100644 --- a/001. Add Two Numbers/solution.h +++ b/001. Add Two Numbers/solution.h @@ -14,6 +14,7 @@ class Solution { for (div_t sum{0, 0}; sum.quot || l1 || l2; tail = tail->next) { if (l1) { sum.quot += l1->val; l1 = l1->next; } if (l2) { sum.quot += l2->val; l2 = l2->next; } + if (l3) { sum.quot += l3->val; l3 = l3->next; } sum = div(sum.quot, 10); tail->next = new ListNode(sum.rem); }