Amazon Interview Question

One DP question and basic ML questions.