Leetcode, Add Two Numbers, Programming, Leetcode Medium, Java.
Complexity: O(1), this approach optimizes space usage by reusing existing nodes from the input lists instead of creating new nodes. The only additional space required is for a few auxiliary variables (dummy, current, p, q, and carry), which do not depend on the input size. Consequently, the space