Question d’entretien chez Amazon

Question related to Dynamic Programming which was HARD difficulty