-
Notifications
You must be signed in to change notification settings - Fork 47
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
Time - Angela #34
base: master
Are you sure you want to change the base?
Time - Angela #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outstanding work, you hit all the learning goals here. Well done.
Take a look at my comments and let me know if you have any questions.
#Time complexity: O(n), worse case scenario we iterate over every item in both lists | ||
#Space complexity: O(n), creating a new hash and a new array | ||
def intersection(list1, list2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 And correct time/space complexity
# Time: O(n), we iterate over the string once and over our hash once | ||
# Space: O(n), worse case scenario we create a new hash collection that's as "large" as our string | ||
|
||
def palindrome_permutation?(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nicely done.
# Accepts two strings as arguments and checks if they're permutations of each other. | ||
# Permutations share the same letter counts between each other. | ||
# Time: O(n), we iterate through three different collections of fixed size | ||
# Space: O(n), we create a new hash | ||
|
||
|
||
def permutations?(string1, string2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice work!
No description provided.