We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84a0dc1 commit 65b67faCopy full SHA for 65b67fa
C++/max-sum-of-sub-matrix-no-larger-than-k.cpp
@@ -16,7 +16,7 @@ class Solution {
16
vector<int> sums(n, 0);
17
for (int j = i; j < m; ++j) {
18
for (int l = 0; l < n; ++l) {
19
- sums[l] += (n == matrix.size()) ? matrix[l][j] : matrix[j][l];
+ sums[l] += (m == matrix.size()) ? matrix[j][l] : matrix[l][j];
20
}
21
22
// Find the max subarray no more than K.
0 commit comments