美文网首页
Best Time to Buy and Sell Stock

Best Time to Buy and Sell Stock

作者: nickhuang | 来源:发表于2014-11-04 03:20 被阅读0次

Say you have an array for which the ith 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

      本文链接:https://www.haomeiwen.com/subject/eufjtttx.html