-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[2428] Hour Glass Sum #48
[2428] Hour Glass Sum #48
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.
Hey! thanks for contributing! 🙌
The solution looks good to me. I'm curious if we could reduce the N**2 computation time.
Could you add an entry in the changelog to the problem? and write a file test with a few examples? You can follow this PR #39. After that, we can merge the PR.
2428. Maximum Sum of an Hourglass | ||
|
||
You are given an m x n integer matrix grid. | ||
We define an hourglass as a part of the matrix with the following form: |
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.
Could you add an example of the matrix here? It could be with text if the original problem use images.
|
||
Note that an hourglass cannot be rotated and must be entirely contained within the matrix. | ||
Input: grid = [[6,2,1,3],[4,2,1,5],[9,2,8,7],[4,1,2,9]] | ||
Output: 30 |
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 could use an explanation of why it's 30.
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.
Update the code @ignacio-chiazzo Added as per the format in PR #39.
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.
Can you please review again?
N**2 computation time |
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.
Thanks! It looks good to me.
I left a comment on the readme, but otherwise, it looks great. #49
README.md
Outdated
@@ -79,7 +79,7 @@ To run a specific problem in your console run `node <problem_file_path>` (e.g. | |||
| [Permutations With Duplicates ](/LeetcodeProblems/Algorithms/Permutations_With_Duplicates.js) | | | | |||
| [Deletion Distance](/LeetcodeProblems/Algorithms/Deletion_Distance.js) | | | | |||
| [Award Budget Cuts](/LeetcodeProblems/Algorithms/Award_Budget_Cuts.js) | | | | |||
|
|||
| [Maximum Sum of an Hourglass](/LeetcodeProblems/Algorithms/Maximise_Hour_Glass_Sum.js) | Medium | https://leetcode.com/problems/maximum-sum-of-an-hourglass/ | |
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.
Nit: The problems are sorted by complexity, could you move this problem to the medium section? Thanks!
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.
Updated the ordering @ignacio-chiazzo
3bd0699
to
3334cb2
Compare
Thank you! |
Hi @ignacio-chiazzo your repo has the tag hacktoberfest-accepted but the hackoctober official page says otherwise[ that this repo is not registered]. Can you tell me if its accepted or not? |
Uf! I just realized that the tag was invalid. The tag is It should be fixed now. Let me know if you don't receive the count of the PR. |
Yeah ! getting the following msg thanks |
Solution for Leetcode Problem: 2428
https://leetcode.com/problems/maximum-sum-of-an-hourglass/description/
Submitting as part of hackoctober Fest. Please approve if you find it correct, it is accepted solution on leetcode #49