Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f1a28f7

Browse files
fix: fix three_sum.py bug
Fix bug to append tuple of triplets
1 parent f7de04d commit f1a28f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎arrays_and_strings/three_sum/three_sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def three_sum(nums: List[int]) -> List[List[int]]:
3434

3535
# If the sum is zero, append the triplet to the result and skip duplicates
3636
if current_sum == 0:
37-
triplets.append([nums[i], nums[low], nums[high]])
37+
triplets.append(([nums[i], nums[low], nums[high]))
3838
# Skip duplicates of the low pointer to avoid redundant triplets
3939
while low < high and nums[low] == nums[low + 1]:
4040
low += 1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /