-
Notifications
You must be signed in to change notification settings - Fork 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
Branches - Brianna #5
base: master
Are you sure you want to change the base?
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.
Great work Brianna, you hit all the learning goals and got the optional as well. Excellent work.
// Time Complexity: O(n * m log m) - N: number of strings passed in; M: sorting time of each string | ||
// Space Complexity: O(n * m) - N: number of unique letter sets; M: number of total arrays stored | ||
function 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 work!
// Time Complexity: O(n + m) -> O(n) - N: length of list; m: unique numbers | ||
// Space Complexity: O(m) m: unique numbers entered in hash | ||
function 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.
👍 Nice work!
|
||
|
||
// console.log(grouped_anagrams(["eat", "tea", "tan", "ate", "nat", "bat"])); | ||
// console.log(grouped_anagrams([])); | ||
// console.log(grouped_anagrams(["eat", "ear", "tar", "pop", "pan", "pap"])); | ||
// console.log(grouped_anagrams(["eat", "tae", "tea", "eta", "aet", "ate"])); | ||
// console.log(grouped_anagrams(["tea","","eat","","tea",""])); | ||
// console.log(top_k_frequent_elements([1,1,1,2,2,3], 2)) | ||
// console.log(top_k_frequent_elements([], 1)) | ||
console.log(valid_sudoku([ | ||
[".","8","7","6","5","4","3","2","1"], | ||
["2",".",".",".",".",".",".",".","."], | ||
["3",".",".",".",".",".",".",".","."], | ||
["4",".",".",".",".",".",".",".","."], | ||
["5",".",".",".",".",".",".",".","."], | ||
["6",".",".",".",".",".",".",".","."], | ||
["7",".",".",".",".",".",".",".","."], | ||
["8",".",".",".",".",".",".",".","."], | ||
["9",".",".",".",".",".",".",".","."]])) |
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.
You can leave this out of a submission.
// Time Complexity: ? | ||
// Time Complexity: O(n*m) - n: rows in sudoku table; m: columns in sudoku table | ||
// Space Complexity: ? | ||
|
||
function 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.
Really elegant solution! 👍
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions