Super Similar problem like Histogram
https://leetcode.com/problems/maximal-rectangle/discuss/3544364/Super-Similar-problem-like-Histogram-------------------------->Histogram problem\n# Similar to H
https://leetcode.com/problems/maximal-rectangle/discuss/3544364/Super-Similar-problem-like-Histogram-------------------------->Histogram problem\n# Similar to Histogram Problem\n```\nclass Solution:\n    def maximalRectangle(self, matrix: List[List[str]]) -> int:\n        if not matrix:\n            return 0\n        maxarea=0\n        height=[0]*(len(matrix[0]))\n        for i in range(len(matrix)):\n            for j in range(len(matrix[0])):\n                if matrix[i][j]=="1":\n                    height[j]+=1\n                else:\n                    height[j]=0\n\t\t\t\tstack=[]\n            for i,h in enumerate(height):\n                start=i\n                while stack and h<stack[-1][1]:\n                    index,hi=stack.pop()\n                    start=index\n                    maxarea=max(maxarea,(i-index)*hi)\n                stack.append([start,h])\n            for i,h in stack:\n                maxarea=max(maxarea,(len(height)-i)*h)\n        return maxarea\n  ```\n  # please upvote me it would encourage me alot\n
['Stack', 'Python3']