Skip to content

Commit 027a83f

Browse files
authoredOct 14, 2023
Update 0015-3sum.java
File(s) Modified: 0015-3sum.java Language(s) Used: Java Submission URL: https://leetcode.com/problems/3sum/submissions/1074841189/ Description: Only added comment to code that helps understand it better
1 parent 551416d commit 027a83f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

Diff for: ‎java/0015-3sum.java

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public List<List<Integer>> threeSum(int[] nums) {
66
LinkedList<List<Integer>> sol = new LinkedList<List<Integer>>();
77

88
for (int i = 0; i < nums.length - 2; i++) {
9+
//Only consider non-duplicate elements for i
910
if (i == 0 || (i > 0 && nums[i] != nums[i - 1])) {
1011
int target = 0 - nums[i];
1112
int left = i + 1;

0 commit comments

Comments
 (0)
Please sign in to comment.