Dynamic Programming21 sections · 916 units
Open in Course

Section Recap

What we learned

You learned monotonic queue improvement for DP:

1.1. Recognize sliding window min/max in DP transitions.

2.2. Use decreasing deque for max, increasing deque for min.

3.3. Remove expired indices from front, dominated indices from back.

4.4. Each element enters and exits once, giving O(n)O(n) total time. You solved four problems: Sliding Window Maximum (foundation), Jump Game VI (basic DP), Constrained Subsequence Sum (optional inclusion), and Shortest Subarray (prefix sums). You now have a effective O(nk)O(n)O(nk) \to O(n) improvement technique.