GoalScope — product_except_self (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def product_except_self(nums):↵
"""Calculate product of all elements except self without using division."""↵
length = len(nums)↵
left_products = [1] * length↵
right_products = [1] * length↵
result = [1] * length↵
↵
for i in range(1, length):↵
left_products[i] = left_products[i - 1] * nums[i - 1]↵
↵
for i in reversed(range(length - 1)):↵
right_products[i] = right_products[i + 1] * nums[i + 1]↵
↵
for i in range(length):↵
result[i] = left_products[i] * right_products[i]↵
↵
return result↵
</code>