Say you have an array for which the i-th element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the
stock), design an algorithm to find the maximum profit.
Best Time to Buy and Sell Stock
股票买卖最佳时机算法
最新推荐文章于 2025-04-18 22:24:21 发布
本文探讨了一种算法设计,该算法旨在找出股票交易中能够获取最大利润的最佳买卖时机,假设只能进行一次买入和一次卖出操作。
679

被折叠的 条评论
为什么被折叠?



