🔥Beginner Friendly Solution with Detail Explanation🔥|| 🔥Daily Challenges🔥
Intuition\n\n\n# Complexity\n- Time complexity:O(2nm)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(1)\n Add your space complexity here, e
# Intuition\n![image.png](https://assets.leetcode.com/users/images/e4acabd8-4171-48ab-ba36-a9a3b027f6b8_1700970309.7230844.png)\n\n# Complexity\n- Time complexity:$$O(2*n*m)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int largestSubmatrix(int[][] matrix) {\n        for(int i=1; i<matrix.length; i++){\n            for(int j=0; j<matrix[0].length; j++){\n                if(matrix[i][j] == 1) matrix[i][j] = matrix[i-1][j] + 1;\n            }\n        }\n\n        int maxi=0;\n        for(int i=0; i<matrix.length; i++){\n            Arrays.sort(matrix[i]);\n            for(int j=1; j<=matrix[0].length; j++){\n                maxi = Math.max(maxi, j*matrix[i][matrix[0].length-j]);\n            }\n        }\n        return maxi;\n    }\n}\n```
['Array', 'Greedy', 'Sorting', 'Matrix', 'Java']