✅ Swift: Easy to Understand and Simple Solution
Complexity\n- Time complexity: O(mn.log.n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \
# Complexity\n- Time complexity: $$O(mn.log.n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    func largestSubmatrix(_ matrix: [[Int]]) -> Int {\n        var ans = 0\n        var hist = Array(repeating: 0, count: matrix[0].count)\n        \n        for row in matrix {\n            for i in 0..<row.count {\n                hist[i] = row[i] == 0 ? 0 : hist[i] + 1\n            }\n            \n            let sortedHist = hist.sorted()\n            \n            for i in 0..<sortedHist.count {\n                let h = sortedHist[i]\n                ans = max(ans, h * (row.count - i))\n            }\n        }\n        \n        return ans\n    }\n}\n```
['Array', 'Greedy', 'Swift', 'Sorting', 'Matrix']