the solution of Best Time to Buy and Sell Stock ii