Conversation
shaowenliu
reviewed
Jan 12, 2017
| print 0 | ||
| else: | ||
| for num in numbers: | ||
| if num +1 < tot and num+1 not in numbers: |
Contributor
There was a problem hiding this comment.
'num + 1 not in numbers is O(n), and you put it in the for loop, together it's O(n square) complexity?
Contributor
|
Contributor
Author
|
I am still learning python. :)
…On Fri, Jan 13, 2017 at 12:09 PM, Manuel Meraz ***@***.***> wrote:
@slansford <https://github.com/slansford>
- *Code Correctness*
Your challenge 7 solution needs to be worked on. I think it's just a
misunderstanding of how the statement if i in list works. To confirm
whether something is in a list this statement will iterate through your
list until it finds the number, then check the next number and iterate
through the list again, until the first for loop finishes. In a sense you
have 2 nested for loops each dependent on the length of the input to find
the missing number making this O(N^2). See if you can improve on this
algorithm.
- *Code Style*
- *Code Documentation*
- *Path Structure*
- *Merge Pull Request*
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#386 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXw4VCsXbk-NREaqykuNytk6eaZ6FZZxks5rRxwtgaJpZM4LhuB6>
.
|
Contributor
|
@py2k5 We can help you in the slack chat if you'd like or I can give you some hints here as well on how to improve. I'd also recommend looking at some of the other python solutions for this challenge. |
Contributor
Author
|
sure in fact I wll be glad. let me know when we can get into a call.
…On Jan 13, 2017 8:06 PM, "Manuel Meraz" ***@***.***> wrote:
@py2k5 <https://github.com/py2k5> We can help you in the slack chat if
you'd like or I can give you some hints here as well on how to improve. I'd
also recommend looking at some of the other python solutions for this
challenge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXw4VAh06fCu5Wjik5hsxXx3a8mtgMhAks5rR4wFgaJpZM4LhuB6>
.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.