LeetCode 2: Add Two Numbers from Naive to Optimal Carry Simulation

Subtitle / Summary This problem is just grade-school addition on a linked list: add one digit at a time, propagate carry, and append one final node if carry remains after both lists end. We move from naive ideas to the optimal one-pass solution, then map it to real engineering scenarios. Reading time: 12-15 min Tags: linked list, carry, simulation, LeetCode 2 SEO keywords: Add Two Numbers, LeetCode 2, reverse-order list, carry, dummy node Meta description: Use dummy + tail + carry to sum two reverse-order linked lists in O(max(m,n)) time, with common pitfalls, engineering analogies, and six-language runnable implementations. Target Readers Beginners building a stable template for linked-list problems Intermediate developers who often miss carry or boundary cases Engineers who want to transfer algorithmic thinking to stream-style data processing Background / Motivation This looks like an entry-level LeetCode problem, but it trains practical skills you will reuse: ...

February 11, 2026 · 14 min · map[name:Jeanphilo]

Hot100: Spiral Matrix (Boundary Shrinking Simulation ACERS Guide)

Subtitle / Summary Spiral traversal looks like “just printing in a fancy order”, but the real difficulty is getting boundaries and invariants right. This ACERS guide gives a reusable boundary-shrinking template and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, matrix, simulation, boundary shrinking SEO keywords: Hot100, Spiral Matrix, clockwise traversal, boundary shrinking, LeetCode 54 Meta description: O(mn) spiral order traversal using boundary shrinking, with pitfalls, engineering scenarios, and runnable code. Target Readers Hot100 learners who want a reliable “matrix simulation” template Intermediate engineers who often get boundary cases wrong Anyone working with grids (visualization, raster data, path generation) Background / Motivation Matrix problems are notorious for being “easy to code, hard to get 100% correct”. One extra loop or one missed boundary check can break single-row/single-column cases or cause duplicated output. ...

February 3, 2026 · 13 min · map[name:Jeanphilo]