simple sorting prefix sum problem
\nclass Solution {\n    public int largestSubmatrix(int[][] matrix) {\n        int n = matrix.length;\n        int m = matrix[0].length;\n        for(int i=0;i<
```\nclass Solution {\n    public int largestSubmatrix(int[][] matrix) {\n        int n = matrix.length;\n        int m = matrix[0].length;\n        for(int i=0;i<m;i++){\n            for(int j=1;j<n;j++){\n                if(matrix[j][i]==0)\n                    continue;\n                else{\n                    matrix[j][i]+=matrix[j-1][i];\n                }\n            }\n        }\n        int ans = 0;\n        for(int i=0;i<n;i++){\n            ans = Math.max(maxArea(matrix[i]),ans);\n        }\n        return ans;\n    }\n    public int maxArea(int hist[]){\n        Arrays.sort(hist);\n        int n = hist.length;\n        int ans = 0;\n        for(int i=0;i<n;i++){\n            ans = Math.max((n-i)*hist[i],ans);\n        }\n        return ans;\n    }\n}\n```
['Greedy', 'Sorting', 'Prefix Sum', 'Java']