-
Notifications
You must be signed in to change notification settings - Fork 40
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
Jessica #1
base: master
Are you sure you want to change the base?
Jessica #1
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.
Nice work, your Sudoku method could use a bit of drying up, but it all works. You even did the kth common elements as well. Nice work.
Take a look at my comments and let me know what questions you have.
# Time Complexity: ? | ||
# Space Complexity: ? | ||
|
||
# Time Complexity: O(n logn) where n is the length of the strings in the strings element |
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 would say that it's O(n) where n is the number of strings if the length of any particular string is pretty small.
It's O(n m log m) where n is the number of strings and m is the average length of any particular string, if the strings can be arbitrarily large.
# Time Complexity: ? | ||
# Space Complexity: ? | ||
# Time Complexity: O(n) where n is the length of list | ||
# Space Complexity: O(n) where n is the length of the list | ||
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.
👍
second_subgrid = {} | ||
third_subgrid = {} | ||
|
||
table[0..2].each do |row| |
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 looks pretty repetitive, could you instead create a method to do this on different subgrids?
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions