Amazon interview question

Question with either dynamic programming or one of 15 patterns