Add Two Numbers II | Stack, Reverse Linked List & Optimized Solution Explained | Java Python C++

Published: 06 July 2026
on channel: RisingBrain
255
13

In this video, we solve Add Two Numbers II using three different approaches, starting from the basic idea and moving towards more interview-friendly solutions.

✅ Approach 1: Brute Force (Using Array/List)
Store both linked lists in arrays/lists.
Traverse from the end, add digits with carry, and build the answer.

Time Complexity: O(n + m)
Space Complexity: O(n + m)

✅ Approach 2: Reverse Both Linked Lists
Reverse both linked lists.
Perform normal addition from least significant digit.
Reverse the final linked list to restore forward order.

Time Complexity: O(n + m)
Space Complexity: O(1) (excluding the output list)

✅ Approach 3: Using Stack (Interview Preferred)
Push all nodes into two stacks.
Pop elements one by one, add with carry, and create the result from front to back.

Time Complexity: O(n + m)
Space Complexity: O(n + m)

In this video, we also compare all three approaches, discuss their advantages and trade-offs, and understand which solution is preferred in coding interviews.

Rising Brain (DSA Sheet):
https://www.risingbrain.org/sheet

Connect with me here:

LinkedIn –   / anjalikumari22  

Instagram –   / rbanjali.codes  

Twitter (X) – https://x.com/anjali1kumari?s=21

👍 Like, Share & Subscribe for complete Pattern-wise DSA preparation with Rising Brain.


On this page of the site you can watch the video online Add Two Numbers II | Stack, Reverse Linked List & Optimized Solution Explained | Java Python C++ with a duration of hours minute second in good quality, which was uploaded by the user RisingBrain 06 July 2026, share the link with friends and acquaintances, this video has already been watched 255 times on youtube and it was liked by 13 viewers. Enjoy your viewing!