Java-Questions-and-Solutions
Java-Questions-and-Solutions copied to clipboard
Maximum Size Rectange
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
@SarthakKeshari please assign this issue to me..
@vish-han, I wish to add to this question. May I?
No problem go ahead
@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
@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 CAN U PLEASE ASSIGN THISISSSUE TO SOMEONE ELSE, IM UNABLE TO SOLVE THIS QUESTION?
Do you wish to leave this issue?
Yess
Done
Yess
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.
@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)
okk sir thank you...i will work on that
@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
Please assign this issue to me.