❇ maximum-matrix-sum/discuss Images👌 🏆O(N*N)❤️ Javascript🎯 Memory👀95%🕕 ++Explanation✍️🔴🔥✅💪🙏
Time Complexity: O(N*N)\uD83D\uDD55\nSpace Complexity: O(1)\n\nvar maxMatrixSum = function (matrix) {\n    let sum = 0;\n    let negSign = 0;\n    let minNegSig
**Time Complexity: O(N*N)\uD83D\uDD55\nSpace Complexity: O(1)**\n```\nvar maxMatrixSum = function (matrix) {\n    let sum = 0;\n    let negSign = 0;\n    let minNegSign = Infinity;\n    for (let row = 0; row < matrix.length; row++) {\n        for (let column = 0; column < matrix[row].length; column++) {\n            if (matrix[row][column] <= 0) {\n                negSign++;\n            }\n            minNegSign = Math.min(minNegSign, Math.abs(matrix[row][column]));\n            sum += Math.abs(matrix[row][column]);\n        }\n    }\n    if (negSign % 2 !== 0) {\n        return sum - minNegSign * 2;\n    }\n    return sum;\n};\n```\n\n![image](https://assets.leetcode.com/users/images/b0e547f5-6e89-45c7-bbce-61e12a452a67_1730275477.260974.png)\n
['JavaScript']