Dynamic Programming21 sections · 916 units
Open in Course

Section Recap

What you learned and what comes next

You made it through 1D DP. That is a real skill. You solved House Robber, Boredom, Consecutive Subsequence, and Sending a Sequence Over the Network.

Along the way, you learned to define states as "best answer for prefix of size ii" or "best answer ending at value xx". You wrote transitions that combine earlier states. You handled base cases.

You also saw when to use arrays versus maps. When values are bounded, arrays work. When values are huge (like 10910^9), use maps.

For reconstruction, you learned to track prev[i] and last_pos[v]. These let you rebuild the actual solution, not just its value. Practice these skills on new problems. The pattern becomes second nature.