Citadel interview question

Dynamic Programming. Like the ones on Leetcode