GoalScope — spiral_order (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def spiral_order(matrix):↵
"""Given an m x n matrix, return all elements of the matrix in spiral order."""↵
result = []↵
while matrix:↵
result += matrix.pop(0)↵
matrix = list(zip(*matrix))[::-1]↵
return result↵
</code>