Skip to content

Commit

Permalink
Formatted python code with psf/black Pushing..
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions authored and github-actions committed Apr 26, 2024
1 parent 09050b5 commit 1d4e3c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Leetcode/3sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@ def threeSum(nums):
if len(zero_set) >= 3:
result.add((0, 0, 0))


for i in range(len(negative_set)):
for j in range(i + 1, len(negative_set)):
target = -1 * (negative_set[i] + negative_set[j])
if target in pos_check:
result.add(tuple(sorted([negative_set[i], negative_set[j], target])))
result.add(
tuple(sorted([negative_set[i], negative_set[j], target]))
)

for i in range(len(positive_set)):
for j in range(i + 1, len(positive_set)):
target = -1 * (positive_set[i] + positive_set[j])
if target in neg_check:
result.add(tuple(sorted([positive_set[i], positive_set[j], target])))
result.add(
tuple(sorted([positive_set[i], positive_set[j], target]))
)

return result

Expand Down

0 comments on commit 1d4e3c9

Please sign in to comment.