fix bug about best time to buy and sell stock