Meta interview question

Dynammic programming question