We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 48715af + 3ad9d08 commit 94e78a8Copy full SHA for 94e78a8
algorithms/cpp/3Sum/3Sum.cpp
@@ -81,7 +81,7 @@ vector<vector<int> > threeSum(vector<int> &num) {
81
high--;
82
} else{
83
//skip the duplication
84
- while(low<n && num[low]==num[low+1]) low++;
+ while(low<n-1 && num[low]==num[low+1]) low++;
85
low++;
86
}
87
0 commit comments