Problem
Given a grid matrix filled with the characters "0" and "1", return the area of the largest rectangle containing only `"1"`s. The rectangle's sides follow the grid lines.
Example 1
matrix = [
Example 2
["1","0","1","0","0"],
Example 3
["1","0","1","1","1"],
Example 4
["1","1","1","1","1"],
Example 5
["1","0","0","1","0"],
Example 6
]
Example 7
→ 6 (rows 1 and 2, columns 2 to 4)
Example 8
- Input
- matrix = [["0"]]
- Output
- 0
Example 9
- Input
- matrix = [["1"]]
- Output
- 1
Constraints
rows == matrix.length, cols == matrix[i].length1 <= rows, cols <= 200matrix[i][j] is "0" or "1".