Skip to content

Commit

Permalink
15 improved
Browse files Browse the repository at this point in the history
  • Loading branch information
DeNice-r committed Jul 25, 2023
1 parent 9ef1ad5 commit 213fece
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions 1-100/15. 3Sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ def solve(nums, target=0):
continue
y, z = x + 1, len(nums) - 1
while y < z:
print(v, nums[y], nums[z])
s = v + nums[y] + nums[z]
if s > target:
z -= 1
else:
if s == target:
answer.append((v, nums[y], nums[z]))
y += 1
while y < len(nums) and nums[y] == nums[y - 1]:
y += 1
return answer


Expand Down

0 comments on commit 213fece

Please sign in to comment.