Pregunta de entrevista de Flatiron Health

Dynamic programming question. Think stock question.