Skip to content

Commit 65b67fa

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Solution {
1616
vector<int> sums(n, 0);
1717
for (int j = i; j < m; ++j) {
1818
for (int l = 0; l < n; ++l) {
19-
sums[l] += (n == matrix.size()) ? matrix[l][j] : matrix[j][l];
19+
sums[l] += (m == matrix.size()) ? matrix[j][l] : matrix[l][j];
2020
}
2121

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

0 commit comments

Comments
 (0)