Skip to content

Conversation

@piffer59
Copy link

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.

This is a solid brute-force solution. However you could get it down to an O(n + m) time complexity using a hash. I encourage you to give it a try.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n*m), where n is the length of array1 and m is the length or array2
# Space complexity: O(n), where n is the number of elements in the intersection array

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