C++|| Implementation || DP used
\nclass Solution {\npublic:\n    int largestSubmatrix(vector<vector<int>>& matrix) {\n        int i,j,k,n,m,ct=0,ans=0;\n        n=matrix.size();m=matrix[0].siz
```\nclass Solution {\npublic:\n    int largestSubmatrix(vector<vector<int>>& matrix) {\n        int i,j,k,n,m,ct=0,ans=0;\n        n=matrix.size();m=matrix[0].size();\n        int dp[n+5][m+5];\n        for(j=0;j<m;j++){\n            int flag=0,ct=0;\n            for(i=n-1;i>=0;i--){\n                if(matrix[i][j]==0) {\n                    dp[i][j]=0;\n                    ct=0;\n                    flag=0;\n                }\n                else{\n                    ct++;\n                    dp[i][j]=ct;\n                    flag=1;\n                }\n            }\n        }\n        for(i=0;i<n;i++){\n            multiset<int> dict;\n            for(j=0;j<m;j++) dict.insert(dp[i][j]);\n            auto it=dict.end();\n            it--;int flag=1;ct=0;int val=1e9;\n            while(flag==1){\n                ct++;\n                val=*it;\n                ans=max(ans,ct*val);\n                if(it==dict.begin()) flag=0;\n                else it--;\n            }\n        }\n        return ans;\n    }\n};\n```
[]