Easyest way to Largest Submatrix With Rearrangements.
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  int customMax(int a, int b) => a > b ? a : b;\n\n  int largestSubmatrix(List<List<int>> matrix) {\n    int m = matrix.length;\n    int n = matrix[0].length;\n\n    for (int i = 1; i < m; i++) {\n      for (int j = 0; j < n; j++) {\n        if (matrix[i][j] == 1) {\n          matrix[i][j] += matrix[i - 1][j];\n        }\n      }\n    }\n\n    for (List<int> row in matrix) {\n      row.sort((a, b) => b - a);\n    }\n\n    int maxArea = 0;\n    for (List<int> row in matrix) {\n      for (int j = 0; j < n; j++) {\n        maxArea = customMax(maxArea, row[j] * (j + 1));\n      }\n    }\n\n    return maxArea;\n  }\n}\n\n```
['Dart']