GoalScope — rod_cutting (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def rod_cutting(prices, n):↵
"""Dynamic programming solution for the rod cutting problem."""↵
dp = [0] * (n + 1)↵
for i in range(1, n + 1):↵
max_val = -float('inf')↵
for j in range(i):↵
max_val = max(max_val, prices[j] + dp[i - j - 1])↵
dp[i] = max_val↵
return dp[n]↵
</code>