LeetCode – Maximal Rectangle (Java)

Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and return its area. Analysis This problem can be converted to the “Largest Rectangle in Histogram” problem. Java Solution public int maximalRectangle(char[][] matrix) { int m = matrix.length; int n = m == 0 ? 0 : matrix[0].length; … Read more