Easy C++ soln based on Largest Histogram
\nclass Solution {\npublic:\n    \n    int largestArea(vector<int>& histogram){\n        int n=histogram.size(), area=0;\n        stack<int> s;\n        \n     
```\nclass Solution {\npublic:\n    \n    int largestArea(vector<int>& histogram){\n        int n=histogram.size(), area=0;\n        stack<int> s;\n        \n        for(int i=0; i<n; i++){\n            while(!s.empty() && histogram[s.top()]>=histogram[i]){\n                int top = s.top();\n                s.pop();\n                \n                int start;\n                if(s.empty())\n                    start = -1;\n                else\n                    start = s.top();\n                    \n                \n                int curr_area = histogram[top] * (i - start -1);\n                area = max(area, curr_area);\n            }\n            s.push(i);\n        }\n        \n        while(!s.empty()){\n            int top = s.top();\n            s.pop();\n\n            int start;\n            if(s.empty())\n                start = -1;\n            else\n                start = s.top();\n            \n            int curr_area = histogram[top] * (n - start -1);\n            area = max(area, curr_area);\n        }\n        \n        return area;\n    }\n    \n    int maximalRectangle(vector<vector<char>>& matrix) {\n        int m=matrix.size();\n        if(m==0) return 0;\n        int n=matrix[0].size(), result=0;\n        vector<int> histogram(n, 0);\n        \n        for(int i=0; i<m; i++){\n            for(int j=0; j<n; j++){\n                if(matrix[i][j]==\'1\')\n                    histogram[j]+=1;\n                else\n                    histogram[j]=0;\n            }\n            \n            result = max(result, largestArea(histogram));\n            cout<<result<<" ";\n        }\n        return result;\n    }\n};\n\n/*\n\n2 0 2 1 1 \n\n3 1 3 2 2 \n\n\nAlgorithm Outline:\nlargestArea()\n\n        |\n    |   |       |\n|   |   |   |   |\n\n1   2   3   1   2   -> 5\n0   1   2   3   4   -> index\n\n1. stack\n2. iterate, check when value is less that top\n3. While less than top, area = height of bar * distance from i (anchor)\n4. Add to stack\n5. Check while stack not empty\n6. Return max_area\n\nmain()\n1. Calculate histogra array for each row\n2. Check largest area in that row\n3. Return ans\n\n\nHorizontal - can check length\nVerticle - Keep height of each column top to bottum\n\ncalculate area for each histogram in each row \n\n1 0 1 0 0   -> 1\n1 0 1 1 1   -> 3\n1 1 1 1 1   -> 6\n1 0 1 1 1\n\n*/\n```\nI appreciate your upvote !!
['Stack', 'C', 'C++']