Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[2428] Hour Glass Sum#48

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

chhavibansal
Copy link
Contributor

@chhavibansalchhavibansal commentedOct 2, 2022
edited by ignacio-chiazzo
Loading

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

Copy link
Owner

@ignacio-chiazzoignacio-chiazzo left a 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:

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

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.

Copy link
ContributorAuthor

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.

Copy link
ContributorAuthor

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?

@chhavibansal
Copy link
ContributorAuthor

N**2 computation time
For the computation time, this is the best computation time for this problem, verified with Leetcode discuss panel as well.

Copy link
Owner

@ignacio-chiazzoignacio-chiazzo left a comment
edited
Loading

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/ |
Copy link
Owner

@ignacio-chiazzoignacio-chiazzoOct 2, 2022
edited
Loading

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!

Copy link
ContributorAuthor

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

@ignacio-chiazzo
Copy link
Owner

Thank you!

@ignacio-chiazzoignacio-chiazzo merged commit675f694 intoignacio-chiazzo:masterOct 2, 2022
@chhavibansal
Copy link
ContributorAuthor

Hi@ignacio-chiazzo your repo has the taghacktoberfest-accepted but the hackoctober official page says otherwise[ that this repo is not registered]. Can you tell me if its accepted or not?

@ignacio-chiazzo
Copy link
Owner

Uf! I just realized that the tag was invalid. The tag ishacktoberfest-accepted

It should be fixed now. Let me know if you don't receive the count of the PR.

@chhavibansal
Copy link
ContributorAuthor

Yeah ! getting the following msg
AWESOME! YOUR PR/MR HAS BEEN ACCEPTED BY A MAINTAINER AND IS NOW IN A SEVEN-DAY REVIEW PERIOD. NO ACTION IS NEEDED, AND ASSUMING YOUR PR/MR IS STILL ACCEPTED AFTER SEVEN DAYS IT WILL COUNT TOWARDS YOUR PARTICIPATION IN HACKTOBERFEST!

thanks

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ignacio-chiazzoignacio-chiazzoignacio-chiazzo approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@chhavibansal@ignacio-chiazzo

[8]ページ先頭

©2009-2025 Movatter.jp