Simple & easy solution - Count frequency of negative
Code\npython3 []\nclass Solution:\n    def maxMatrixSum(self, matrix: List[List[int]]) -> int:\n        rows, cols = len(matrix), len(matrix[0])\n        min_va
# Code\n```python3 []\nclass Solution:\n    def maxMatrixSum(self, matrix: List[List[int]]) -> int:\n        rows, cols = len(matrix), len(matrix[0])\n        min_val = float(\'inf\')\n        negative_counts = 0\n        total_sum = 0\n\n        for i in range(rows):\n            for j in range(cols):\n                val = matrix[i][j]\n                if val < 0:\n                    negative_counts += 1\n                    val = -val\n                min_val = min(min_val, val)\n                total_sum += val\n\n        if negative_counts % 2 == 0:\n            return total_sum\n        \n        return total_sum - 2 * min_val\n```
['Array', 'Greedy', 'Matrix', 'Python3']