Skip to content

Commit 5e2011f

Browse files
committed
debug #018 4sum
"m < len" will cause assertion failed in exact input ,say (0,4,4,4,4,4,4,4,4)
1 parent f2a919c commit 5e2011f

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)