Pregunta de entrevista de Arcesium

Dynamic programming question. (Stock prices in a week)