๐๏ธ The Map of Dynamic Programming: A First-Principles Breakdown
The Real Problem: DP doesn't feel like one techniqueโit feels like a zoo of unrelated tricks. "Unique Paths" and "0/1 Knapsack" seem to have nothing in common. How do you learn something that appears endless?
๐๏ธ Pattern 1: Linear Sequence
4 items
๐๏ธ Pattern 2: Grid Traversal
8 items
๐๏ธ Pattern 3: Bounded Knapsack
4 items
๐๏ธ Pattern 4: Interval DP Problems
The Range Merging Pattern: State is dpi = answer for range/substring [i...j]. Build from small intervals to large. Try all split points k between i and j.
๐๏ธ Pattern 5: State Machine DP Problems
The Mode Transition Pattern: At each position i, track different states/modes. Transitions between states have costs/constraints. State represents "what mode/condition am I in?"
๐๏ธ Pattern 6: DP on Trees Problems
The Hierarchical Pattern: State is dpnode] or dp[node = answer for subtree rooted at node. DFS/post-order traversal to combine children's solutions.
๐๏ธ Pattern 7: Bitmask & Digit DP
The Pattern
๐๏ธ Part 1: The Dialogue of Dynamic Programming
A Socratic Journey between the Philosopher and the Seeker
๐๏ธ Part 2: The Coder's Mind - Building the Solution
From understanding to implementation in Java
๐๏ธ Part 3: The Crucial Distinction - Paths vs States
Understanding the true power of Dynamic Programming
๐๏ธ Part 4: Similar Problems - Applying the Pattern
Five LeetCode problems that reinforce the same DP concepts
๐๏ธ Part 5: The Essential 10 - Mastering DP for Big Tech
The canonical foundation for Dynamic Programming interview preparation
๐๏ธ House Robber
2 items
๐๏ธ Unique Paths: The Designer's Journey from Confusion to Clarity
LeetCode 62 - Understanding DP through path counting logic
๐๏ธ Longest Common Subsequence: From First Principles
Learning Philosophy: This document teaches you how to think about DP problems, not just memorize solutions. We'll build intuition layer by layer, questioning every assumption.
๐๏ธ The 0/1 Knapsack: The Designer's Journey
From Intuition to Implementation: This document traces the natural thought process from your initial recursive insight to discovering why the DP table needs TWO dimensions.
๐๏ธ Burst Balloons: The Paradigm Shift
When Your Correct Intuition Can't Be Memoized: This problem teaches you that sometimes the "obvious" recursive solution, while correct, needs a complete paradigm shift to become DP-able.