GoalScope — three_sum (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def three_sum(nums):↵
"""Find all unique triplets in the array which gives the sum of zero."""↵
nums.sort()↵
result = []↵
for i in range(len(nums) - 2):↵
if i > 0 and nums[i] == nums[i - 1]:↵
continue↵
left, right = i + 1, len(nums) - 1↵
while left < right:↵
total = nums[i] + nums[left] + nums[right]↵
if total < 0:↵
left += 1↵
elif total > 0:↵
right -= 1↵
else:↵
result.append([nums[i], nums[left], nums[right]])↵
while left < right and nums[left] == nums[left + 1]:↵
left += 1↵
while left < right and nums[right] == nums[right - 1]:↵
right -= 1↵
left += 1↵
right -= 1↵
return result↵
</code>