Epic interview question

Q: General Leetcode question (dynamic programming)