GoalScope — trapping_rain_water (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def trapping_rain_water(height):↵
"""Calculate the amount of rain water trapped."""↵
if not height:↵
return 0↵
↵
left, right = 0, len(height) - 1↵
left_max, right_max = height[left], height[right]↵
water_trapped = 0↵
↵
while left < right:↵
if left_max < right_max:↵
left += 1↵
left_max = max(left_max, height[left])↵
water_trapped += left_max - height[left]↵
else:↵
right -= 1↵
right_max = max(right_max, height[right])↵
water_trapped += right_max - height[right]↵
↵
return water_trapped↵
</code>