Easy C++ solution || commented
\nclass Solution {\npublic:\n    int largestSubmatrix(vector<vector<int>>& matrix) {\n        \n        //for every column keep a track of number of consecutive
```\nclass Solution {\npublic:\n    int largestSubmatrix(vector<vector<int>>& matrix) {\n        \n        //for every column keep a track of number of consecutive ones upto the index\n        int m=matrix.size();\n        int n=matrix[0].size();\n        for(int j=0;j<n;j++)\n        {\n            for(int i=0;i<m;i++)\n            {\n                if(matrix[i][j]==1)\n                {\n                    matrix[i][j]+=(i > 0 ) ? matrix[i-1][j] : 0;\n                }\n            }\n        }\n        \n        //now for every row sort the values in reverse order(non increasing order)\n        int res=INT_MIN;\n        for(int i=0;i<m;i++)\n        {\n            sort(matrix[i].rbegin(),matrix[i].rend());\n            \n            //the problem can be now assumed as to find the  maximum rectangle  area from the histogram\n            int currRes=INT_MIN;\n            for(int j=0;j<n;j++)\n            {\n                currRes=max(currRes,matrix[i][j] * (j+1));\n            }\n            res=max(res,currRes);\n            \n        }\n        return res;\n    }\n};\n```\n**Upvote if this helps you:)**
['C']