Back to problems

Add Two Large Integers Stored in Linked Lists (4 digits per node)

Algorithm · Verkada · Medium

You are given two non-negative integers, A and B, each represented as a singly linked list. Every node stores exactly 4 decimal digits (a value in the range [0, 9999]). The list is ordered from the most significant block (head) to the least significant block (tail). Compute the sum A + B and return it as a linked list in the same format: 4 digits per node, most significant block first. Requirements Handle carries correctly. The result must not contain leading zeros, unless…

Checking your access…