Skip to content

Commit a3611f9

Browse files
refactor 15
1 parent 8496346 commit a3611f9

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-2
lines changed

src/main/java/com/fishercoder/solutions/_15.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public List<List<Integer>> threeSum(int[] nums) {
3838
if (sum == 0) {
3939
result.add(Arrays.asList(nums[i], nums[left], nums[right]));
4040

41-
while (left + 1 < right && nums[left] == nums[left + 1]) {
41+
while (left < right && nums[left] == nums[left + 1]) {
4242
left++;
4343
}
4444

45-
while (right - 1 > left && nums[right] == nums[right - 1]) {
45+
while (right > left && nums[right] == nums[right - 1]) {
4646
right--;
4747
}
4848
left++;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy