Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
yanglbme merged 10 commits into doocs:master from KongJHong:master
Nov 12, 2018
Merged

Add Solution 123[CPP] #99

yanglbme merged 10 commits into doocs:master from KongJHong:master
Nov 12, 2018

Conversation

@KongJHong
Copy link
Contributor

@KongJHong KongJHong commented Nov 7, 2018

改了名字,github没有自动merge

@yanglbme yanglbme added the conflict This branch has conflicts that must be resolved label Nov 7, 2018
Copy link
Contributor Author

更正

Copy link
Contributor Author

更正上传

Copy link
Member

yanglbme commented Nov 8, 2018

@KongJHong 0008.String to Integer (atoi)/Solution.java
0008 文件夹已存在,别重复上传,请注意文件夹的空格,谢谢了。

否则 merge 之后会有两个同名文件夹(一个带空格,一个不带空格)

Copy link
Member

yanglbme commented Nov 8, 2018

提交文件时细心一点哈,不然的话 merge 之后很乱的,希望老哥能理解,维护一个仓库不容易。

@yanglbme yanglbme added the invalid This doesn't seem right label Nov 8, 2018
Copy link
Member

yanglbme commented Nov 9, 2018

@KongJHong
老哥做题都不按照要求来的吗>_<?
有小伙伴反馈第 41 题复杂度问题,题目限制 O(n),你 sort 一下复杂度就到 O(nlogn) 了噢~

-------------
### 思路:

#### 错误的思路
Copy link
Member

@yanglbme yanglbme Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要把错误的思路也提交上来哈,容易引导别人往错误的方向思考。

解释: 在这个情况下, 没有交易完成, 所以最大利润为 0。
```
-------------
### 思路:
Copy link
Member

@yanglbme yanglbme Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REAMDE 文件都按统一的规范来吧,参照我前面的提交。

我真的很看重仓库/文档的规范性与统一性。

Copy link
Contributor Author

KongJHong commented Nov 9, 2018 via email

假设它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.

Copy link
Contributor Author

KongJHong commented Nov 9, 2018 via email

给自己做文档记录的时候习惯了,我修改修改吧 发件人: 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.

Copy link
Contributor Author

更正提交

@yanglbme yanglbme merged commit 2850eca into doocs:master Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yanglbme yanglbme yanglbme left review comments

Labels

conflict This branch has conflicts that must be resolved invalid This doesn't seem right

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /