cpp implemenataion of best_time_to_buy_and_sell_stock_ii