-
Notifications
You must be signed in to change notification settings - Fork 41
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
Liv - Space #32
base: master
Are you sure you want to change the base?
Liv - Space #32
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.
I like your solution for the Anagram problem, the solution for the k most frequent elements isn't quite working, but think about making a hash where the keys are the elements and the values are their frequencies. That might get you started here.
# Time Complexity: On | ||
# Space Complexity: On | ||
|
||
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.
Clever, I like the use of a subhash as a key.
# Time Complexity: On | ||
# Space Complexity: On | ||
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.
Not quite working as it fails for [3, 3, 3, 3, 3, 1, 1, 2, 2, 2]
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions