Problem: https://cses.fi/problemset/task/1633
Start with a brute-force exponential time solution.
Apply memoization.
Polynomial running time! (linear, for this problem)
I also explain "bottom-up" dynamic programming (as opposed to "top-down", which is memoization).