We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d2514c commit 83f14beCopy full SHA for 83f14be
3sum/kayden.py
@@ -19,7 +19,7 @@ def threeSum(self, nums: List[int]) -> List[List[int]]:
19
continue
20
for j in range(i + 1, n):
21
target = -(nums[i] + nums[j])
22
- if not check.get(target, None):
+ if not check.get(target):
23
24
if j >= check[target]:
25
@@ -47,6 +47,8 @@ def threeSum2(self, nums: List[int]) -> List[List[int]]:
47
answer.add((nums[i], nums[l], nums[r]))
48
l += 1
49
r -= 1
50
+ while nums[l] == nums[l - 1] and l < r:
51
+ l += 1
52
53
if nums[l] + nums[r] < -nums[i]:
54
0 commit comments