Python solution easy-understanding with comments
class Solution:\n\n    def largestSubmatrix(self, matrix: List[List[int]]) -> int:\n        row, col = len(matrix), len(matrix[0])\n        for j in range(col):
class Solution:\n\n    def largestSubmatrix(self, matrix: List[List[int]]) -> int:\n        row, col = len(matrix), len(matrix[0])\n        for j in range(col): # calculate the prefix consecutive one for each column \n            for i in range(1,row):\n                if matrix[i][j]:\n                    matrix[i][j]+=matrix[i-1][j]\n        ans = 0\n        for i in range(row): # for every row we sort the list in ascending order\n            matrix[i].sort()\n            for j in range(col-1,-1,-1): \n                if matrix[i][j]==0:\n                    break\n                ans = max(ans, (col-j)*matrix[i][j]) # record the largest submatrix\n        return ans
['Python']