Skip to content

Conversation

AlvarMarkhester
Copy link

No description provided.

Copy link

@timmparsons timmparsons left a comment

Choose a reason for hiding this comment

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

Very cool solution

@Ahmad-A0
Copy link
Collaborator

Ahmad-A0 commented Jul 8, 2022

It's a very nice solution, but it will perform worse on average as creating the Set means you have to iterate through the whole of nums regardless of if you find duplicates or not. Both solutions are technically O(N) though.

@AlvarMarkhester
Copy link
Author

It's a very nice solution, but it will perform worse on average as creating the Set means you have to iterate through the whole of nums regardless of if you find duplicates or not. Both solutions are technically O(N) though.

Thanks for the feedback :)

Copy link
Collaborator

@mitchellirvin mitchellirvin left a comment

Choose a reason for hiding this comment

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

hi @AlvarMarkhester ! thanks for contributing!

I don't think we should remove the existing solution, as it is likely more intuitive for a new programmer (even though it is more verbose). simpler is not always easier to understand!

you're welcome to add your solution beneath the existing solution, though! it is very elegant

@Ahmad-A0
Copy link
Collaborator

Ahmad-A0 commented Aug 31, 2022

I'll close this as stale due to the conflicts, but if you choose to resolve them and edit your solution to meet the new guidelines, I'll merge this in.

@Ahmad-A0 Ahmad-A0 closed this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants