matrix is a grid of 0s and 1s. Return the area of the largest rectangle made only of 1s.
For [[1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 1, 1, 1, 1], [1, 0, 0, 1, 0]] the answer is 6.
Example 1
Input:
maximal_rectangle([[1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 1, 1, 1, 1], [1, 0, 0, 1, 0]])
Output:
6
Example 2
Input:
maximal_rectangle([[0]])
Output:
0
0 <= rows, cols <= 4000 or 1.No results yet
Run your code to check it against the examples, or submit to run every test.