Pergunta de entrevista da empresa Amazon

The first problem was a manifestation of the knapsack problem