Skip to content

Commit 84a0dc1

Browse files
authored
Update max-sum-of-sub-matrix-no-larger-than-k.cpp
1 parent 1156308 commit 84a0dc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/max-sum-of-sub-matrix-no-larger-than-k.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class Solution {
1515
for (int i = 0; i < m; ++i) {
1616
vector<int> sums(n, 0);
1717
for (int j = i; j < m; ++j) {
18-
for (int k = 0; k < n; ++k) {
19-
sums[k] += (n == matrix.size()) ? matrix[k][j] : matrix[j][k];
18+
for (int l = 0; l < n; ++l) {
19+
sums[l] += (n == matrix.size()) ? matrix[l][j] : matrix[j][l];
2020
}
2121

2222
// Find the max subarray no more than K.

0 commit comments

Comments
 (0)