Carry

2 articles

dsa9 min read

Add Two Numbers — Carry Simulation on Reversed Linked Lists

LC 2 Add Two Numbers is one of the most iconic interview problems at Amazon, Google, and Microsoft where you simulate grade-school addition on two reversed linked lists digit by digit. Master the carry propagation technique with Python and JavaScript solutions, visual dry run, and common pitfalls.

Read →
dsa9 min read

Add Two Numbers II — Stack-Based Reverse-Order Addition Explained

LC 445 Add Two Numbers II is a medium interview problem at Amazon and Google where numbers are stored most-significant-digit first, requiring stacks or list reversal to process from LSB. Learn the optimal stack-based solution with Python and JavaScript, dry run, and the key difference from LC 2.

Read →