思路: 想到:prices中一列数字,任取一个为买入价格buy,在其右边任取一个为卖出价格sell;取[buy,...,sell]区间中相邻数字之差,这些差值求和为sum,则必有sell-buy = sum;本题中求最大收益,所以遍历prices,找到prices[i]-prices[i-1] > ...
分类:
其他好文 时间:
2020-04-21 23:53:32
阅读次数:
64
Last week, I bought a LAUNCH X431 idiag from autonumen.com,the customer sercie did help me a lot, because I registered but I forgot my user name, so I ...
分类:
其他好文 时间:
2020-04-16 19:34:58
阅读次数:
84
LeetCode上的卖股票题大概有6道,建议大家去看一下英文版 LeetCode上关于这类题目的讲解:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/discuss/108870/M ...
分类:
编程语言 时间:
2020-04-16 00:47:04
阅读次数:
88
"https://leetcode.com/problems/best time to buy and sell stock/" 给定一个数组,其中数组的第 i 个元素表示第 i 天的股票价格,你可以选择在其中一天买股票,然后再后面的某一天卖掉股票,求最大收益。(股票必须要先买才能卖) 这里只能买一 ...
分类:
其他好文 时间:
2020-04-06 00:26:55
阅读次数:
84
"https://leetcode.com/problems/best time to buy and sell stock ii/" 给定一个数组,其中数组的第 i 个元素表示第 i 天的股票价格,你可以选择在其中一天买股票,然后再后面的某一天卖掉股票,求最大收益。(股票必须要先买才能卖) 这里可 ...
分类:
其他好文 时间:
2020-04-06 00:10:03
阅读次数:
82
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12637178.html 买卖股票的最佳时机(13min) 题目链接:https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/ 给定一 ...
分类:
其他好文 时间:
2020-04-05 15:44:51
阅读次数:
72
一、NoSuchMethodError 因为对服务方进行了修改,没有进行install操作,导致消费方无法找到该方法。 二、Required String parameter 'id' is not present 前端使用result风格的url方式传递参数时: <a href="buy/${de ...
分类:
其他好文 时间:
2020-04-04 22:40:23
阅读次数:
77
总结一下在目前的电商系统中的商品涉及的属性spu,sku。搞清楚两者之间的关系对表的设计非常重要 spu Standard Product Unit (标准产品单位) ,一组具有共同属性的商品集 SKU Stock Keeping Unit(库存量单位),SPU商品集因具体特性不同而细分的每个商品 ...
分类:
其他好文 时间:
2020-04-03 16:27:01
阅读次数:
370
1 class Solution 2 { 3 public: 4 int maxProfit(vector<int>& prices) 5 { 6 if(prices.empty()) return 0; 7 int n = prices.size(); 8 int buy = prices[0]; ...
分类:
其他好文 时间:
2020-04-01 19:41:00
阅读次数:
61
IntegrityError: (pymysql.err.IntegrityError) (1062, "Duplicate entry '000001.SZ-2018-07-02' for key 'PRIMARY'")[SQL: INSERT INTO stock_daily_basic (ts ...
分类:
数据库 时间:
2020-04-01 10:33:38
阅读次数:
358