Skip to content

Commit 025fbea

Browse files
authored
Update 4sum.cpp
1 parent 7be49cc commit 025fbea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/4sum.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Solution {
1414
if (j != i + 1 && nums[j] == nums[j - 1]) {
1515
continue;
1616
}
17-
int total = target - nums[i] - nums[j];
17+
const auto& total = target - nums[i] - nums[j];
1818
int left = j + 1, right = size(nums) - 1;
1919
while (left < right) {
2020
if (nums[left] + nums[right] == total) {

0 commit comments

Comments
 (0)