Open
Conversation
CheezItMan
reviewed
Sep 18, 2019
CheezItMan
left a comment
There was a problem hiding this comment.
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) |
| # Space Complexity: ? | ||
| # Time Complexity: O(n) | ||
| # Space Complexity: O(n) | ||
| def top_k_frequent_elements(list, k) |
| # 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: ? |
| # 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.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions