15% off all plans & roadmaps Use code
See plansLeetCode 369 · Solution & editorial
You are given the head of a non-empty singly linked list head, where each node contains a single digit (0-9). The digits are stored in forward order, meaning the most significant digit comes first. The linked list represents a non-negative integer.
Plus One Linked List is a Linked List Manipulation Patterns problem, in the Addition of Numbers subpattern. The pattern covers in-place reversal, merging sorted lists, reordering, and intersection detection
Master adding numbers represented as linked lists. Handle carry operations and different list lengths.
The reference solution runs in O(n) time and O(1) space.
Plus One Linked List has been reported in interviews at Google, Amazon.
The full editorial is part of Pro
It explains the core insight, the complexity analysis and the common mistakes, with a worked solution.
Plus One Linked List is a Linked List Manipulation Patterns problem, in the Addition of Numbers subpattern. Once the approach above makes sense, write it yourself and then work through the neighbouring problems that reuse it.