Flatiron Health Interview Question

Dynamic programming question. Think stock question.