Brute force solution
Code\n\nclass Solution:\n    def largestSubmatrix(self, matrix: List[List[int]]) -> int:\n        m, n, ans = len(matrix), len(matrix[0]), 0\n        \n        
# Code\n```\nclass Solution:\n    def largestSubmatrix(self, matrix: List[List[int]]) -> int:\n        m, n, ans = len(matrix), len(matrix[0]), 0\n        \n        for j in range(n):\n            for i in range(1, m):\n                matrix[i][j] += matrix[i-1][j] if matrix[i][j] else 0\n                \n        for i in range(m): \n            matrix[i].sort(reverse=1)\n            for j in range(n):\n                ans = max(ans, (j + 1) * matrix[i][j])\n\n        return ans\n```\n# Complexity\n- Time complexity: $$O(n^2m^2)$$\n- Space complexity: $$O(1)$$\n
['Matrix', 'Python3']