Question d’entretien chez Amazon

A Dynamic programming and stack problem.