Java Solution | O(m * n * logn) time complexity
\nclass Solution {\n    public int largestSubmatrix(int[][] matrix) {\n        \n        int m = matrix.length;\n        int n = matrix[0].length;\n        \n  
```\nclass Solution {\n    public int largestSubmatrix(int[][] matrix) {\n        \n        int m = matrix.length;\n        int n = matrix[0].length;\n        \n        for(int i = 1; i < m; i++){\n            \n            for(int j = 0; j < n; j++){\n                \n                if(matrix[i][j] == 1){\n                    matrix[i][j] = matrix[i - 1][j] + 1;\n                }\n            }\n        }\n        \n        int res = 0;\n        \n        for(int i = 0; i < m; i++){\n            \n            Arrays.sort(matrix[i]);\n            \n            for(int j = 0; j < n; j++){\n                \n                res = Math.max(res, matrix[i][j] * (n - j));\n            }\n        }\n        \n        return res;\n    }\n}\n```
['Java']