C++ || Based on Largest Rectangle in Histogram
\nint maxHistogram(vector<int>& heights)\n    {\n        heights.push_back(0);\n        int n = heights.size();\n        stack<int> st;\n        int res = 0;\n 
```\nint maxHistogram(vector<int>& heights)\n    {\n        heights.push_back(0);\n        int n = heights.size();\n        stack<int> st;\n        int res = 0;\n        \n        int i = 0;\n        while(i < n)\n        {\n            if(st.empty() || heights[i] >= heights[st.top()])\n              st.push(i++);\n            else\n             {\n                 int top = st.top();\n                 st.pop();\n                 res = max(res, heights[top] * (st.empty() ? i : i - st.top() - 1));\n             }\n        }\n        \n        return res;\n    }\n    \n    int maximalRectangle(vector<vector<char>>& matrix) \n    {\n        if(matrix.empty())\n            return 0;\n        \n        int m = matrix.size();\n        int n = matrix[0].size();\n        int res = 0;\n        \n        vector<int> height(n, 0);\n        \n        for(int i = 0; i < m; i++)\n        {\n            for(int j = 0; j < n; j++)\n            {\n                if(matrix[i][j] == \'1\')\n                    height[j]++;\n                else\n                    height[j] = 0;\n            }\n            \n            res = max(res, maxHistogram(height));\n        }\n        \n        return res;\n        \n    }\n```
['Stack', 'C', 'C++']