原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/ 题意: Say you have an array for which the ith element is the price of a given ...
这道题在Best Time to Buy and Sell Stock III做过,那道题只是把k取了 而已 递推式依然是 local i j max global i j max diff, ,local i j diff , global i j max local i j ,global i j 注意里面有个很大的case还是过不了,leetcode的时间设置的太紧了,同样的算法c 就可以 ...
2015-03-01 12:40 0 3181 推荐指数:
原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/ 题意: Say you have an array for which the ith element is the price of a given ...
transaction (ie, buy one and sell one share of the stock), d ...
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may ...
Best Time to Buy and Sell Stock I Say you have an array for which the ith element is the price of a given stock on day i. If you were only ...
题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may ...
LeetCode:Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only ...
Best Time to Buy and Sell Stock III Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm ...