Skip to content

Commit e8a469d

Browse files
committed
1975
1 parent 7f1f3d7 commit e8a469d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Nov-24-24.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def maxMatrixSum(self, matrix: List[List[int]]) -> int:
3+
miN = float('inf')
4+
neg = 0
5+
s = 0
6+
for row in matrix:
7+
for ele in row:
8+
miN = min(miN,abs(ele))
9+
if ele<0:
10+
neg += 1
11+
s += abs(ele)
12+
return s if neg%2==0 else s-(2*miN)

0 commit comments

Comments
 (0)