Simple Maths || C++ ||
\nclass Solution {\npublic:\n    long long maxMatrixSum(vector<vector<int>>& matrix) {\n        long long int sum=0;\n        bool zero=false;\n        int neg=
```\nclass Solution {\npublic:\n    long long maxMatrixSum(vector<vector<int>>& matrix) {\n        long long int sum=0;\n        bool zero=false;\n        int neg=0,  mn=INT_MAX;\n        for(auto it: matrix)\n        {\n            for(auto i: it)\n            {\n                if(i==0)\n                    zero=true;\n                if(i<0)\n                    neg++;\n                sum+=abs(i);\n                if(abs(i)<mn)\n                    mn=abs(i);\n            }\n        }\n        if(zero || neg%2==0)\n            return sum;\n        return sum-2*mn;\n    }\n};\n```
['Math']