[
  {
    "passed": 3,
    "all": 6,
    "avg_code_run_elapsed": 4.157734413941701e-06,
    "generate_code_elapsed": 40.11727526783943,
    "difficulty": "easy",
    "code": "def reverse_words(text):\n    words = text.split()\n    words = [word for word in words if word.strip() != '']\n    return ' '.join(words)",
    "prompt": "Return words in reverse order, separated by one space. Words are maximal non-whitespace spans., function signature: reverse_words(text: str) -> str, input examples: [{'case_id': 'PY100-E01-T01', 'input': ['hello world'], 'expected': 'world hello'}, {'case_id': 'PY100-E01-T02', 'input': ['  one   two three '], 'expected': 'three two one'}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E01-T01",
        "error": "Wrong answer",
        "expected": "'world hello'",
        "actual": "'hello world'"
      },
      {
        "case_id": "PY100-E01-T02",
        "error": "Wrong answer",
        "expected": "'three two one'",
        "actual": "'one two three'"
      },
      {
        "case_id": "PY100-E01-T05",
        "error": "Wrong answer",
        "expected": "'c b a'",
        "actual": "'a b c'"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 7.089731904367606e-06,
    "generate_code_elapsed": 76.9046094880905,
    "difficulty": "easy",
    "code": "def is_palindrome_alnum(text):\n    processed = ''.join([c.lower() for c in text if c.isalnum()])\n    return processed == processed[::-1]",
    "prompt": "Ignore non-alphanumeric characters and letter case; determine whether the remaining characters form a palindrome., function signature: is_palindrome_alnum(text: str) -> bool, input examples: [{'case_id': 'PY100-E02-T01', 'input': ['A man, a plan, a canal: Panama'], 'expected': True}, {'case_id': 'PY100-E02-T02', 'input': ['race a car'], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.09087896393612,
    "difficulty": "easy",
    "code": null,
    "prompt": "Return a new list obtained by rotating nums right by k positions; k is nonnegative. Empty input stays empty., function signature: rotate_right(nums: list[int], k: int) -> list[int], input examples: [{'case_id': 'PY100-E03-T01', 'input': [[1, 2, 3, 4, 5], 2], 'expected': [4, 5, 1, 2, 3]}, {'case_id': 'PY100-E03-T02', 'input': [[1, 2], 5], 'expected': [2, 1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E03",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.6096510787804923e-06,
    "generate_code_elapsed": 28.639936565887183,
    "difficulty": "easy",
    "code": "def unique_in_order(nums):\n    result = []\n    seen = set()\n    for num in nums:\n        if num not in seen:\n            result.append(num)\n            seen.add(num)\n    return result",
    "prompt": "Remove duplicate integers, preserving the first occurrence order., function signature: unique_in_order(nums: list[int]) -> list[int], input examples: [{'case_id': 'PY100-E04-T01', 'input': [[1, 2, 1, 3, 2]], 'expected': [1, 2, 3]}, {'case_id': 'PY100-E04-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 3,
    "all": 6,
    "avg_code_run_elapsed": 5.810637958347797e-06,
    "generate_code_elapsed": 85.74230750300921,
    "difficulty": "easy",
    "code": "def word_counts(text):\n    letters = [c.lower() for c in text if c.isalpha()]\n    words = []\n    for word in letters:\n        words.append(word)\n    freq = {}\n    for word in words:\n        freq[word] = freq.get(word, 0) + 1\n    return freq",
    "prompt": "Count lowercase words; a word is a contiguous run of ASCII letters A-Z/a-z. Ignore punctuation, digits and case., function signature: word_counts(text: str) -> dict[str,int], input examples: [{'case_id': 'PY100-E05-T01', 'input': ['Hello, hello! World 123'], 'expected': {'hello': 2, 'world': 1}}, {'case_id': 'PY100-E05-T02', 'input': [''], 'expected': {}}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E05-T01",
        "error": "Wrong answer",
        "expected": "{'hello': 2, 'world': 1}",
        "actual": "{'h': 2, 'e': 2, 'l': 5, 'o': 3, 'w': 1, 'r': 1, 'd': 1}"
      },
      {
        "case_id": "PY100-E05-T03",
        "error": "Wrong answer",
        "expected": "{'one': 1, 'two': 1}",
        "actual": "{'o': 2, 'n': 1, 'e': 1, 't': 1, 'w': 1}"
      },
      {
        "case_id": "PY100-E05-T05",
        "error": "Wrong answer",
        "expected": "{'hello': 1, 'world': 1}",
        "actual": "{'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.263711161911488e-06,
    "generate_code_elapsed": 35.73080893000588,
    "difficulty": "easy",
    "code": "def second_largest_distinct(nums):\n    unique_nums = set(nums)\n    if len(unique_nums) < 2:\n        return None\n    else:\n        sorted_unique = sorted(unique_nums, reverse=True)\n        return sorted_unique[1]",
    "prompt": "Return the second-largest distinct integer, or null if fewer than two distinct values exist., function signature: second_largest_distinct(nums: list[int]) -> int | None, input examples: [{'case_id': 'PY100-E06-T01', 'input': [[4, 1, 4, 2]], 'expected': 2}, {'case_id': 'PY100-E06-T02', 'input': [[1, 1, 1]], 'expected': None}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.494128274420897e-06,
    "generate_code_elapsed": 35.213340708985925,
    "difficulty": "easy",
    "code": "def max_consecutive_ones(bits):\n    current_length = 0\n    max_length = 0\n    for bit in bits:\n        if bit == 1:\n            current_length += 1\n            if current_length > max_length:\n                max_length = current_length\n        else:\n            current_length = 0\n    return max_length",
    "prompt": "Return the length of the longest consecutive run of 1s. The list contains only 0s and 1s., function signature: max_consecutive_ones(bits: list[int]) -> int, input examples: [{'case_id': 'PY100-E07-T01', 'input': [[1, 1, 0, 1, 1, 1]], 'expected': 3}, {'case_id': 'PY100-E07-T02', 'input': [[]], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 7,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.46872243587859,
    "difficulty": "easy",
    "code": null,
    "prompt": "Check proper nesting of (), [], {}. Ignore all other characters., function signature: balanced_brackets(text: str) -> bool, input examples: [{'case_id': 'PY100-E08-T01', 'input': ['([]){}'], 'expected': True}, {'case_id': 'PY100-E08-T02', 'input': ['([)]'], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E08",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.162235806385676e-06,
    "generate_code_elapsed": 55.38113633496687,
    "difficulty": "easy",
    "code": "def merge_sorted_lists(a, b):\n    result = []\n    i = 0\n    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    while i < len(a):\n        result.append(a[i])\n        i += 1\n    while j < len(b):\n        result.append(b[j])\n        j += 1\n    return result",
    "prompt": "Merge two nondecreasing integer lists into one nondecreasing list, retaining duplicates., function signature: merge_sorted_lists(a: list[int], b: list[int]) -> list[int], input examples: [{'case_id': 'PY100-E09-T01', 'input': [[1, 3, 5], [2, 4, 6]], 'expected': [1, 2, 3, 4, 5, 6]}, {'case_id': 'PY100-E09-T02', 'input': [[], [1]], 'expected': [1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 6.381073035299778e-06,
    "generate_code_elapsed": 46.7474253969267,
    "difficulty": "easy",
    "code": "def sorted_intersection(a, b):\n    set_a = set(a)\n    set_b = set(b)\n    intersection = set_a & set_b\n    return sorted(intersection)",
    "prompt": "Return distinct integers present in both inputs, sorted ascending., function signature: sorted_intersection(a: list[int], b: list[int]) -> list[int], input examples: [{'case_id': 'PY100-E10-T01', 'input': [[1, 2, 2, 3], [2, 2, 4]], 'expected': [2]}, {'case_id': 'PY100-E10-T02', 'input': [[], [1]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.2647139641922,
    "difficulty": "easy",
    "code": null,
    "prompt": "Run-length encode adjacent equal characters as [character,count] pairs in original order., function signature: rle_encode(text: str) -> list[list], input examples: [{'case_id': 'PY100-E11-T01', 'input': ['aaabbc'], 'expected': [['a', 3], ['b', 2], ['c', 1]]}, {'case_id': 'PY100-E11-T02', 'input': [''], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E11",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.73867759108543,
    "difficulty": "easy",
    "code": null,
    "prompt": "Shift lowercase ASCII letters by shift modulo 26, preserving all other characters. shift can be negative., function signature: caesar_lower(text: str, shift: int) -> str, input examples: [{'case_id': 'PY100-E12-T01', 'input': ['abc xyz', 2], 'expected': 'cde zab'}, {'case_id': 'PY100-E12-T02', 'input': ['Zoo!', 1], 'expected': 'Zpp!'}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E12",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.16568461200222,
    "difficulty": "easy",
    "code": null,
    "prompt": "Return the repeated digit sum of nonnegative n until one digit remains., function signature: digital_root(n: int) -> int, input examples: [{'case_id': 'PY100-E13-T01', 'input': [0], 'expected': 0}, {'case_id': 'PY100-E13-T02', 'input': [9], 'expected': 9}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E13",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 5.972804501652718e-06,
    "generate_code_elapsed": 25.848919208161533,
    "difficulty": "easy",
    "code": "def count_vowels(text):\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    count = 0\n    for char in text.lower():\n        if char in vowels:\n            count += 1\n    return count",
    "prompt": "Count occurrences of ASCII vowels a,e,i,o,u, case-insensitively., function signature: count_vowels(text: str) -> int, input examples: [{'case_id': 'PY100-E14-T01', 'input': ['Hello World'], 'expected': 3}, {'case_id': 'PY100-E14-T02', 'input': ['AEIOU'], 'expected': 5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 4,
    "all": 6,
    "avg_code_run_elapsed": 5.520453366140525e-06,
    "generate_code_elapsed": 54.21443980699405,
    "difficulty": "easy",
    "code": "def longest_common_prefix(words):\n    if not words:\n        return \"\"\n    prefix = words[0]\n    for word in words[1:]:\n        if not prefix.startswith(word):\n            break\n    return prefix",
    "prompt": "Return the longest prefix shared by every string; return empty string for empty input., function signature: longest_common_prefix(words: list[str]) -> str, input examples: [{'case_id': 'PY100-E15-T01', 'input': [['flower', 'flow', 'flight']], 'expected': 'fl'}, {'case_id': 'PY100-E15-T02', 'input': [['dog', 'racecar', 'car']], 'expected': ''}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E15-T01",
        "error": "Wrong answer",
        "expected": "'fl'",
        "actual": "'flower'"
      },
      {
        "case_id": "PY100-E15-T02",
        "error": "Wrong answer",
        "expected": "''",
        "actual": "'dog'"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 1.6585652095576126e-05,
    "generate_code_elapsed": 33.24159491294995,
    "difficulty": "easy",
    "code": "from collections import Counter\n\ndef is_anagram(a, b):\n    return Counter(a) == Counter(b)",
    "prompt": "Return true iff strings have identical character multisets. Case and whitespace matter., function signature: is_anagram(a: str, b: str) -> bool, input examples: [{'case_id': 'PY100-E16-T01', 'input': ['listen', 'silent'], 'expected': True}, {'case_id': 'PY100-E16-T02', 'input': ['rat', 'car'], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 6.607850082218647e-06,
    "generate_code_elapsed": 66.57743213605136,
    "difficulty": "easy",
    "code": "def fizzbuzz_slice(start, end):\n    result = []\n    for num in range(start, end + 1):\n        if num % 15 == 0:\n            result.append(\"FizzBuzz\")\n        elif num % 3 == 0:\n            result.append(\"Fizz\")\n        elif num % 5 == 0:\n            result.append(\"Buzz\")\n        else:\n            result.append(str(num))\n    return result",
    "prompt": "For each integer n in inclusive [start,end], output FizzBuzz if divisible by 15, Fizz if divisible by 3, Buzz if divisible by 5, otherwise decimal n. If start>end return []., function signature: fizzbuzz_slice(start: int, end: int) -> list[str], input examples: [{'case_id': 'PY100-E17-T01', 'input': [1, 5], 'expected': ['1', '2', 'Fizz', '4', 'Buzz']}, {'case_id': 'PY100-E17-T02', 'input': [14, 16], 'expected': ['14', 'FizzBuzz', '16']}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.90140042104758,
    "difficulty": "easy",
    "code": null,
    "prompt": "For a square matrix, return the sum of both diagonals; count their shared center once., function signature: matrix_diagonal_sum(matrix: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-E18-T01', 'input': [[[1, 2], [3, 4]]], 'expected': 10}, {'case_id': 'PY100-E18-T02', 'input': [[[5]]], 'expected': 5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E18",
      "error": "No Python Code"
    }
  },
  {
    "passed": 2,
    "all": 6,
    "avg_code_run_elapsed": 3.864134972294171e-06,
    "generate_code_elapsed": 50.543951253872365,
    "difficulty": "easy",
    "code": "def transpose_matrix(matrix):\n    if not matrix:\n        return []\n    transposed = list(zip(*matrix))\n    return transposed",
    "prompt": "Transpose a rectangular matrix. Empty matrix returns []; nonempty rows have equal length., function signature: transpose_matrix(matrix: list[list[int]]) -> list[list[int]], input examples: [{'case_id': 'PY100-E19-T01', 'input': [[[1, 2, 3], [4, 5, 6]]], 'expected': [[1, 4], [2, 5], [3, 6]]}, {'case_id': 'PY100-E19-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E19-T01",
        "error": "Wrong answer",
        "expected": "[[1, 4], [2, 5], [3, 6]]",
        "actual": "[(1, 4), (2, 5), (3, 6)]"
      },
      {
        "case_id": "PY100-E19-T03",
        "error": "Wrong answer",
        "expected": "[[1]]",
        "actual": "[(1,)]"
      },
      {
        "case_id": "PY100-E19-T04",
        "error": "Wrong answer",
        "expected": "[[1, 2, 3]]",
        "actual": "[(1, 2, 3)]"
      },
      {
        "case_id": "PY100-E19-T06",
        "error": "Wrong answer",
        "expected": "[[1, 3], [2, 4]]",
        "actual": "[(1, 3), (2, 4)]"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 5.046448980768521e-06,
    "generate_code_elapsed": 25.556701537920162,
    "difficulty": "easy",
    "code": "def flatten_once(groups):\n    result = []\n    for group in groups:\n        if isinstance(group, list):\n            for element in group:\n                result.append(element)\n    return result",
    "prompt": "Flatten exactly one level of nested integer lists, preserving order., function signature: flatten_once(groups: list[list[int]]) -> list[int], input examples: [{'case_id': 'PY100-E20-T01', 'input': [[[1, 2], [], [3]]], 'expected': [1, 2, 3]}, {'case_id': 'PY100-E20-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.33557606302202,
    "difficulty": "easy",
    "code": null,
    "prompt": "Repeatedly remove adjacent equal characters until no such pair remains; case-sensitive., function signature: cancel_adjacent_pairs(text: str) -> str, input examples: [{'case_id': 'PY100-E21-T01', 'input': ['abbaca'], 'expected': 'ca'}, {'case_id': 'PY100-E21-T02', 'input': ['azxxzy'], 'expected': 'ay'}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E21",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 1.258783352871736e-05,
    "generate_code_elapsed": 51.78125911811367,
    "difficulty": "easy",
    "code": "from collections import Counter\n\ndef majority_element(nums):\n    if not nums:\n        return None\n    counts = Counter(nums)\n    for key, value in counts.items():\n        if value > len(nums) / 2:\n            return key",
    "prompt": "Return the value appearing strictly more than n/2 times, or null if none exists., function signature: majority_element(nums: list[int]) -> int | None, input examples: [{'case_id': 'PY100-E22-T01', 'input': [[2, 2, 1, 2]], 'expected': 2}, {'case_id': 'PY100-E22-T02', 'input': [[1, 2, 3]], 'expected': None}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.35087900515646,
    "difficulty": "easy",
    "code": null,
    "prompt": "The length-n array contains each value from 0 through n except one, without duplicates. Return the missing value., function signature: missing_zero_to_n(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-E23-T01', 'input': [[3, 0, 1]], 'expected': 2}, {'case_id': 'PY100-E23-T02', 'input': [[0, 1]], 'expected': 2}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E23",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.47326717688702,
    "difficulty": "easy",
    "code": null,
    "prompt": "Return lexicographically smallest pair of indices [i,j] with i<j and nums[i]+nums[j]=target; or [] if none., function signature: two_sum_earliest(nums: list[int], target: int) -> list[int], input examples: [{'case_id': 'PY100-E24-T01', 'input': [[2, 7, 11, 15], 9], 'expected': [0, 1]}, {'case_id': 'PY100-E24-T02', 'input': [[3, 3], 6], 'expected': [0, 1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E24",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.4056526298324266e-06,
    "generate_code_elapsed": 23.77384425001219,
    "difficulty": "easy",
    "code": "def first_binary_index(nums, target):\n    for index, value in enumerate(nums):\n        if value == target:\n            return index\n    return -1",
    "prompt": "Return the first index of target in sorted nondecreasing nums; -1 when absent., function signature: first_binary_index(nums: list[int], target: int) -> int, input examples: [{'case_id': 'PY100-E25-T01', 'input': [[1, 2, 2, 3], 2], 'expected': 1}, {'case_id': 'PY100-E25-T02', 'input': [[], 1], 'expected': -1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 5,
    "all": 6,
    "avg_code_run_elapsed": 4.5758206397295e-06,
    "generate_code_elapsed": 66.43709267000668,
    "difficulty": "easy",
    "code": "def ascii_title_words(text):\n    words = text.split()\n    processed_words = [word[0].upper() + word[1:].lower() for word in words]\n    return ' '.join(processed_words)",
    "prompt": "Convert words separated by ASCII spaces to title case: first character uppercase, remaining lowercase; preserve the exact number of spaces. Inputs contain ASCII letters and spaces only., function signature: ascii_title_words(text: str) -> str, input examples: [{'case_id': 'PY100-E26-T01', 'input': ['hello WORLD'], 'expected': 'Hello World'}, {'case_id': 'PY100-E26-T02', 'input': ['  a  b '], 'expected': '  A  B '}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E26-T02",
        "error": "Wrong answer",
        "expected": "'  A  B '",
        "actual": "'A B'"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.900464167197545e-06,
    "generate_code_elapsed": 33.989661978092045,
    "difficulty": "easy",
    "code": "def inclusive_prefix_sums(nums):\n    result = []\n    current_sum = 0\n    for num in nums:\n        current_sum += num\n        result.append(current_sum)\n    return result",
    "prompt": "Return cumulative prefix sums, including each current element., function signature: inclusive_prefix_sums(nums: list[int]) -> list[int], input examples: [{'case_id': 'PY100-E27-T01', 'input': [[1, 2, 3]], 'expected': [1, 3, 6]}, {'case_id': 'PY100-E27-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.05556006613187,
    "difficulty": "easy",
    "code": null,
    "prompt": "Count distinct unordered value pairs (a,b) with a<=b, sum target, and enough occurrences when a==b., function signature: count_unique_pairs(nums: list[int], target: int) -> int, input examples: [{'case_id': 'PY100-E28-T01', 'input': [[1, 2, 3, 2, 4], 5], 'expected': 2}, {'case_id': 'PY100-E28-T02', 'input': [[1, 1], 2], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-E28",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.533049797018369e-06,
    "generate_code_elapsed": 27.26558672101237,
    "difficulty": "easy",
    "code": "def group_by_parity(nums):\n    even = []\n    odd = []\n    for num in nums:\n        if num % 2 == 0:\n            even.append(num)\n        else:\n            odd.append(num)\n    return [even, odd]",
    "prompt": "Return [even_numbers, odd_numbers], preserving input order within both lists; negative odd numbers are odd., function signature: group_by_parity(nums: list[int]) -> list[list[int]], input examples: [{'case_id': 'PY100-E29-T01', 'input': [[1, 2, 3, 4]], 'expected': [[2, 4], [1, 3]]}, {'case_id': 'PY100-E29-T02', 'input': [[]], 'expected': [[], []]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 6.306140373150508e-06,
    "generate_code_elapsed": 64.19149510702118,
    "difficulty": "easy",
    "code": "def rect_overlap_area(a, b):\n    x1, y1, x2, y2 = a\n    x1b, y1b, x2b, y2b = b\n\n    max_x = max(x1, x2)\n    min_x = min(x1, x2)\n    max_y = max(y1, y2)\n    min_y = min(y1, y2)\n\n    dx = max_x - min_x\n    dy = max_y - min_y\n\n    area = dx * dy\n\n    return area if area > 0 else 0",
    "prompt": "Axis-aligned rectangles [x1,y1,x2,y2] with x1<x2,y1<y2. Return intersection area (0 if disjoint or touching)., function signature: rect_overlap_area(a: list[int], b: list[int]) -> int, input examples: [{'case_id': 'PY100-E30-T01', 'input': [[0, 0, 3, 3], [1, 1, 4, 4]], 'expected': 4}, {'case_id': 'PY100-E30-T02', 'input': [[0, 0, 1, 1], [1, 1, 2, 2]], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-E30-T01",
        "error": "Wrong answer",
        "expected": "4",
        "actual": "9"
      },
      {
        "case_id": "PY100-E30-T02",
        "error": "Wrong answer",
        "expected": "0",
        "actual": "1"
      },
      {
        "case_id": "PY100-E30-T03",
        "error": "Wrong answer",
        "expected": "1",
        "actual": "25"
      },
      {
        "case_id": "PY100-E30-T04",
        "error": "Wrong answer",
        "expected": "4",
        "actual": "16"
      },
      {
        "case_id": "PY100-E30-T05",
        "error": "Wrong answer",
        "expected": "0",
        "actual": "1"
      },
      {
        "case_id": "PY100-E30-T06",
        "error": "Wrong answer",
        "expected": "2",
        "actual": "8"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.1321431430988,
    "difficulty": "medium",
    "code": null,
    "prompt": "All nums positive; return minimum length of a contiguous subarray with sum >= target, or 0 if impossible., function signature: min_positive_subarray(nums: list[int], target: int) -> int, input examples: [{'case_id': 'PY100-M01-T01', 'input': [[2, 3, 1, 2, 4, 3], 7], 'expected': 2}, {'case_id': 'PY100-M01-T02', 'input': [[1, 1, 1], 4], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M01",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.27219131402671,
    "difficulty": "medium",
    "code": null,
    "prompt": "Length of longest substring with no repeated characters; case-sensitive., function signature: longest_unique_substring(text: str) -> int, input examples: [{'case_id': 'PY100-M02-T01', 'input': ['abcabcbb'], 'expected': 3}, {'case_id': 'PY100-M02-T02', 'input': ['bbbbb'], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M02",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.36318057100289,
    "difficulty": "medium",
    "code": null,
    "prompt": "Return longest contiguous segment containing at most k distinct integers; k>=0., function signature: longest_k_distinct(nums: list[int], k: int) -> int, input examples: [{'case_id': 'PY100-M03-T01', 'input': [[1, 2, 1, 2, 3], 2], 'expected': 4}, {'case_id': 'PY100-M03-T02', 'input': [[1, 1, 1], 1], 'expected': 3}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M03",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.23828380205669,
    "difficulty": "medium",
    "code": null,
    "prompt": "Count nonempty contiguous subarrays whose sum is k. Values may be negative., function signature: subarray_sum_count(nums: list[int], k: int) -> int, input examples: [{'case_id': 'PY100-M04-T01', 'input': [[1, 1, 1], 2], 'expected': 2}, {'case_id': 'PY100-M04-T02', 'input': [[1, -1, 0], 0], 'expected': 3}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M04",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.98253642907366,
    "difficulty": "medium",
    "code": null,
    "prompt": "Return products of all elements except at each index; no division required; empty input yields []., function signature: product_except_self(nums: list[int]) -> list[int], input examples: [{'case_id': 'PY100-M05-T01', 'input': [[1, 2, 3, 4]], 'expected': [24, 12, 8, 6]}, {'case_id': 'PY100-M05-T02', 'input': [[0, 1, 2, 3]], 'expected': [6, 0, 0, 0]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M05",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.5646182759665,
    "difficulty": "medium",
    "code": null,
    "prompt": "For nonempty nums, return maximum sum of a nonempty contiguous circular subarray; no element may be used twice., function signature: max_circular_subarray(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-M06-T01', 'input': [[1, -2, 3, -2]], 'expected': 3}, {'case_id': 'PY100-M06-T02', 'input': [[5, -3, 5]], 'expected': 10}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M06",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.2804893120192,
    "difficulty": "medium",
    "code": null,
    "prompt": "Return rectangular matrix entries in clockwise spiral order starting top-left., function signature: spiral_matrix(matrix: list[list[int]]) -> list[int], input examples: [{'case_id': 'PY100-M07-T01', 'input': [[[1, 2, 3], [4, 5, 6], [7, 8, 9]]], 'expected': [1, 2, 3, 6, 9, 8, 7, 4, 5]}, {'case_id': 'PY100-M07-T02', 'input': [[[1, 2, 3]]], 'expected': [1, 2, 3]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M07",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.37640021392144,
    "difficulty": "medium",
    "code": null,
    "prompt": "nums is a rotated strictly increasing array with unique values. Return target index or -1., function signature: search_rotated_unique(nums: list[int], target: int) -> int, input examples: [{'case_id': 'PY100-M08-T01', 'input': [[4, 5, 6, 7, 0, 1, 2], 0], 'expected': 4}, {'case_id': 'PY100-M08-T02', 'input': [[4, 5, 6, 7, 0, 1, 2], 3], 'expected': -1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M08",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.29485151101835,
    "difficulty": "medium",
    "code": null,
    "prompt": "Return [first_index,last_index] of target in sorted array; [-1,-1] if absent., function signature: find_first_last(nums: list[int], target: int) -> list[int], input examples: [{'case_id': 'PY100-M09-T01', 'input': [[5, 7, 7, 8, 8, 10], 8], 'expected': [3, 4]}, {'case_id': 'PY100-M09-T02', 'input': [[5, 7, 7, 8], 6], 'expected': [-1, -1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M09",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.5388781776030856e-06,
    "generate_code_elapsed": 71.03809147700667,
    "difficulty": "medium",
    "code": "def merge_intervals(intervals):\n    if not intervals:\n        return []\n    intervals.sort()\n    result = []\n    for interval in intervals:\n        if not result:\n            result.append(interval)\n        else:\n            last = result[-1]\n            if last[1] < interval[0]:\n                result.append(interval)\n            else:\n                new_start = min(last[0], interval[0])\n                new_end = max(last[1], interval[1])\n                result[-1] = [new_start, new_end]\n    return result",
    "prompt": "Merge closed intervals [start,end] when overlapping or touching; return sorted merged intervals., function signature: merge_intervals(intervals: list[list[int]]) -> list[list[int]], input examples: [{'case_id': 'PY100-M10-T01', 'input': [[[1, 3], [2, 6], [8, 10], [15, 18]]], 'expected': [[1, 6], [8, 10], [15, 18]]}, {'case_id': 'PY100-M10-T02', 'input': [[[1, 4], [4, 5]]], 'expected': [[1, 5]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.13066295394674,
    "difficulty": "medium",
    "code": null,
    "prompt": "Insert a closed interval into nonoverlapping sorted closed intervals, merging overlap/touch., function signature: insert_interval(intervals: list[list[int]], new_interval: list[int]) -> list[list[int]], input examples: [{'case_id': 'PY100-M11-T01', 'input': [[[1, 3], [6, 9]], [2, 5]], 'expected': [[1, 5], [6, 9]]}, {'case_id': 'PY100-M11-T02', 'input': [[[1, 2], [3, 5], [6, 7], [8, 10], [12, 16]], [4, 8]], 'expected': [[1, 2], [3, 10], [12, 16]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M11",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.42536171199754,
    "difficulty": "medium",
    "code": null,
    "prompt": "Intervals are [start,end) with start<end. Return minimum number of rooms; end at time t can reuse a room starting at t., function signature: minimum_meeting_rooms(intervals: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-M12-T01', 'input': [[[0, 30], [5, 10], [15, 20]]], 'expected': 2}, {'case_id': 'PY100-M12-T02', 'input': [[[7, 10], [2, 4]]], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M12",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.22264540800825,
    "difficulty": "medium",
    "code": null,
    "prompt": "Pairs [course,prerequisite] impose prerequisite ordering. Return whether all courses can be finished., function signature: courses_possible(num_courses: int, prerequisites: list[list[int]]) -> bool, input examples: [{'case_id': 'PY100-M13-T01', 'input': [2, [[1, 0]]], 'expected': True}, {'case_id': 'PY100-M13-T02', 'input': [2, [[1, 0], [0, 1]]], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M13",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.98533335886896,
    "difficulty": "medium",
    "code": null,
    "prompt": "Directed edges [u,v] mean u before v; return lexicographically smallest valid topological order of nodes 0..n-1, or [] if a cycle., function signature: lexicographic_toposort(n: int, edges: list[list[int]]) -> list[int], input examples: [{'case_id': 'PY100-M14-T01', 'input': [4, [[0, 2], [1, 2]]], 'expected': [0, 1, 2, 3]}, {'case_id': 'PY100-M14-T02', 'input': [3, [[0, 1], [1, 2]]], 'expected': [0, 1, 2]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M14",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.09840739192441,
    "difficulty": "medium",
    "code": null,
    "prompt": "Rectangular grid of 0 and 1 characters. Count four-directionally connected components of 1 cells., function signature: island_count(grid: list[str]) -> int, input examples: [{'case_id': 'PY100-M15-T01', 'input': [['110', '010', '001']], 'expected': 2}, {'case_id': 'PY100-M15-T02', 'input': [['111', '111']], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M15",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 86.79881228203885,
    "difficulty": "medium",
    "code": null,
    "prompt": "Replace the four-connected component containing (sr,sc) with new_color; grid nonempty and coordinates valid., function signature: flood_fill(grid: list[list[int]], sr: int, sc: int, new_color: int) -> list[list[int]], input examples: [{'case_id': 'PY100-M16-T01', 'input': [[[1, 1, 1], [1, 1, 0], [1, 0, 1]], 1, 1, 2], 'expected': [[2, 2, 2], [2, 2, 0], [2, 0, 1]]}, {'case_id': 'PY100-M16-T02', 'input': [[[0]], 0, 0, 1], 'expected': [[1]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M16",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 132.73626092192717,
    "difficulty": "medium",
    "code": null,
    "prompt": "Find minimum four-directional moves from top-left to bottom-right through 0 cells (1 blocked); -1 if impossible., function signature: shortest_binary_grid(grid: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-M17-T01', 'input': [[[0, 0], [1, 0]]], 'expected': 2}, {'case_id': 'PY100-M17-T02', 'input': [[[0]]], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M17",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 111.55015554185957,
    "difficulty": "medium",
    "code": null,
    "prompt": "Undirected graph on nodes 0..n-1; return connected component sizes sorted ascending, counting isolated nodes., function signature: component_sizes(n: int, edges: list[list[int]]) -> list[int], input examples: [{'case_id': 'PY100-M18-T01', 'input': [5, [[0, 1], [1, 2], [3, 4]]], 'expected': [2, 3]}, {'case_id': 'PY100-M18-T02', 'input': [3, []], 'expected': [1, 1, 1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M18",
      "error": "No Python Code"
    }
  },
  {
    "passed": 3,
    "all": 6,
    "avg_code_run_elapsed": 6.339279934763908e-06,
    "generate_code_elapsed": 59.75289949099533,
    "difficulty": "medium",
    "code": "def valid_sudoku_partial(board):\n    # Check rows\n    for row in board:\n        if len(set(row)) != len(row):\n            return False\n    # Check columns\n    for col in range(9):\n        if len(set(board[col])) != len(board[col]):\n            return False\n    # Check 3x3 subboards\n    for i in range(3):\n        for j in range(3):\n            sub = [board[i + k*3][j + k*3] for k in range(3)]\n            if len(set(sub)) != len(sub):\n                return False\n    return True",
    "prompt": "9x9 rows of digits 1-9 or dots. Return whether every filled row, column, and 3x3 block has no duplicate digit., function signature: valid_sudoku_partial(board: list[str]) -> bool, input examples: [{'case_id': 'PY100-M19-T01', 'input': [['53..7....', '6..195...', '.98....6.', '8...6...3', '4..8.3..1', '7...2...6', '.6....28.', '...419..5', '....8..79']], 'expected': True}, {'case_id': 'PY100-M19-T02', 'input': [['.........', '.........', '.........', '.........', '.........', '.........', '.........', '.........', '.........']], 'expected': True}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M19-T01",
        "error": "Wrong answer",
        "expected": "True",
        "actual": "False"
      },
      {
        "case_id": "PY100-M19-T02",
        "error": "Wrong answer",
        "expected": "True",
        "actual": "False"
      },
      {
        "case_id": "PY100-M19-T06",
        "error": "Wrong answer",
        "expected": "False",
        "actual": "True"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.30466760718264,
    "difficulty": "medium",
    "code": null,
    "prompt": "Count decodings of digit string using 1->A through 26->Z, no leading-zero codes. Empty string has 0 decodings., function signature: decode_digit_messages(text: str) -> int, input examples: [{'case_id': 'PY100-M20-T01', 'input': ['12'], 'expected': 2}, {'case_id': 'PY100-M20-T02', 'input': ['226'], 'expected': 3}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M20",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.588579905529817e-06,
    "generate_code_elapsed": 44.88589389482513,
    "difficulty": "medium",
    "code": "def climb_one_two(n: int) -> int:\n    if n == 0:\n        return 1\n    elif n == 1:\n        return 1\n    a, b = 1, 1\n    for _ in range(2, n + 1):\n        c = a + b\n        a, b = b, c\n    return b",
    "prompt": "Return number of ways to climb n steps using jumps of 1 or 2. n=0 has one empty way., function signature: climb_one_two(n: int) -> int, input examples: [{'case_id': 'PY100-M21-T01', 'input': [0], 'expected': 1}, {'case_id': 'PY100-M21-T02', 'input': [1], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.37074096105061,
    "difficulty": "medium",
    "code": null,
    "prompt": "Unlimited positive coin denominations; return minimum coins to reach nonnegative amount, or -1., function signature: min_coin_change(coins: list[int], amount: int) -> int, input examples: [{'case_id': 'PY100-M22-T01', 'input': [[1, 2, 5], 11], 'expected': 3}, {'case_id': 'PY100-M22-T02', 'input': [[2], 3], 'expected': -1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M22",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.60696589993313,
    "difficulty": "medium",
    "code": null,
    "prompt": "Length of a strictly increasing (not necessarily contiguous) subsequence. Equal values do not extend., function signature: lis_length(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-M23-T01', 'input': [[10, 9, 2, 5, 3, 7, 101, 18]], 'expected': 4}, {'case_id': 'PY100-M23-T02', 'input': [[0, 1, 0, 3, 2, 3]], 'expected': 4}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M23",
      "error": "No Python Code"
    }
  },
  {
    "passed": 3,
    "all": 6,
    "avg_code_run_elapsed": 1.5179820669194063e-05,
    "generate_code_elapsed": 63.62375792907551,
    "difficulty": "medium",
    "code": "def edit_distance(a, b):\n    m = len(a)\n    n = len(b)\n    dp = [[0] * (n + 1) for _ in range(m + 1)]\n    for i in range(m + 1):\n        for j in range(n + 1):\n            if i == 0:\n                dp[i][j] = j\n            elif j == 0:\n                dp[i][j] = i\n            else:\n                cost = 1\n                if a[i - 1] == b[j - 1]:\n                    cost = 0\n                dp[i][j] = min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1] + cost)\n    return dp[m][n]",
    "prompt": "Minimum single-character insertions, deletions or substitutions to transform a into b., function signature: edit_distance(a: str, b: str) -> int, input examples: [{'case_id': 'PY100-M24-T01', 'input': ['horse', 'ros'], 'expected': 3}, {'case_id': 'PY100-M24-T02', 'input': ['intention', 'execution'], 'expected': 5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M24-T01",
        "error": "Wrong answer",
        "expected": "3",
        "actual": "1"
      },
      {
        "case_id": "PY100-M24-T02",
        "error": "Wrong answer",
        "expected": "5",
        "actual": "1"
      },
      {
        "case_id": "PY100-M24-T06",
        "error": "Wrong answer",
        "expected": "3",
        "actual": "1"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 7.800680274764696e-06,
    "generate_code_elapsed": 73.6422619218938,
    "difficulty": "medium",
    "code": "def lcs_length(a, b):\n    n = len(a)\n    m = len(b)\n    dp = [[0] * (m + 1) for _ in range(n + 1)]\n    for i in range(1, n + 1):\n        for j in range(1, m + 1):\n            if a[i-1] == b[j-1]:\n                dp[i][j] = dp[i-1][j-1] + 1\n            else:\n                dp[i][j] = max(dp[i-1][j], dp[i][j-1])\n    return dp[n][m]",
    "prompt": "Length of longest common subsequence, not necessarily contiguous., function signature: lcs_length(a: str, b: str) -> int, input examples: [{'case_id': 'PY100-M25-T01', 'input': ['abcde', 'ace'], 'expected': 3}, {'case_id': 'PY100-M25-T02', 'input': ['abc', 'abc'], 'expected': 3}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.34353031916544,
    "difficulty": "medium",
    "code": null,
    "prompt": "Each item may be selected at most once, weight positive, value nonnegative; maximize total value within capacity., function signature: knapsack_01(weights: list[int], values: list[int], capacity: int) -> int, input examples: [{'case_id': 'PY100-M26-T01', 'input': [[2, 3, 4], [4, 5, 6], 5], 'expected': 9}, {'case_id': 'PY100-M26-T02', 'input': [[1, 2], [10, 1], 0], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M26",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.23072479199618,
    "difficulty": "medium",
    "code": null,
    "prompt": "Determine whether any subset (including empty) sums to target; values may be negative., function signature: subset_sum_exists(nums: list[int], target: int) -> bool, input examples: [{'case_id': 'PY100-M27-T01', 'input': [[3, 34, 4, 12, 5, 2], 9], 'expected': True}, {'case_id': 'PY100-M27-T02', 'input': [[3, 34, 4, 12, 5, 2], 30], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M27",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.75288979010656,
    "difficulty": "medium",
    "code": null,
    "prompt": "Nonnegative integers; return whether they can be split into two subsets of equal sum; empty list is true., function signature: equal_partition(nums: list[int]) -> bool, input examples: [{'case_id': 'PY100-M28-T01', 'input': [[1, 5, 11, 5]], 'expected': True}, {'case_id': 'PY100-M28-T02', 'input': [[1, 2, 3, 5]], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M28",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 83.98075663903728,
    "difficulty": "medium",
    "code": null,
    "prompt": "Unit-width histogram bars with nonnegative heights. Return maximum axis-aligned rectangle area within bars., function signature: largest_histogram_rectangle(heights: list[int]) -> int, input examples: [{'case_id': 'PY100-M29-T01', 'input': [[2, 1, 5, 6, 2, 3]], 'expected': 10}, {'case_id': 'PY100-M29-T02', 'input': [[]], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M29",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 85.02402372704819,
    "difficulty": "medium",
    "code": null,
    "prompt": "For each element return first strictly greater value to its right, or -1., function signature: next_greater_right(nums: list[int]) -> list[int], input examples: [{'case_id': 'PY100-M30-T01', 'input': [[2, 1, 2, 4, 3]], 'expected': [4, 2, 4, -1, -1]}, {'case_id': 'PY100-M30-T02', 'input': [[1, 2, 3]], 'expected': [2, 3, -1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M30",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.12593240407296,
    "difficulty": "medium",
    "code": null,
    "prompt": "For each day return days until a strictly warmer future temperature, or 0., function signature: days_until_warmer(temperatures: list[int]) -> list[int], input examples: [{'case_id': 'PY100-M31-T01', 'input': [[73, 74, 75, 71, 69, 72, 76, 73]], 'expected': [1, 1, 4, 2, 1, 1, 0, 0]}, {'case_id': 'PY100-M31-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M31",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.44756792695262,
    "difficulty": "medium",
    "code": null,
    "prompt": "Group exact-case anagrams; sort words within each group; sort groups by their first word alphabetically. Empty input returns []., function signature: sorted_anagram_groups(words: list[str]) -> list[list[str]], input examples: [{'case_id': 'PY100-M32-T01', 'input': [['eat', 'tea', 'tan', 'ate', 'nat', 'bat']], 'expected': [['ate', 'eat', 'tea'], ['bat'], ['nat', 'tan']]}, {'case_id': 'PY100-M32-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M32",
      "error": "No Python Code"
    }
  },
  {
    "passed": 1,
    "all": 6,
    "avg_code_run_elapsed": 9.69312774638335e-07,
    "generate_code_elapsed": 51.978629742981866,
    "difficulty": "medium",
    "code": "from collections import Counter\n\ndef top_k_frequent_words(words, k):\n    freq = Counter(words)\n    word_freqs = list(freq.items())\n    # Sort by frequency descending, then by word ascending\n    word_freqs.sort(key=lambda x: (-x[0], x[1]))\n    return word_freqs[:k]",
    "prompt": "Return at most k distinct words by descending frequency, breaking ties alphabetically; k>=0., function signature: top_k_frequent_words(words: list[str], k: int) -> list[str], input examples: [{'case_id': 'PY100-M33-T01', 'input': [['i', 'love', 'leetcode', 'i', 'love', 'coding'], 2], 'expected': ['i', 'love']}, {'case_id': 'PY100-M33-T02', 'input': [['b', 'a', 'b', 'c', 'a'], 3], 'expected': ['a', 'b', 'c']}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M33-T01",
        "error": "TypeError: bad operand type for unary -: 'str'"
      },
      {
        "case_id": "PY100-M33-T02",
        "error": "TypeError: bad operand type for unary -: 'str'"
      },
      {
        "case_id": "PY100-M33-T04",
        "error": "TypeError: bad operand type for unary -: 'str'"
      },
      {
        "case_id": "PY100-M33-T05",
        "error": "TypeError: bad operand type for unary -: 'str'"
      },
      {
        "case_id": "PY100-M33-T06",
        "error": "TypeError: bad operand type for unary -: 'str'"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.259481405218442e-06,
    "generate_code_elapsed": 34.57524015917443,
    "difficulty": "medium",
    "code": "import os\n\ndef simplify_unix_path(path: str) -> str:\n    return os.path.abspath(path)",
    "prompt": "Canonicalize absolute Unix path by collapsing repeated slashes, . and ..; root cannot be traversed above., function signature: simplify_unix_path(path: str) -> str, input examples: [{'case_id': 'PY100-M34-T01', 'input': ['/home/'], 'expected': '/home'}, {'case_id': 'PY100-M34-T02', 'input': ['/../'], 'expected': '/'}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.45986582897604,
    "difficulty": "medium",
    "code": null,
    "prompt": "Shortest substring containing every character of chars with multiplicity. Tie: earliest start. Return empty if impossible or chars empty., function signature: minimum_cover_window(text: str, chars: str) -> str, input examples: [{'case_id': 'PY100-M35-T01', 'input': ['ADOBECODEBANC', 'ABC'], 'expected': 'BANC'}, {'case_id': 'PY100-M35-T02', 'input': ['a', 'aa'], 'expected': ''}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M35",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.37978227715939,
    "difficulty": "medium",
    "code": null,
    "prompt": "Validate strict dotted-decimal IPv4: 4 segments each 0..255; no leading zero except literal 0; ASCII digits only., function signature: valid_ipv4(text: str) -> bool, input examples: [{'case_id': 'PY100-M36-T01', 'input': ['192.168.0.1'], 'expected': True}, {'case_id': 'PY100-M36-T02', 'input': ['01.2.3.4'], 'expected': False}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M36",
      "error": "No Python Code"
    }
  },
  {
    "passed": 5,
    "all": 6,
    "avg_code_run_elapsed": 9.19137770930926e-06,
    "generate_code_elapsed": 71.46014135796577,
    "difficulty": "medium",
    "code": "def compare_versions(a, b):\n    a_list = list(map(int, a.split('.')))\n    b_list = list(map(int, b.split('.')))\n    for i in range(max(len(a_list), len(b_list))):\n        if i < len(a_list) and i < len(b_list):\n            if a_list[i] != b_list[i]:\n                if a_list[i] > b_list[i]:\n                    return 1\n                else:\n                    return -1\n    return 0",
    "prompt": "Dot-separated nonnegative integer version components; trailing zero components ignored. Return -1, 0 or 1., function signature: compare_versions(a: str, b: str) -> int, input examples: [{'case_id': 'PY100-M37-T01', 'input': ['1.01', '1.001'], 'expected': 0}, {'case_id': 'PY100-M37-T02', 'input': ['1.0', '1.0.0'], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M37-T06",
        "error": "Wrong answer",
        "expected": "1",
        "actual": "0"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.09838077495806,
    "difficulty": "medium",
    "code": null,
    "prompt": "Evaluate valid Reverse Polish notation with +,-,*,/; integer division truncates toward zero; no division by zero., function signature: evaluate_rpn(tokens: list[str]) -> int, input examples: [{'case_id': 'PY100-M38-T01', 'input': [['2', '1', '+', '3', '*']], 'expected': 9}, {'case_id': 'PY100-M38-T02', 'input': [['4', '13', '5', '/', '+']], 'expected': 6}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M38",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 6.072611237565677e-06,
    "generate_code_elapsed": 51.73751087998971,
    "difficulty": "medium",
    "code": "import itertools\n\ndef unique_permutations(nums):\n    return list(itertools.permutations(nums))",
    "prompt": "Return all distinct permutations sorted lexicographically, each permutation as a list. Input length <=7., function signature: unique_permutations(nums: list[int]) -> list[list[int]], input examples: [{'case_id': 'PY100-M39-T01', 'input': [[1, 1, 2]], 'expected': [[1, 1, 2], [1, 2, 1], [2, 1, 1]]}, {'case_id': 'PY100-M39-T02', 'input': [[1, 2, 3]], 'expected': [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M39-T01",
        "error": "Wrong answer",
        "expected": "[[1, 1, 2], [1, 2, 1], [2, 1, 1]]",
        "actual": "[(1, 1, 2), (1, 2, 1), (1, 1, 2), (1, 2, 1), (2, 1, 1), (2, 1, 1)]"
      },
      {
        "case_id": "PY100-M39-T02",
        "error": "Wrong answer",
        "expected": "[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]",
        "actual": "[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)]"
      },
      {
        "case_id": "PY100-M39-T03",
        "error": "Wrong answer",
        "expected": "[[]]",
        "actual": "[()]"
      },
      {
        "case_id": "PY100-M39-T04",
        "error": "Wrong answer",
        "expected": "[[5]]",
        "actual": "[(5,)]"
      },
      {
        "case_id": "PY100-M39-T05",
        "error": "Wrong answer",
        "expected": "[[2, 2]]",
        "actual": "[(2, 2), (2, 2)]"
      },
      {
        "case_id": "PY100-M39-T06",
        "error": "Wrong answer",
        "expected": "[[-1, 0, 0], [0, -1, 0], [0, 0, -1]]",
        "actual": "[(0, -1, 0), (0, 0, -1), (-1, 0, 0), (-1, 0, 0), (0, 0, -1), (0, -1, 0)]"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 4.489983742435773e-06,
    "generate_code_elapsed": 32.01005449378863,
    "difficulty": "medium",
    "code": "import itertools\n\ndef combinations_k(n: int, k: int) -> list[list[int]]:\n    if k < 0 or k > n:\n        return []\n    return list(itertools.combinations(range(1, n + 1), k))",
    "prompt": "Generate lexicographically sorted k-element strictly increasing combinations from numbers 1..n; 0<=k<=n<=10., function signature: combinations_k(n: int, k: int) -> list[list[int]], input examples: [{'case_id': 'PY100-M40-T01', 'input': [4, 2], 'expected': [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]}, {'case_id': 'PY100-M40-T02', 'input': [1, 1], 'expected': [[1]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M40-T01",
        "error": "Wrong answer",
        "expected": "[[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]]",
        "actual": "[(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)]"
      },
      {
        "case_id": "PY100-M40-T02",
        "error": "Wrong answer",
        "expected": "[[1]]",
        "actual": "[(1,)]"
      },
      {
        "case_id": "PY100-M40-T03",
        "error": "Wrong answer",
        "expected": "[[]]",
        "actual": "[()]"
      },
      {
        "case_id": "PY100-M40-T04",
        "error": "Wrong answer",
        "expected": "[[]]",
        "actual": "[()]"
      },
      {
        "case_id": "PY100-M40-T05",
        "error": "Wrong answer",
        "expected": "[[1, 2, 3, 4, 5]]",
        "actual": "[(1, 2, 3, 4, 5)]"
      },
      {
        "case_id": "PY100-M40-T06",
        "error": "Wrong answer",
        "expected": "[[1], [2], [3], [4], [5]]",
        "actual": "[(1,), (2,), (3,), (4,), (5,)]"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.09721978218295,
    "difficulty": "medium",
    "code": null,
    "prompt": "Digits 2..9; return phone keypad letter combinations in lexicographic order, or [] for empty input., function signature: phone_keypad_words(digits: str) -> list[str], input examples: [{'case_id': 'PY100-M41-T01', 'input': ['23'], 'expected': ['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']}, {'case_id': 'PY100-M41-T02', 'input': [''], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M41",
      "error": "No Python Code"
    }
  },
  {
    "passed": 4,
    "all": 6,
    "avg_code_run_elapsed": 8.45912533501784e-06,
    "generate_code_elapsed": 58.202128608943895,
    "difficulty": "medium",
    "code": "from collections import Counter\n\ndef kth_largest_with_duplicates(nums, k):\n    freq = Counter(nums)\n    unique = sorted(freq.keys(), reverse=True)\n    return unique[k - 1]",
    "prompt": "Return kth largest element counting duplicates; 1<=k<=len(nums)., function signature: kth_largest_with_duplicates(nums: list[int], k: int) -> int, input examples: [{'case_id': 'PY100-M42-T01', 'input': [[3, 2, 1, 5, 6, 4], 2], 'expected': 5}, {'case_id': 'PY100-M42-T02', 'input': [[3, 2, 3, 1, 2, 4, 5, 5, 6], 4], 'expected': 4}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-M42-T02",
        "error": "Wrong answer",
        "expected": "4",
        "actual": "3"
      },
      {
        "case_id": "PY100-M42-T04",
        "error": "IndexError: list index out of range"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.427585129936536e-06,
    "generate_code_elapsed": 45.69699861202389,
    "difficulty": "medium",
    "code": "def k_closest_points(points, k):\n    # Sort the points based on squared distance, then x, then y\n    sorted_points = sorted(points, key=lambda p: (p[0]**2 + p[1]**2, p[0], p[1]))\n    return sorted_points[:k]",
    "prompt": "Return k points closest to origin by squared distance; break ties by x then y, preserving duplicates., function signature: k_closest_points(points: list[list[int]], k: int) -> list[list[int]], input examples: [{'case_id': 'PY100-M43-T01', 'input': [[[1, 3], [-2, 2]], 1], 'expected': [[-2, 2]]}, {'case_id': 'PY100-M43-T02', 'input': [[[3, 3], [5, -1], [-2, 4]], 2], 'expected': [[3, 3], [-2, 4]]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.13862734707072,
    "difficulty": "medium",
    "code": null,
    "prompt": "Count pairs i<j with nums[i]>nums[j]. Equal elements do not count., function signature: count_inversions(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-M44-T01', 'input': [[2, 4, 1, 3, 5]], 'expected': 3}, {'case_id': 'PY100-M44-T02', 'input': [[]], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M44",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.24845125386491,
    "difficulty": "medium",
    "code": null,
    "prompt": "Max profit with at most two nonoverlapping buy-sell transactions; cannot hold two shares simultaneously., function signature: two_stock_transactions(prices: list[int]) -> int, input examples: [{'case_id': 'PY100-M45-T01', 'input': [[3, 3, 5, 0, 0, 3, 1, 4]], 'expected': 6}, {'case_id': 'PY100-M45-T02', 'input': [[1, 2, 3, 4, 5]], 'expected': 4}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-M45",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.15355216991156,
    "difficulty": "hard",
    "code": null,
    "prompt": "Minimum number of nonempty dictionary words concatenated to form text exactly, with unlimited reuse; -1 if impossible, 0 for empty text., function signature: minimum_word_break(text: str, dictionary: list[str]) -> int, input examples: [{'case_id': 'PY100-H01-T01', 'input': ['leetcode', ['leet', 'code']], 'expected': 2}, {'case_id': 'PY100-H01-T02', 'input': ['catsanddog', ['cats', 'cat', 'and', 'sand', 'dog']], 'expected': 3}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H01",
      "error": "No Python Code"
    }
  },
  {
    "passed": 4,
    "all": 6,
    "avg_code_run_elapsed": 3.256291771928469e-06,
    "generate_code_elapsed": 30.89675236796029,
    "difficulty": "hard",
    "code": "def wildcard_match(text: str, pattern: str) -> bool:\n    return pattern.find(text) != -1",
    "prompt": "Match entire text to wildcard pattern: ? matches one character, * matches any sequence including empty; all other characters literal., function signature: wildcard_match(text: str, pattern: str) -> bool, input examples: [{'case_id': 'PY100-H02-T01', 'input': ['aa', 'a'], 'expected': False}, {'case_id': 'PY100-H02-T02', 'input': ['aa', '*'], 'expected': True}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-H02-T02",
        "error": "Wrong answer",
        "expected": "True",
        "actual": "False"
      },
      {
        "case_id": "PY100-H02-T04",
        "error": "Wrong answer",
        "expected": "True",
        "actual": "False"
      }
    ]
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 3.345430983851353e-05,
    "generate_code_elapsed": 37.545649657957256,
    "difficulty": "hard",
    "code": "import re\n\ndef simple_regex_fullmatch(text: str, pattern: str) -> bool:\n    return re.fullmatch(pattern, text) is not None",
    "prompt": "Full match using . for any single character and * for zero or more of immediately preceding atom. Pattern guaranteed valid (no leading or consecutive *)., function signature: simple_regex_fullmatch(text: str, pattern: str) -> bool, input examples: [{'case_id': 'PY100-H03-T01', 'input': ['aa', 'a'], 'expected': False}, {'case_id': 'PY100-H03-T02', 'input': ['aa', 'a*'], 'expected': True}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.47581093199551,
    "difficulty": "hard",
    "code": null,
    "prompt": "Number of index-distinct subsequences of source exactly equal to target. Empty target has one subsequence., function signature: count_distinct_subsequences(source: str, target: str) -> int, input examples: [{'case_id': 'PY100-H04-T01', 'input': ['rabbbit', 'rabbit'], 'expected': 3}, {'case_id': 'PY100-H04-T02', 'input': ['babgbag', 'bag'], 'expected': 5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H04",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 6.8249646574258804e-06,
    "generate_code_elapsed": 78.82478665700182,
    "difficulty": "hard",
    "code": "def count_palindrome_substrings(text: str) -> int:\n    n = len(text)\n    count = 0\n    for i in range(n):\n        for j in range(i, n):\n            substring = text[i:j+1]\n            is_pal = True\n            for k in range(len(substring) // 2):\n                if substring[k] != substring[-(k+1)]:\n                    is_pal = False\n                    break\n            if is_pal:\n                count += 1\n    return count",
    "prompt": "Count all nonempty palindromic substrings by their positions (repeats count separately)., function signature: count_palindrome_substrings(text: str) -> int, input examples: [{'case_id': 'PY100-H05-T01', 'input': ['abc'], 'expected': 3}, {'case_id': 'PY100-H05-T02', 'input': ['aaa'], 'expected': 6}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.24793351884,
    "difficulty": "hard",
    "code": null,
    "prompt": "Length of longest palindromic subsequence, not necessarily contiguous., function signature: longest_palindrome_subsequence(text: str) -> int, input examples: [{'case_id': 'PY100-H06-T01', 'input': ['bbbab'], 'expected': 4}, {'case_id': 'PY100-H06-T02', 'input': ['cbbd'], 'expected': 2}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H06",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.4625727578532,
    "difficulty": "hard",
    "code": null,
    "prompt": "n matrices have dimensions p[i] by p[i+1]. Return minimum scalar multiplication count over all parenthesizations. Positive dimensions, len>=2., function signature: matrix_chain_min_cost(dimensions: list[int]) -> int, input examples: [{'case_id': 'PY100-H07-T01', 'input': [[10, 30, 5, 60]], 'expected': 4500}, {'case_id': 'PY100-H07-T02', 'input': [[40, 20, 30, 10, 30]], 'expected': 26000}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H07",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.33408053102903,
    "difficulty": "hard",
    "code": null,
    "prompt": "Burst positive integer balloons in any order; coins = value of balloon times adjacent remaining values, boundary neighbors count as 1. Maximize coins., function signature: burst_balloons_max(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-H08-T01', 'input': [[3, 1, 5, 8]], 'expected': 167}, {'case_id': 'PY100-H08-T02', 'input': [[1, 5]], 'expected': 10}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H08",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.02693367796019,
    "difficulty": "hard",
    "code": null,
    "prompt": "Each job [start,end,profit], start<end, profit>=0; choose nonoverlapping half-open jobs maximizing profit. End==next start allowed., function signature: weighted_job_scheduling(jobs: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-H09-T01', 'input': [[[1, 3, 50], [2, 4, 10], [3, 5, 40], [3, 6, 70]]], 'expected': 120}, {'case_id': 'PY100-H09-T02', 'input': [[[1, 2, 10], [2, 3, 20]]], 'expected': 30}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H09",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.65010817185976,
    "difficulty": "hard",
    "code": null,
    "prompt": "nums[i] gives max forward jump length. Return minimum jumps from index 0 to last index, -1 if unreachable; empty list returns 0., function signature: minimum_jump_count(nums: list[int]) -> int, input examples: [{'case_id': 'PY100-H10-T01', 'input': [[2, 3, 1, 1, 4]], 'expected': 2}, {'case_id': 'PY100-H10-T02', 'input': [[3, 2, 1, 0, 4]], 'expected': -1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H10",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.52584184706211,
    "difficulty": "hard",
    "code": null,
    "prompt": "Unit-width nonnegative bars; return total units of trapped rainwater., function signature: trap_rain_water(heights: list[int]) -> int, input examples: [{'case_id': 'PY100-H11-T01', 'input': [[0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]], 'expected': 6}, {'case_id': 'PY100-H11-T02', 'input': [[4, 2, 0, 3, 2, 5]], 'expected': 9}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H11",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 84.54271620512009,
    "difficulty": "hard",
    "code": null,
    "prompt": "Return maximum in every contiguous window of size k. nums nonempty, 1<=k<=len(nums)., function signature: sliding_window_maximum(nums: list[int], k: int) -> list[int], input examples: [{'case_id': 'PY100-H12-T01', 'input': [[1, 3, -1, -3, 5, 3, 6, 7], 3], 'expected': [3, 3, 5, 5, 6, 7]}, {'case_id': 'PY100-H12-T02', 'input': [[1], 1], 'expected': [1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H12",
      "error": "No Python Code"
    }
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 5.290300274888675e-06,
    "generate_code_elapsed": 54.375603090040386,
    "difficulty": "hard",
    "code": "def sliding_window_median(nums, k):\n    n = len(nums)\n    result = []\n    for i in range(n - k + 1):\n        subarray = nums[i:i+k]\n        subarray.sort()\n        if len(subarray) % 2 == 0:\n            median = (subarray[k//2 - 1] + subarray[k//2]) / 2.0\n        else:\n            median = subarray[k//2]\n        result.append(median)\n    return result",
    "prompt": "Return median per contiguous size-k window. For even k use arithmetic mean of two middle numbers; results numerical., function signature: sliding_window_median(nums: list[int], k: int) -> list[float], input examples: [{'case_id': 'PY100-H13-T01', 'input': [[1, 3, -1, -3, 5, 3, 6, 7], 3], 'expected': [1, -1, -1, 3, 5, 6]}, {'case_id': 'PY100-H13-T02', 'input': [[1, 2, 3, 4], 2], 'expected': [1.5, 2.5, 3.5]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 6,
    "all": 6,
    "avg_code_run_elapsed": 4.573026672005653e-06,
    "generate_code_elapsed": 51.67539335414767,
    "difficulty": "hard",
    "code": "def kth_smallest_pair_distance(nums, k):\n    n = len(nums)\n    differences = []\n    for i in range(n):\n        for j in range(i + 1, n):\n            differences.append(abs(nums[i] - nums[j]))\n    differences.sort()\n    return differences[k - 1]",
    "prompt": "Among all unordered index pairs i<j, find kth smallest absolute difference counting duplicate distances; len>=2, valid k., function signature: kth_smallest_pair_distance(nums: list[int], k: int) -> int, input examples: [{'case_id': 'PY100-H14-T01', 'input': [[1, 3, 1], 1], 'expected': 0}, {'case_id': 'PY100-H14-T02', 'input': [[1, 6, 1], 3], 'expected': 5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": []
  },
  {
    "passed": 2,
    "all": 6,
    "avg_code_run_elapsed": 3.726609672109286e-06,
    "generate_code_elapsed": 37.92555646109395,
    "difficulty": "hard",
    "code": "def median_two_sorted(a, b):\n    combined = a + b\n    n = len(combined)\n    if n % 2 == 1:\n        return combined[n // 2]\n    else:\n        return (combined[n // 2] + combined[n // 2 + 1]) / 2",
    "prompt": "Both inputs sorted nondecreasing, combined length >=1. Return exact median, using arithmetic mean for even count., function signature: median_two_sorted(a: list[int], b: list[int]) -> float, input examples: [{'case_id': 'PY100-H15-T01', 'input': [[1, 3], [2]], 'expected': 2}, {'case_id': 'PY100-H15-T02', 'input': [[1, 2], [3, 4]], 'expected': 2.5}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-H15-T01",
        "error": "Wrong answer",
        "expected": "2",
        "actual": "3"
      },
      {
        "case_id": "PY100-H15-T02",
        "error": "Wrong answer",
        "expected": "2.5",
        "actual": "3.5"
      },
      {
        "case_id": "PY100-H15-T05",
        "error": "Wrong answer",
        "expected": "-1.5",
        "actual": "-1.0"
      },
      {
        "case_id": "PY100-H15-T06",
        "error": "Wrong answer",
        "expected": "2.5",
        "actual": "3.5"
      }
    ]
  },
  {
    "passed": 1,
    "all": 6,
    "avg_code_run_elapsed": 7.972819730639458e-06,
    "generate_code_elapsed": 58.642480940092355,
    "difficulty": "hard",
    "code": "def count_smaller_to_right(nums):\n    result = []\n    for i in range(len(nums) - 1):\n        elements_after = nums[i+1:]\n        count = sum(1 for num in elements_after if num < nums[i])\n        result.append(count)\n    return result",
    "prompt": "For each index, count strictly smaller elements to its right, retaining original positions., function signature: count_smaller_to_right(nums: list[int]) -> list[int], input examples: [{'case_id': 'PY100-H16-T01', 'input': [[5, 2, 6, 1]], 'expected': [2, 1, 1, 0]}, {'case_id': 'PY100-H16-T02', 'input': [[]], 'expected': []}] Do not include Markdown or any additional text. Only Python Code",
    "errors": [
      {
        "case_id": "PY100-H16-T01",
        "error": "Wrong answer",
        "expected": "[2, 1, 1, 0]",
        "actual": "[2, 1, 1]"
      },
      {
        "case_id": "PY100-H16-T03",
        "error": "Wrong answer",
        "expected": "[0, 0, 0]",
        "actual": "[0, 0]"
      },
      {
        "case_id": "PY100-H16-T04",
        "error": "Wrong answer",
        "expected": "[2, 1, 0]",
        "actual": "[2, 1]"
      },
      {
        "case_id": "PY100-H16-T05",
        "error": "Wrong answer",
        "expected": "[2, 1, 0]",
        "actual": "[2, 1]"
      },
      {
        "case_id": "PY100-H16-T06",
        "error": "Wrong answer",
        "expected": "[2, 0, 0]",
        "actual": "[2, 0]"
      }
    ]
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.41597315319814,
    "difficulty": "hard",
    "code": null,
    "prompt": "Directed weighted edges [u,v,w] with nonnegative integer weights; shortest path from source to each node, -1 if unreachable., function signature: single_source_shortest_paths(n: int, edges: list[list[int]], source: int) -> list[int], input examples: [{'case_id': 'PY100-H17-T01', 'input': [5, [[0, 1, 2], [1, 2, 3], [0, 3, 1], [3, 2, 1]], 0], 'expected': [0, 2, 2, 1, -1]}, {'case_id': 'PY100-H17-T02', 'input': [3, [], 0], 'expected': [0, -1, -1]}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H17",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.81530538806692,
    "difficulty": "hard",
    "code": null,
    "prompt": "Directed flights [u,v,cost] with positive costs. Minimum fare from src to dst using at most max_stops intermediate cities (at most max_stops+1 edges), or -1., function signature: flight_with_stops(n: int, flights: list[list[int]], src: int, dst: int, max_stops: int) -> int, input examples: [{'case_id': 'PY100-H18-T01', 'input': [4, [[0, 1, 100], [1, 2, 100], [2, 3, 100], [0, 3, 500]], 0, 3, 1], 'expected': 500}, {'case_id': 'PY100-H18-T02', 'input': [4, [[0, 1, 100], [1, 2, 100], [2, 3, 100], [0, 3, 500]], 0, 3, 2], 'expected': 300}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H18",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.26259783282876,
    "difficulty": "hard",
    "code": null,
    "prompt": "Undirected graph nodes 0..n-1, n<=10. Start anywhere; shortest walk visiting all nodes at least once, repeating allowed; -1 if disconnected., function signature: shortest_walk_visit_all(n: int, edges: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-H19-T01', 'input': [4, [[0, 1], [0, 2], [0, 3]]], 'expected': 4}, {'case_id': 'PY100-H19-T02', 'input': [5, [[0, 1], [1, 2], [2, 3], [3, 4]]], 'expected': 4}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H19",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.49876112793572,
    "difficulty": "hard",
    "code": null,
    "prompt": "Nonempty rectangular nonnegative grid. Start top-left, move only right/down; minimum sum including endpoints., function signature: min_grid_path_sum(grid: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-H20-T01', 'input': [[[1, 3, 1], [1, 5, 1], [4, 2, 1]]], 'expected': 7}, {'case_id': 'PY100-H20-T02', 'input': [[[1, 2, 3], [4, 5, 6]]], 'expected': 12}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H20",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.30194532102905,
    "difficulty": "hard",
    "code": null,
    "prompt": "Rectangular grid 0 open, 1 blocked. Count paths top-left to bottom-right moving only right/down, avoiding blocked cells., function signature: unique_paths_obstacles(grid: list[list[int]]) -> int, input examples: [{'case_id': 'PY100-H21-T01', 'input': [[[0, 0, 0], [0, 1, 0], [0, 0, 0]]], 'expected': 2}, {'case_id': 'PY100-H21-T02', 'input': [[[0, 1], [0, 0]]], 'expected': 1}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H21",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.33554184390232,
    "difficulty": "hard",
    "code": null,
    "prompt": "Rectangular rows of characters 0/1, find largest area rectangle consisting only of 1 cells., function signature: maximal_one_rectangle(grid: list[str]) -> int, input examples: [{'case_id': 'PY100-H22-T01', 'input': [['10100', '10111', '11111', '10010']], 'expected': 6}, {'case_id': 'PY100-H22-T02', 'input': [['0']], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H22",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.6321641090326,
    "difficulty": "hard",
    "code": null,
    "prompt": "Minimum cuts dividing string into nonempty palindromic substrings; empty text requires zero cuts., function signature: palindrome_partition_cuts(text: str) -> int, input examples: [{'case_id': 'PY100-H23-T01', 'input': ['aab'], 'expected': 1}, {'case_id': 'PY100-H23-T02', 'input': ['a'], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H23",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.80996680189855,
    "difficulty": "hard",
    "code": null,
    "prompt": "Rectangular binary character grid; area of largest all-1 square (0 if none)., function signature: maximal_one_square(grid: list[str]) -> int, input examples: [{'case_id': 'PY100-H24-T01', 'input': [['10100', '10111', '11111', '10010']], 'expected': 4}, {'case_id': 'PY100-H24-T02', 'input': [['0']], 'expected': 0}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H24",
      "error": "No Python Code"
    }
  },
  {
    "passed": 0,
    "all": 6,
    "avg_code_run_elapsed": 0.0,
    "generate_code_elapsed": 87.57059324509464,
    "difficulty": "hard",
    "code": null,
    "prompt": "Stick from 0 to length, distinct interior cut positions. Cost per cut is current segment length. Find minimum total cost., function signature: minimum_stick_cut_cost(length: int, cuts: list[int]) -> int, input examples: [{'case_id': 'PY100-H25-T01', 'input': [7, [1, 3, 4, 5]], 'expected': 16}, {'case_id': 'PY100-H25-T02', 'input': [9, [5, 6, 1, 4, 2]], 'expected': 22}] Do not include Markdown or any additional text. Only Python Code",
    "errors": {
      "case_id": "PY100-H25",
      "error": "No Python Code"
    }
  }
]