# Speculating Prices

You intend to advance your career as a car dealer. However, as of right now, you just have a room in your garage for exactly one car.

Now, you want to make the maximum profit in a period of ten days by buying and selling a new model at the market. Your assistant has predicted that the market price of the car shall vary as follows:

 Day 1 2 3 4 5 6 7 8 9 10 Price 11 7 10 9 13 14 10 15 12 10

What is the maximum profit you can make?


Details and Assumptions:

• There is no other hidden cost than the market prices listed above.
• You can only buy and sell at the market prices. The difference is the profit.
• You can hold at most one car in the garage at a time.
• You can perform at most one transaction in one day.

×