GoalScope — decode_string (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def decode_string(s):↵
"""Decode a string with the format k[encoded_string]."""↵
stack = []↵
a, d = '', ''↵
for c in s:↵
if c.isdigit():↵
d += c↵
elif c.isalpha():↵
a += c↵
elif c == '[':↵
stack.append((a, int(d)))↵
a, d = '', ''↵
elif c == ']':↵
p, n = stack.pop()↵
a = p + a * n↵
return a↵
</code>