30:00
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.
rows==matrix.length\text{rows} == \text{matrix.length}rows==matrix.length
cols==matrix[i].length\text{cols} == \text{matrix}[i].\text{length}cols==matrix[i].length
1≤rows,cols≤2001 \leq \text{rows}, \text{cols} \leq 2001≤rows,cols≤200
matrix[i][j]\text{matrix}[i][j]matrix[i][j] is '0' or '1'.
'0'
'1'
Initialize heights array of size 6
1
0