Skip to content
Codeloom

Topics / Dynamic Programming

🧩

Dynamic Programming

Overlapping subproblems + optimal substructure — memoization and tabulation, demystified.

Why learn Dynamic Programming?

  • The interview topic that scares people the most — and rewards practice the most.

  • Many "hard" problems reduce to a 1D or 2D DP table.

  • Builds your skill to recognize state and transitions in any algorithm.

What you can build with Dynamic Programming

Sequence problems (LIS, LCS, edit distance) Knapsack and partition problems Counting paths and partitions on grids

Dynamic Programming tutorials

3 articles · page 1 of 1

Hand-written tutorials, ordered as a recommended learning path.

  1. 01 Dynamic Programming Master dynamic programming with 1D and 2D patterns, memoization vs tabulation approaches, and solutions to classic LeetCode DP problems.
  2. 02 Buy & Sell II Solve the multi-transaction stock problem with the greedy peak-valley insight: sum every positive daily delta. Includes complexity analysis and DP alternative.
  3. 03 Pascal's Triangle Build Pascal's Triangle in O(n^2) time using simple row-by-row addition. Includes a clear diagram, edge cases, and complexity analysis.