Skip to content

Commit

Permalink
Time: 40 ms (46.92%), Space: 50.8 MB (52.46%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
rldnrl committed Jan 12, 2023
1 parent aa3d936 commit 104575b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 0015-3sum/0015-3sum.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public List<List<Integer>> threeSum(int[] nums) {
Arrays.sort(nums);

for (int i = 0; i < nums.length - 2; i++) {
if (i > 0 && nums[i - 1] == nums[i]) {
if (i > 0 && nums[i] == nums[i - 1]) {
continue;
}

Expand All @@ -24,7 +24,7 @@ public List<List<Integer>> threeSum(int[] nums) {
list.add(nums[right]);
answer.add(list);
left++;
while (nums[left - 1] == nums[left] && left < right) {
while (nums[left] == nums[left - 1] && left < right) {
left++;
}
}
Expand Down

0 comments on commit 104575b

Please sign in to comment.