Pyhton | Easy | Greedy
see the Successfully Accepted Submission\npython\nclass Solution:\n    def largestSubmatrix(self, matrix):\n        rows, cols = len(matrix), len(matrix[0])\n  
[see the Successfully Accepted Submission](https://leetcode.com/submissions/detail/1106639757/)\n```python\nclass Solution:\n    def largestSubmatrix(self, matrix):\n        rows, cols = len(matrix), len(matrix[0])\n        max_area = 0\n\n        for j in range(cols):\n            cont_sum = 0\n            for i in range(rows):\n                if matrix[i][j] == 0:\n                    cont_sum = 0\n                    continue\n\n                cont_sum += 1\n                matrix[i][j] = cont_sum\n\n        for i in range(rows):\n            temp_list = sorted(matrix[i], reverse=True)\n\n            for j in range(cols):\n                max_area = max(max_area, (j + 1) * temp_list[j])\n\n        return max_area\n\n```\n![image](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)
['Greedy', 'Python']