Nice solution
Intuition\n Describe your first thoughts on how to solve this problem. The problem involves maximizing the sum of the matrix elements by flipping signs of adjac
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->The problem involves maximizing the sum of the matrix elements by flipping signs of adjacent elements. The key observation is that we can freely flip signs of any element as long as the total number of negative elements remains consistent modulo 2 (even or odd). \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nIterate through the matrix\n\nAdjust for Odd Negatives\n\nReturn the Result\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n*n)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    long long maxMatrixSum(vector<vector<int>>& matrix) {\n        int neg = 0, is0 = 0, min = abs(matrix[0][0]);\n        long long res = 0;\n        int len = matrix.size();\n        for(int i=0; i<len; i++)\n        {\n            for(int j=0; j<len; j++)\n            {\n                if(matrix[i][j]<0)\n                {\n                    matrix[i][j] *= -1;\n                    neg++;\n                }\n                res += matrix[i][j];\n                if(matrix[i][j]<min) min = matrix[i][j];\n                if(matrix[i][j]==0) {\n                    is0 = 1;\n                }\n            }\n        }\n        if(neg%2 == 0 || is0 == 1) return res;\n        else return res - 2*min;\n    }\n};\n```
['C++']