-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Add Solution 123[CPP] #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
更正 |
更正上传 |
@KongJHong 0008.String to Integer (atoi)/Solution.java 否则 |
提交文件时细心一点哈,不然的话 |
@KongJHong |
------------- | ||
### 思路: | ||
|
||
#### 错误的思路 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要把错误的思路也提交上来哈,容易引导别人往错误的方向思考。
解释: 在这个情况下, 没有交易完成, 所以最大利润为 0。 | ||
``` | ||
------------- | ||
### 思路: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REAMDE
文件都按统一的规范来吧,参照我前面的提交。
我真的很看重仓库/文档的规范性与统一性。
假设它sort排序用的是n的复杂度,下面的while循环也就n,一共2n复杂度,不就是O(n)的关系吗?怎么就乘起来了?没有循环嵌套啊
发件人: Libin Yang
发送时间: 2018年11月9日 20:58
收件人: doocs/leetcode
抄送: KongJHong; Mention
主题: Re: [doocs/leetcode] Add Solution 123[CPP] (#99)
@KongJHong
老哥做题都不按照要求来的吗>_<?
有小伙伴反馈第 41 题复杂度问题,题目限制 O(n),你 sort 一下复杂度就到 O(nlogn) 了噢~
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
给自己做文档记录的时候习惯了,我修改修改吧
发件人: Libin Yang
发送时间: 2018年11月9日 21:04
收件人: doocs/leetcode
抄送: KongJHong; Mention
主题: Re: [doocs/leetcode] Add Solution 123[CPP] (#99)
@yanglbme commented on this pull request.
In solution/0123.Best Time to Buy and Sell Stock III/README.md:
+输入: [1,2,3,4,5]
+输出: 4
+解释: 在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5-1 = 4 。
+ 注意你不能在第 1 天和第 2 天接连购买股票,之后再将它们卖出。
+ 因为这样属于同时参与了多笔交易,你必须在再次购买前出售掉之前的股票。
+```
+示例 3:
+```
+输入: [7,6,4,3,1]
+输出: 0
+解释: 在这个情况下, 没有交易完成, 所以最大利润为 0。
+```
+-------------
+### 思路:
+
+#### 错误的思路
不要把错误的思路也提交上来哈,容易引导别人往错误的方向思考。
In solution/0123.Best Time to Buy and Sell Stock III/README.md:
+示例 2:
+```
+输入: [1,2,3,4,5]
+输出: 4
+解释: 在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5-1 = 4 。
+ 注意你不能在第 1 天和第 2 天接连购买股票,之后再将它们卖出。
+ 因为这样属于同时参与了多笔交易,你必须在再次购买前出售掉之前的股票。
+```
+示例 3:
+```
+输入: [7,6,4,3,1]
+输出: 0
+解释: 在这个情况下, 没有交易完成, 所以最大利润为 0。
+```
+-------------
+### 思路:
REAMDE 文件都按统一的规范来吧,参照我前面的提交。
我真的很看重仓库/文档的规范性与统一性。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
更正提交 |
改了名字,github没有自动merge