Dynamic Programming21 sections · 916 units
Open in Course

Section Recap

What we learned

Look at what you can do now:

1.1. Solve LIS with O(n2)O(n^2) DP using "ending at ii" states

2.2. Reduce to O(nlogn)O(n \log n) using binary search on tails array

3.3. Count the number of LIS by tracking both length and count

4.4. Reduce 2D (two-dimensional) problems to LIS (Russian Doll Envelopes) The "ending at ii" pattern is your foundation for subsequence problems. Next, you'll extend to two sequences with LCS (Longest Common Subsequence) and Edit Distance.