Linked List pattern

Add Two Numbers

Two non-negative numbers are stored as linked lists of digits in reverse order. Add them and return the sum as a linked list, also in reverse order. Watch it run step by step, then write your own pseudocode and get it checked by AI.

  • LeetCode 2
  • Medium
  • 1 approach

Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.

Linked ListLeetCode 2

Medium

The approach

  1. 01 Elementary addition · carry O(max(n, m))O(max(n, m)) space
Played step by step, with its time and space.

What you will learn

  • How to read Add Two Numbers and spot the linked list pattern in it
  • Elementary addition · carry: O(max(n, m)) time, O(max(n, m)) space
  • The pseudocode for each approach, its line lit as the animation runs
  • Practice: write your own pseudocode and get it checked

More Linked List

See Add Two Numbers run, step by step

Sign in and this page opens on the animation, with all 9 Linked List problems beside it.

DSA comes with the all labs plan and every ChaiCode batch.