Skip to content
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

Maximum Size Rectange #253

Open
vish-han opened this issue Oct 5, 2021 · 14 comments
Open

Maximum Size Rectange #253

vish-han opened this issue Oct 5, 2021 · 14 comments
Labels
appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 4 40 Points Question Add a question

Comments

@vish-han
Copy link
Contributor

vish-han commented Oct 5, 2021

Enter your question -

Given a binary matrix M of size n X m. Find the maximum area of a rectangle formed only of 1s in the given matrix.

Enter link to the question(if question belongs to any online platform) -

NA

Tags for the question(eg - Array, Basic, Stack, etc.) -

Matrix ,2D Array

@vish-han
Copy link
Contributor Author

vish-han commented Oct 5, 2021

@SarthakKeshari please assign this issue to me..

@SarthakKeshari
Copy link
Owner

@vish-han,
I wish to add to this question. May I?

@vish-han
Copy link
Contributor Author

vish-han commented Oct 5, 2021

No problem go ahead

@SarthakKeshari
Copy link
Owner

SarthakKeshari commented Oct 5, 2021

@vish-han,
Question updated

Enter your question -

Given a binary matrix M of size n X m. Find the area of a rectangle formed only of 1s in the given matrix and area of a rectangle formed only of 0s in the given matrix. Print the maximum one between the two along with the co-ordinates(top-left, top-right, bottom-left, bottom-right) of the maximum area rectangle.

In case of equal area go with anyone.

Sample Test case
Input -
5
6
1 1 1 1 1 1
1 1 0 0 0 0
1 1 0 0 0 0
1 1 0 0 0 0
1 1 0 0 0 0

Output -
Maximum area is formed by 0's and is 4x4 = 16
Top-left: 1, 2
Top-right: 1, 5
Bottom-left: 4, 2
Bottom-right: 4, 5

Ouput should have the exact format as presented above

Enter link to the question(if question belongs to any online platform) -

NA

Tags for the question(eg - Array, Basic, Stack, etc.) -

Matrix ,2D Array

@SarthakKeshari
Copy link
Owner

@vish-han,
Kindly add your solution to "Arrays/2D Arrays" folder.
Also mention "(admin_choice)" in filename and PR title.
Deadline - 07/10/2021

@SarthakKeshari SarthakKeshari added appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 4 40 Points Question Add a question labels Oct 5, 2021
@vish-han
Copy link
Contributor Author

vish-han commented Oct 6, 2021

@SarthakKeshari CAN U PLEASE ASSIGN THISISSSUE TO SOMEONE ELSE, IM UNABLE TO SOLVE THIS QUESTION?

@SarthakKeshari
Copy link
Owner

Do you wish to leave this issue?

@vish-han
Copy link
Contributor Author

vish-han commented Oct 6, 2021

Yess

@SarthakKeshari
Copy link
Owner

Done

Yess

@Harsh-bartariya
Copy link
Contributor

Kindly assign me this issue sir...i think i can solve it.
But can you please clarify me how you count the top left-top right co-ordinates....this is the only part i'm unable to understand.
please clarify it to me once so that i can make a contribution.

@SarthakKeshari
Copy link
Owner

@Harsh-bartariya,
Example -
1 2 3
4 5 6
7 8 9

So here,
cell no. 1 will form top-left, co-ordinates (0,0)
cell no. 3 will form top-right, co-ordinates (0,2)
cell no. 7 will form bottom-left, co-ordinates (2,0)
cell no. 9 will form bottom-right, co-ordinates (2,2)

@Harsh-bartariya
Copy link
Contributor

okk sir thank you...i will work on that

@SarthakKeshari
Copy link
Owner

@Harsh-bartariya,
Kindly add your solution to "Arrays/2D Arrays" folder.
Also mention "(admin-choice)" word in your filename and PR title.
Deadline - 09/10/2021

@GayatriChaudhari1281
Copy link
Contributor

Please assign this issue to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appreciation Extra value question for contributors hacktoberfest Under Hacktoberfest 2021 Level 4 40 Points Question Add a question
Projects
None yet
Development

No branches or pull requests

4 participants