Skip to content

Commit 4b339ac

Browse files
committed
Update maximum-size-subarray-sum-equals-k.cpp
1 parent 0475bed commit 4b339ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/maximum-size-subarray-sum-equals-k.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Solution {
1414
max_len = max(max_len, i - sums[cur_sum - k]);
1515
}
1616
if (sums.find(cur_sum) == sums.end()) {
17-
sums[cur_sum] = i;
17+
sums[cur_sum] = i; // Only keep the smallest index.
1818
}
1919
}
2020
return max_len;

0 commit comments

Comments
 (0)