Skip to content

Commit

Permalink
feature: three sum revisit
Browse files Browse the repository at this point in the history
  • Loading branch information
solairerove committed Dec 6, 2023
1 parent da8b7c2 commit 6a31d17
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arrays/ThreeSum.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def three_sum(self, nums: List[int]) -> List[List[int]]:
low, high = i + 1, len(nums) - 1
while low < high:
_sum = nums[i] + nums[low] + nums[high]

if _sum == 0:
res.append([nums[i], nums[low], nums[high]])
low, high = low + 1, high - 1
Expand Down

0 comments on commit 6a31d17

Please sign in to comment.