Available question text
Given an n×n integer matrix where you may multiply any two adjacent (edge-sharing) elements by -1 any number of times, maximize the matrix sum. Because adjacency flips affect opposite bipartition cells, the optimum is the sum of absolute values of all entries unless the count of negative numbers is odd (and there is no zero), in which case you must subtract twice the smallest absolute value.
Related questions
Continue with questions that share topics or the same question type.
- Binary Tree Maximum Path Sum
Coding · Binary Tree · Depth-First Search · DP on Trees
- Choose K Elements With Maximum Sum
Coding
- Difference Between Maximum and Minimum Price Sum
Coding
- Find the Kth Smallest Sum of a Matrix With Sorted Rows
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1975. Maximum Matrix Sum
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source