随笔分类 -  dp - stock

121. 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 permitted to complete at most one transaction (i.e., buy one and sell one share of the stock),... 阅读全文

posted @ 2018-11-06 07:45 猪猪🐷

122. Best Time to Buy and Sell Stock II
摘要: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 complete as many transactions as you like (i.e., buy on... 阅读全文

posted @ 2018-11-06 07:43 猪猪🐷

123. 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 to find the maximum profit. You may comple 阅读全文

posted @ 2018-11-06 07:43 猪猪🐷

309. Best Time to Buy and Sell Stock with Cooldown
摘要: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 complete as many transactions as you like (ie, buy one ... 阅读全文

posted @ 2018-11-06 07:42 猪猪🐷

188. Best Time to Buy and Sell Stock IV
摘要: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 comple 阅读全文

posted @ 2018-11-06 07:42 猪猪🐷

714. Best Time to Buy and Sell Stock with Transaction Fee
摘要:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee. You may complete as many ... 阅读全文

posted @ 2018-11-06 07:41 猪猪🐷

Buy and Sell Stock series
摘要:121. 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 permitte 阅读全文

posted @ 2018-08-09 17:39 猪猪🐷

导航