Maximal Rectangle
Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
Maximal Rectangle

Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.

Example 1:
Input: {"matrix":[["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]}
Output: 6
Input
arr ={"matrix":[["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]}

Initialize heights array of size 6

Matrix

1

0

1

0

0

1

0

1

1

1

1

1

1

1

1

1

0

0

1

0

Heights Histogram (Row -1)
0
0
0
0
0
Max Area

0

Variables
No variables to display
DepthFunction Call
Stack empty
0/9