Max Area Rectangle in Binary Matrix
Hard

Problem Statement

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

Examples

1Example 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
2Example 2
Input:
{ "matrix": [ [ "0" ] ] }
Output:
0
3Example 3
Input:
{ "matrix": [ [ "1" ] ] }
Output:
1
Loading...

Sign in to Run Code and Submit