Easiest solution, build on top of leetcode84
\npublic int maximalRectangle(char[][] matrix) {\n        if(matrix.length==0) return 0;\n        // for each cell with value=1, we look upward (north), the num
```\npublic int maximalRectangle(char[][] matrix) {\n        if(matrix.length==0) return 0;\n        // for each cell with value=1, we look upward (north), the number of continuous \'1\' is the height of cell\n        int[] heights = new int[matrix[0].length];\n        int maxArea=-1;\n        for(int i=0; i<matrix.length; i++){\n            for(int j=0; j<matrix[0].length; j++){\n                if(matrix[i][j]==\'0\'){\n                    heights[j] = 0;\n                } else {\n                    heights[j] ++;\n                }\n            }            \n            int area = yourLeetCode84Method(heights);\n            maxArea = Math.max(maxArea, area);\n        }\n        return maxArea;\n    }\n```
[]