Input: mat[][] = [ [0, 1, 1, 0],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 0, 0] ]
Output: 8
Explanation: The rectangle spanning from cell [1, 0]
to [2, 3]
consists of 8
ones, making it the largest possible area of a sub-matrix containing only 1’s
.
Input: mat[][] = [ [0, 1, 1],
[1, 1, 1],
[0, 1, 1] ]
Output: 6
Explanation: The rectangle spanning from cell [0, 1]
to [2, 2]
consists of 6
ones, making it the largest possible area of a sub-matrix containing only 1’s
.