✅ One Line Solution
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1\nTime complexity: O(mn). Space complex
(Disclaimer: this is not an example to follow in a real project - it is written for fun and training mostly)\n\n# Code #1\nTime complexity: $$O(m*n)$$. Space complexity: $$O(1)$$.\n```python3\nclass Solution:\n    def maxMatrixSum(self, g: List[List[int]]) -> int:\n        return sum(map(abs,chain(*g)))-(sum(v<0 for v in chain(*g))%2 and min(map(abs,chain(*g)))*2)\n```\n\n# Code #2\nTime complexity: $$O(m*n)$$. Space complexity: $$O(m*n)$$.\n```python3\nclass Solution:\n    def maxMatrixSum(self, g: List[List[int]]) -> int:\n        return sum(b:=[*map(abs,a:=[*chain(*g)])])-sum(v<0 for v in a)%2*min(b)*2\n```\n\n(Disclaimer 2: code above is just a product of fantasy packed into one line, it is not claimed to be \'true\' oneliners - please, remind about drawbacks only if you know how to make it better)
['Array', 'Greedy', 'Matrix', 'Python', 'Python3']