Skip to content

Commit d42d243

Browse files
committed
Merge pull request illuz#2 from NgWilli/patch-2
bug fix #018 4sum
2 parents f2a919c + 5e2011f commit d42d243

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

solutions/018.4Sum/AC_two_points_n3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ class Solution {
4040
--k;
4141
}
4242
}
43-
while (m < len && num[m] == num[m + 1])
43+
while (m < len-3 && num[m] == num[m + 1])
4444
++m;
4545
}
46-
while (i < len && num[i] == num[i + 1])
46+
while (i < len-4 && num[i] == num[i + 1])
4747
++i;
4848
}
4949

0 commit comments

Comments
 (0)