-
Notifications
You must be signed in to change notification settings - Fork 40
Amy M. #8
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
base: master
Are you sure you want to change the base?
Amy M. #8
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 nicely done. You got all the methods and hit all the learning goals here. Well done. One question: What is the Big-O of your Sudoku method?
# Each subarray will have strings which are anagrams of each other | ||
# Time Complexity: ? | ||
# Space Complexity: ? | ||
# Time Complexity: O(n) |
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.
Where the words are small, yes.
# Space Complexity: ? | ||
# Time Complexity: O(n) | ||
# 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.
👍
# The same digit cannot appear twice or more in the same | ||
# The same digit cannot appear twice or more in the same | ||
# row, column or 3x3 subgrid | ||
# Time Complexity: ? |
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.
No answers here?
# creates subsections | ||
def create_sub_sections(table) | ||
# code snippet from https://stackoverflow.com/questions/41020695/how-do-i-split-a-9x9-array-into-9-3x3-components | ||
table.each_slice(3).map { |row| row.transpose.each_slice(3).map { |section| section.transpose } }.flatten(1) |
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 slick! I'm glad you cited where you got this.
# Space Complexity: ? | ||
|
||
# returns a hash of a valid sudoku row | ||
def get_valid_sudoku |
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 did the same thing
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions