Algorithms 101: best time to buy and sell stock in JavaScript