| {"id": "t3_001", "difficulty": 3, "bug_type": "edge_case_only", "function_name": "merge_sorted", "buggy_code": "def merge_sorted(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i])\n i += 1\n else:\n result.append(b[j])\n j += 1\n return result", "original_code": "def merge_sorted(a, b):\n result = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n result.append(a[i])\n i += 1\n else:\n result.append(b[j])\n j += 1\n result.extend(a[i:])\n result.extend(b[j:])\n return result", "initial_error": "AssertionError: merge_sorted([1,3],[2,4,5]) expected [1,2,3,4,5], got [1,2,3]", "bug_location": {"function": "merge_sorted", "line_start": 11}, "test_cases": [{"input": [[1, 3], [2, 4, 5]], "expected_output": [1, 2, 3, 4, 5]}, {"input": [[], [1, 2]], "expected_output": [1, 2]}, {"input": [[1, 2], []], "expected_output": [1, 2]}, {"input": [[1], [2]], "expected_output": [1, 2]}]} |
| {"id": "t3_002", "difficulty": 3, "bug_type": "subtle_logic", "function_name": "rotate_matrix", "buggy_code": "def rotate_matrix(matrix):\n n = len(matrix)\n for i in range(n):\n for j in range(i, n):\n matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]\n return matrix", "original_code": "def rotate_matrix(matrix):\n n = len(matrix)\n for i in range(n):\n for j in range(i, n):\n matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]\n for row in matrix:\n row.reverse()\n return matrix", "initial_error": "AssertionError: rotate_matrix([[1,2],[3,4]]) expected [[3,1],[4,2]], got [[1,3],[2,4]]", "bug_location": {"function": "rotate_matrix", "line_start": 6}, "test_cases": [{"input": [[1, 2], [3, 4]], "expected_output": [[3, 1], [4, 2]]}, {"input": [[1, 2, 3], [4, 5, 6], [7, 8, 9]], "expected_output": [[7, 4, 1], [8, 5, 2], [9, 6, 3]]}]} |