[Python3] greedy
\n\nclass Solution:\n    def maxMatrixSum(self, matrix: List[List[int]]) -> int:\n        ans = mult = 0\n        val = inf \n        for i in range(len(matrix)
\n```\nclass Solution:\n    def maxMatrixSum(self, matrix: List[List[int]]) -> int:\n        ans = mult = 0\n        val = inf \n        for i in range(len(matrix)): \n            for j in range(len(matrix)):\n                ans += abs(matrix[i][j])\n                val = min(val, abs(matrix[i][j]))\n                if matrix[i][j] < 0: mult ^= 1\n        return ans - 2*mult*val\n```
['Python3']