-
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
Water - Li #15
base: master
Are you sure you want to change the base?
Water - Li #15
Conversation
Just realized I never submitted it on learn, sorry! |
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 Li, you hit the learning goals here. Well done.
# n => number of strings, m => largest number of characters of a string | ||
# Time Complexity: n * mlog(m) (sorting n strings: n * mlog(m); lookup, push, assign: O(1), iterating o(n)) | ||
# Space Complexity: n * m (worst case has to create a new array/key for each string, and takes m space to sort it) | ||
|
||
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.
👍 Nice
# Time Complexity: Olog(n) for sorting | ||
# Space Complexity: o(n) | ||
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.
👍
# Time Complexity: O(1) fixed grid | ||
# Space Complexity: O(1) | ||
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.
👍 This works, but you can also do this with helper methods.
Well done
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions