1975. Maximum Matrix Sum
https://leetcode.com/problems/maximum-matrix-sum
Description
You are given an n x n integer matrix. You can do the following operation any number of times:
Choose any two adjacent elements of
matrixand multiply each of them by-1.
Two elements are considered adjacent if and only if they share a border.
Your goal is to maximize the summation of the matrix's elements. Return the maximum sum of the matrix's elements using the operation mentioned above.
Example 1:

Example 2:

Constraints:
n == matrix.length == matrix[i].length2 <= n <= 250-105 <= matrix[i][j] <= 105
ac
Previous1974. Minimum Time to Type Word Using Special TypewriterNext1976. Number of Ways to Arrive at Destination
Last updated
Was this helpful?