✅ Optimal Solution
Solution\nswift []\nstruct Solution {\n    func maxMatrixSum(_ matrix: [[Int]]) -> Int {\n        var (accum, minVal, negatives) = (0, Int.max, 0)\n        for 
# Solution\n```swift []\nstruct Solution {\n    func maxMatrixSum(_ matrix: [[Int]]) -> Int {\n        var (accum, minVal, negatives) = (0, Int.max, 0)\n        for row in matrix {\n            for val in row {\n                let aval = (val ^ (val >> 31)) - (val >> 31) // fast abs calculation\n                minVal = min(minVal, aval)\n                accum += aval\n                negatives += (val >> 31) & 1\n            }\n        }\n        return accum - (minVal << 1) * (negatives & 1)\n    }\n}\n```
['Array', 'Swift', 'Matrix']