Skip to content

Sockets - Kelly#12

Open
kdow wants to merge 1 commit intoAda-C11:masterfrom
kdow:master
Open

Sockets - Kelly#12
kdow wants to merge 1 commit intoAda-C11:masterfrom
kdow:master

Conversation

@kdow
Copy link
Copy Markdown

@kdow kdow commented Apr 18, 2019

No description provided.

Copy link
Copy Markdown

@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.

Comment thread lib/array_intersection.rb
if array1 == nil || array2 == nil
return []
end
if array1.length < array2.length
Copy link
Copy Markdown

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.

Comment thread lib/array_intersection.rb
# 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)
Copy link
Copy Markdown

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