Arcesium Interview Question

Dynamic programming question. (Stock prices in a week)