We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c319f1 commit 1f9c0b1Copy full SHA for 1f9c0b1
sinch_arkad.py
@@ -40,13 +40,13 @@ def solve(matrix):
40
best = max(candidates, key=lambda x: x[0])
41
row, col, d = best[1]
42
for i in range(row, row+d+1):
43
- for j in range(row, row+d+1):
+ for j in range(col, col+d+1):
44
matrix[i][j] *= -1
45
46
i = 0
47
while i < len(lines):
48
matrix = []
49
- for _ in range(25):
+ while i < len(lines) and lines[i] != "":
50
matrix.append(list(map(int, lines[i].split(" "))))
51
i+=1
52
@@ -55,6 +55,7 @@ def solve(matrix):
55
total += sum(xs)
56
print("Total sum of matrix is", total)
57
solve(matrix)
58
+ total = 0
59
for xs in matrix:
60
61
print("NEW total sum of matrix is", total)
0 commit comments