LAS, Subset Sum and Knapsack

Go to:
> Material
> Lecture Recap


Material


Lecture Recap

This week we introduced three new DP problems and tried to put them into buckets based on their structure.

DP “Archetypes”

First, we divided the problems so far into three families based on their structure:

LAS, Subset Sum, Knapsack

We saw three new DP problems and analyzed them under this lense:

Finally, we solved the Partition problem and practiced how to reduce the problem to a simple subset sum, where we cleverly extract our solution. You can try your own implementation using the code and test-cases above on CodeExpert.

Like I already mentioned last week, DP takes quite some practice to get familiar with. I would recommend:

To practice DP, I can recommend the following list of LeetCode problems. If you find some time on your hands, I would already start early and for each problem briefly think it through on paper (like we did in class) and test the solution on LeetCode (you can sign up for a free account).