{
  "id": "cb-04",
  "name": "spiral_coords",
  "passed": true,
  "grade_detail": "all asserts passed",
  "wall_s": 101.9,
  "usage": {
    "completion_tokens": 3056,
    "prompt_tokens": 80,
    "total_tokens": 3136,
    "completion_tokens_details": null,
    "prompt_tokens_details": null
  },
  "answer": "```python\ndef spiral_coords(rows, cols):\n    \"\"\"\n    Return the (row, col) coordinates of a rows-by-cols grid visited in\n    clockwise spiral order, starting at (0, 0) and moving right first.\n    \"\"\"\n    if rows <= 0 or cols <= 0:\n        return []\n\n    result = []\n    top, bottom = 0, rows - 1\n    left, right = 0, cols - 1\n\n    while top <= bottom and left <= right:\n        # Move right along the top row\n        for c in range(left, right + 1):\n            result.append((top, c))\n        top += 1\n\n        # Move down the right column\n        for r in range(top, bottom + 1):\n            result.append((r, right))\n        right -= 1\n\n        # Move left along the bottom row\n        if top <= bottom:\n            for c in range(right, left - 1, -1):\n                result.append((bottom, c))\n            bottom -= 1\n\n        # Move up the left column\n        if left <= right:\n            for r in range(bottom, top - 1, -1):\n                result.append((r, left))\n            left += 1\n\n    return result\n```",
  "finish_reason": "stop"
}