-
Notifications
You must be signed in to change notification settings - Fork 39
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
Earth - Jasmine #19
base: master
Are you sure you want to change the base?
Earth - Jasmine #19
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.
Really nice work Jasmine, you hit everything here. Well done!
# Time Complexity: O(n * klog(k)) where n is the number of strings and k is the length of each string. | ||
# Space Complexity: O(n) - using hash to store each word. | ||
# Does having an array as a key increase the space complexity? | ||
|
||
def grouped_anagrams(strings) |
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.
👍
# Time Complexity: O(nlog(n)) - due to using sort_by | ||
# Space Complexity: O(n) - hash could potentially hold n unique values. | ||
def top_k_frequent_elements(list, k) |
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.
👍 Very compact and yet readable.
# Time Complexity: O(1) because the grid is a fixed size. | ||
# Space Complexity: O(1) even though we're using multiple hashes it's O(1) because the grid is a fixed size | ||
def valid_sudoku(table) |
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.
👍
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions