Stock Buy/Sell


You are given one day's worth of the price of one stock. That is, let's say you have the following:

9:00 am: $10

12:00 pm: $12

3:00 pm: $9

6:00 pm: $14

Write a function that returns the optimum time to buy and sell this stock on this day.


Answer