Skip to content
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

Sockets - Kelly #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Sockets - Kelly #12

wants to merge 1 commit into from

Conversation

kdow
Copy link

@kdow kdow commented Apr 18, 2019

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

You have a pretty good solution here, nice use of the hash table. Well done.

if array1 == nil || array2 == nil
return []
end
if array1.length < array2.length

Choose a reason for hiding this comment

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

It doesn't really matter which array you put into the hash table since you have to go through both. So this if statement is a bit wasted.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n + m) where n is the number of items of one array and m is the number of items in the other
# Space complexity: O(n)

Choose a reason for hiding this comment

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

👍

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.

2 participants