【LeetCode从零单排】No121Best Time to Buy and Sell Stock

Say you have an array for which theithelement is the price of a given stock on dayi.

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.

又是时间复杂度,离真相就差一行代码。。。还是没想出来,,看了discuss才知道答案。

陪我们走过一段别人无法替代的记忆。

【LeetCode从零单排】No121Best Time to Buy and Sell Stock

相关文章:

你感兴趣的文章:

标签云: