{"id": "stagec_000001", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(377) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(377) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000002", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(4172) == 2714\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4172) == 2714\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000003", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('a}(bb}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a}(bb}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000004", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('acdebbea') == 'acdeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acdebbea') == 'acdeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000005", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([41, 33, 17, 17]) == [17, 17, 33, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 33, 17, 17]) == [17, 17, 33, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000006", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(48, 41) == 1968\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(48, 41) == 1968\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000007", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(10, 19) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(10, 19) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000008", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=auto; path=off') == {'user': 'auto', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; path=off') == {'user': 'auto', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000009", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([16, 5, 5, 15]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 5, 5, 15]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000010", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h45m28s') == 13528\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h45m28s') == 13528\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000011", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[()()]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[()()]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000012", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(8180) == 90\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8180) == 90\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000013", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('vfoe') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('vfoe') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000014", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('xyz', 8) == 'fgh'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 8) == 'fgh'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000015", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[4, 0, [0, 1, 9]], [[2, 8, 4], [0, 5, 4]]]) == 37\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[4, 0, [0, 1, 9]], [[2, 8, 4], [0, 5, 4]]]) == 37\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000016", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(9, 21) == 63\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 21) == 63\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000017", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(5514) == 74\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5514) == 74\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000018", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([38, 74, 76, 85, 89], 85) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([38, 74, 76, 85, 89], 85) == 3\nassert binary_search([38, 74, 76, 85, 89], 38) == 0\nassert binary_search([38, 74, 76, 85, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000019", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([29, 10, 2, 43, 22, 23, 35, 31]) == [2, 10, 22, 23, 29, 31, 35, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([29, 10, 2, 43, 22, 23, 35, 31]) == [2, 10, 22, 23, 29, 31, 35, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000020", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1929) == 'MCMXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1929) == 'MCMXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000021", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('cccd') == 'c3d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccd') == 'c3d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000022", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 5, 5], 1) == [5, 9, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 5, 5], 1) == [5, 9, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000023", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[9], [6, 5]]) == 20\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9], [6, 5]]) == 20\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000024", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h56m13s') == 17773\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h56m13s') == 17773\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000025", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the, Ran sat sat the sun') == {'the': 2, 'ran': 1, 'sat': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the, Ran sat sat the sun') == {'the': 2, 'ran': 1, 'sat': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000026", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 5, 4, 6, 8, 5, 4, 9, 3], 2) == [9, 3, 4, 5, 4, 6, 8, 5, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 5, 4, 6, 8, 5, 4, 9, 3], 2) == [9, 3, 4, 5, 4, 6, 8, 5, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000027", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(12); s.push(84); s.push(41)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(12); s.push(84); s.push(41)\nassert s.peek() == 41\nassert s.pop() == 41\nassert s.pop() == 84\nassert s.is_empty() == False\nassert s.pop() == 12\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000028", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ababaede') == 'abed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ababaede') == 'abed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000029", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(4867) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4867) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000030", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([48, 26, -32, 26, 15, 21, 9, 9]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([48, 26, -32, 26, 15, 21, 9, 9]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000031", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMCMLXVII') == 2967\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCMLXVII') == 2967\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000032", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'w': 1}) == {'y': 1, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'w': 1}) == {'y': 1, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000033", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 4, 8, 7], 4) == [0, 4, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 4, 8, 7], 4) == [0, 4, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000034", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('VII') == 7\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('VII') == 7\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000035", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(77); s.push(10); s.push(41)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(77); s.push(10); s.push(41)\nassert s.peek() == 41\nassert s.pop() == 41\nassert s.pop() == 10\nassert s.is_empty() == False\nassert s.pop() == 77\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000036", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dcbc') == 'dcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcbc') == 'dcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000037", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('((15 - 1) - 4)') == 10\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((15 - 1) - 4)') == 10\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000038", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1296) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1296) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000039", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 91, 'a': 90}) == {91: 'e', 90: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 91, 'a': 90}) == {91: 'e', 90: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000040", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('dd,\"b,aa,\",ab') == ['dd', 'b,aa,', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dd,\"b,aa,\",ab') == ['dd', 'b,aa,', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000041", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(694) == 'DCXCIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(694) == 'DCXCIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000042", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(469) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(469) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000043", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([0, 5, 5, 1, 5, 2]) == [0, 5, 1, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 5, 1, 5, 2]) == [0, 5, 1, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000044", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'coconut', 'cherry']) == {'c': ['coconut', 'coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'coconut', 'cherry']) == {'c': ['coconut', 'coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000045", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[4, 6], [2, 1]]) == [[4, 2], [6, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 6], [2, 1]]) == [[4, 2], [6, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000046", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(22, 13) == 286\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 13) == 286\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000047", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 8, 9, 7, 1, 8], [5, 1, 8, 5]) == [5, 8, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 8, 9, 7, 1, 8], [5, 1, 8, 5]) == [5, 8, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000048", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([23, 28, 40, 43, -28, -25, 26, -12]) == 43\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([23, 28, 40, 43, -28, -25, 26, -12]) == 43\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000049", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 21, 'a': 31, 'e': 17, 'b': 16, 'f': 54}) == {21: 'c', 31: 'a', 17: 'e', 16: 'b', 54: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 21, 'a': 31, 'e': 17, 'b': 16, 'f': 54}) == {21: 'c', 31: 'a', 17: 'e', 16: 'b', 54: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000050", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(238) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(238) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000051", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCCXC') == 390\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXC') == 390\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000052", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(23) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(23) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000053", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(95) == [5, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(95) == [5, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000054", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MCMXXVIII') == 1928\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCMXXVIII') == 1928\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000055", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 6, 'w': 2}, {'y': 4, 'w': 4}) == {'x': 6, 'w': 6, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 6, 'w': 2}, {'y': 4, 'w': 4}) == {'x': 6, 'w': 6, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000056", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(2, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000057", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(']a)(]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']a)(]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000058", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('4h46m53s') == 17213\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h46m53s') == 17213\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000059", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([26, 30, 25, 7, 11]) == [7, 11, 25, 26, 30]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([26, 30, 25, 7, 11]) == [7, 11, 25, 26, 30]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000060", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'e', 'c', 'e']) == {'d': 1, 'e': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'c', 'e']) == {'d': 1, 'e': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000061", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 18, 'a': 80, 'f': 13, 'd': 29, 'c': 55}) == {18: 'e', 80: 'a', 13: 'f', 29: 'd', 55: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 18, 'a': 80, 'f': 13, 'd': 29, 'c': 55}) == {18: 'e', 80: 'a', 13: 'f', 29: 'd', 55: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000062", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('fdyayyxxd') == 'dxxyyaydf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fdyayyxxd') == 'dxxyyaydf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000063", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(195)\nacc.deposit(40)\nacc.withdraw(220)\nacc.withdraw(331)\nassert acc.get_balance() == 235\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(195)\nacc.deposit(40)\nassert acc.get_balance() == 235\nacc.withdraw(220)\nassert acc.get_balance() == 15\nacc.withdraw(331)\nassert acc.get_balance() == 15\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000064", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 8, 'w': 1}, {'x': 5, 'w': 5, 'z': 7}) == {'x': 13, 'w': 6, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 8, 'w': 1}, {'x': 5, 'w': 5, 'z': 7}) == {'x': 13, 'w': 6, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000065", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[8], 8]) == [8, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8], 8]) == [8, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000066", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('cbe e') == 'Cbe E'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cbe e') == 'Cbe E'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000067", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([17, 6, 6, 21, 19]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 6, 6, 21, 19]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000068", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([10, 23, 27, 28, 10, 27, 27]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 23, 27, 28, 10, 27, 27]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000069", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('11 * 9 * 8') == 792\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('11 * 9 * 8') == 792\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000070", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['cxyy', 'c']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cxyy', 'c']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000071", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('aaccccccaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaccccccaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000072", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([4, 27, 46, 30, 47, 40, 4]) == [4, 4, 27, 30, 40, 46, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 27, 46, 30, 47, 40, 4]) == [4, 4, 27, 30, 40, 46, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000073", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(111) == 'CXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(111) == 'CXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000074", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(35) == [5, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(35) == [5, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000075", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 1, 'a': 9, 'e': 4, 'b': 9}, 6) == {'a': 9, 'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 1, 'a': 9, 'e': 4, 'b': 9}, 6) == {'a': 9, 'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000076", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('3h15m26s') == 11726\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h15m26s') == 11726\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000077", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 5, 1, 2, 1, 4, 3, 0]) == [1, 5, 2, 4, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 1, 2, 1, 4, 3, 0]) == [1, 5, 2, 4, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000078", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([5, 3, 4, 6, 1, 5, 3, 6], 3) == [[5, 3, 4], [6, 1, 5], [3, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 3, 4, 6, 1, 5, 3, 6], 3) == [[5, 3, 4], [6, 1, 5], [3, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000079", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([0, 2, 2, 2, 9, 6, 0, 2, 4], 9) == [0, 2, 2, 2, 9, 6, 0, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 2, 2, 2, 9, 6, 0, 2, 4], 9) == [0, 2, 2, 2, 9, 6, 0, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000080", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aababab', 'abaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aababab', 'abaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000081", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(7604) == 87\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7604) == 87\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000082", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(395) == 76\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(395) == 76\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000083", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('ee,36,ebb,24') == ['ee', '36', 'ebb', '24']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ee,36,ebb,24') == ['ee', '36', 'ebb', '24']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000084", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('cca c dc bb') == 'Cca C Dc Bb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cca c dc bb') == 'Cca C Dc Bb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000085", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 4, 5, 5], 4) == [4, 4, 5, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 4, 5, 5], 4) == [4, 4, 5, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000086", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 7, 4, 7, 7, 4, 2, 0, 5, 8, 5, 1, 8, 6, 1], 2) == [[8, 7], [4, 7], [7, 4], [2, 0], [5, 8], [5, 1], [8, 6], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 7, 4, 7, 7, 4, 2, 0, 5, 8, 5, 1, 8, 6, 1], 2) == [[8, 7], [4, 7], [7, 4], [2, 0], [5, 8], [5, 1], [8, 6], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000087", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-15, 16]) == 1\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-15, 16]) == 1\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000088", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sun ran cat. the! cat,') == {'sun': 1, 'ran': 1, 'cat': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun ran cat. the! cat,') == {'sun': 1, 'ran': 1, 'cat': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000089", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[3, 1, 2], [3, 3, 0], [0, 2, 0]], [[4, 4], [3, 1], [2, 2]]) == [[19, 17], [21, 15], [6, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1, 2], [3, 3, 0], [0, 2, 0]], [[4, 4], [3, 1], [2, 2]]) == [[19, 17], [21, 15], [6, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000090", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 69, 'a': 52, 'b': 35, 'c': 36}) == {69: 'e', 52: 'a', 35: 'b', 36: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 69, 'a': 52, 'b': 35, 'c': 36}) == {69: 'e', 52: 'a', 35: 'b', 36: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000091", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([5, 2, 8, 2, 3, 2, 6, 3, 7], 8) == [2, 8, 2, 3, 2, 6, 3, 7, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 2, 8, 2, 3, 2, 6, 3, 7], 8) == [2, 8, 2, 3, 2, 6, 3, 7, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000092", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(160) == [2, 2, 2, 2, 2, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(160) == [2, 2, 2, 2, 2, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000093", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['bbzy', 'bbyy', 'bbxz', 'bbyz']) == 'bb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bbzy', 'bbyy', 'bbxz', 'bbyz']) == 'bb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000094", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'b', 'b']) == {'e': 1, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'b']) == {'e': 1, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000095", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([5, -8, -1, 9, 2]) == [5, -3, -4, 5, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([5, -8, -1, 9, 2]) == [5, -3, -4, 5, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000096", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('DLXIX') == 569\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DLXIX') == 569\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000097", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([42, 0, 1, 21, 6, 31, 0, 37, 29]) == [0, 0, 1, 6, 21, 29, 31, 37, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([42, 0, 1, 21, 6, 31, 0, 37, 29]) == [0, 0, 1, 6, 21, 29, 31, 37, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000098", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(72) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(72) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000099", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('}b]b[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}b]b[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000100", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(5459) == 73\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5459) == 73\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000101", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([44, 46, 2, 34]) == [2, 34, 44, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 46, 2, 34]) == [2, 34, 44, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000102", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(338) == [2, 13, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(338) == [2, 13, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000103", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 1, 1, 1, 0, 3, 4]) == [2, 1, 0, 3, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 1, 1, 0, 3, 4]) == [2, 1, 0, 3, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000104", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([14, 28, 10, 4, 7]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 28, 10, 4, 7]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000105", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(16 + 14)') == 30\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(16 + 14)') == 30\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000106", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([5, 38, 25, 4, 13, 50, 49, 36]) == [4, 5, 13, 25, 36, 38, 49, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([5, 38, 25, 4, 13, 50, 49, 36]) == [4, 5, 13, 25, 36, 38, 49, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000107", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([2, 7, 8, 16], [2, 10, 13]) == [2, 2, 7, 8, 10, 13, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 7, 8, 16], [2, 10, 13]) == [2, 2, 7, 8, 10, 13, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000108", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 5, 2, 4, 5, 6, 0, 6, 2, 0], 4) == [0, 6, 2, 0, 8, 5, 2, 4, 5, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 2, 4, 5, 6, 0, 6, 2, 0], 4) == [0, 6, 2, 0, 8, 5, 2, 4, 5, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000109", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'apple', 'berry', 'coconut', 'cherry', 'apple', 'banana']) == {'a': ['apple', 'apple', 'apple'], 'c': ['cherry', 'coconut', 'cherry'], 'b': ['berry', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'apple', 'berry', 'coconut', 'cherry', 'apple', 'banana']) == {'a': ['apple', 'apple', 'apple'], 'c': ['cherry', 'coconut', 'cherry'], 'b': ['berry', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000110", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([7, 1, 1, 2, 2, 3, 3], [7, 9, 1]) == [7, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 1, 1, 2, 2, 3, 3], [7, 9, 1]) == [7, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000111", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 18, 'f': 10, 'e': 54}) == {18: 'b', 10: 'f', 54: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 18, 'f': 10, 'e': 54}) == {18: 'b', 10: 'f', 54: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000112", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=330; mode=off; port=off; host=774') == {'path': '330', 'mode': 'off', 'port': 'off', 'host': '774'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=330; mode=off; port=off; host=774') == {'path': '330', 'mode': 'off', 'port': 'off', 'host': '774'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000113", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=658; user=off; path=331') == {'port': '658', 'user': 'off', 'path': '331'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=658; user=off; path=331') == {'port': '658', 'user': 'off', 'path': '331'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000114", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 9, 6, 1], [2, 8, 3]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 9, 6, 1], [2, 8, 3]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000115", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 6) == 'def'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 6) == 'def'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000116", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([26, 15, 31, 31, 35, 38, 45, 32, 20]) == [15, 20, 26, 31, 31, 32, 35, 38, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([26, 15, 31, 31, 35, 38, 45, 32, 20]) == [15, 20, 26, 31, 31, 32, 35, 38, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000117", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(340) == 'CCCXL'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(340) == 'CCCXL'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000118", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[7, 2]]) == [7, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 2]]) == [7, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000119", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(629) == 926\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(629) == 926\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000120", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-2, 2, -1, 9, -7]) == [-2, 0, -1, 8, 1]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-2, 2, -1, 9, -7]) == [-2, 0, -1, 8, 1]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000121", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('7m55s') == 475\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('7m55s') == 475\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000122", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([33, 51, 53, 72, 87, 96], 33) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([33, 51, 53, 72, 87, 96], 33) == 0\nassert binary_search([33, 51, 53, 72, 87, 96], 33) == 0\nassert binary_search([33, 51, 53, 72, 87, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000123", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([40, 48, 64, 69], 169) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([40, 48, 64, 69], 169) == -1\nassert binary_search([40, 48, 64, 69], 40) == 0\nassert binary_search([40, 48, 64, 69], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000124", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([22, 42, 17, 26, 50, 11, 4, 50]) == [4, 11, 17, 22, 26, 42, 50, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([22, 42, 17, 26, 50, 11, 4, 50]) == [4, 11, 17, 22, 26, 42, 50, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000125", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 2, 'y': 1}, {'z': 6, 'y': 5}) == {'x': 2, 'y': 6, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 2, 'y': 1}, {'z': 6, 'y': 5}) == {'x': 2, 'y': 6, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000126", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 8, 5, 6, 9, 4, 7, 3, 3, 2], 3) == [[6, 8, 5], [6, 9, 4], [7, 3, 3], [2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 8, 5, 6, 9, 4, 7, 3, 3, 2], 3) == [[6, 8, 5], [6, 9, 4], [7, 3, 3], [2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000127", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1286) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1286) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000128", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'date', 'avocado']) == {'c': ['coconut'], 'a': ['apple', 'avocado'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'date', 'avocado']) == {'c': ['coconut'], 'a': ['apple', 'avocado'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000129", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(4053) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4053) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000130", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('acbdb') == 'bdbca'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('acbdb') == 'bdbca'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000131", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('daf', 'dafb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('daf', 'dafb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000132", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(187, 4) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(187, 4) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000133", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([46, 22, 23, 28]) == [22, 23, 28, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 22, 23, 28]) == [22, 23, 28, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000134", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 5, 0, 2, 7, 8, 9, 4, 2, 3], 2) == [2, 3, 6, 5, 0, 2, 7, 8, 9, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 5, 0, 2, 7, 8, 9, 4, 2, 3], 2) == [2, 3, 6, 5, 0, 2, 7, 8, 9, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000135", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(356)\nacc.deposit(51)\nacc.withdraw(151)\nacc.withdraw(437)\nassert acc.get_balance() == 407\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(356)\nacc.deposit(51)\nassert acc.get_balance() == 407\nacc.withdraw(151)\nassert acc.get_balance() == 256\nacc.withdraw(437)\nassert acc.get_balance() == 256\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000136", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('sdhf') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('sdhf') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000137", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([6, 17, 19, 28, 38, 51, 62, 64, 79, 83, 85, 98], 79) == 8\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([6, 17, 19, 28, 38, 51, 62, 64, 79, 83, 85, 98], 79) == 8\nassert binary_search([6, 17, 19, 28, 38, 51, 62, 64, 79, 83, 85, 98], 6) == 0\nassert binary_search([6, 17, 19, 28, 38, 51, 62, 64, 79, 83, 85, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000138", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[2, 0, 5], [2, 0, 2], [5, 3, 4]], [[2, 5, 0], [1, 5, 2], [0, 5, 5]]) == [[4, 35, 25], [4, 20, 10], [13, 60, 26]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 0, 5], [2, 0, 2], [5, 3, 4]], [[2, 5, 0], [1, 5, 2], [0, 5, 5]]) == [[4, 35, 25], [4, 20, 10], [13, 60, 26]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000139", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[8, 5], [-9, -2], [8, 3], [7, 2]], [[8, 9], [7, 4], [-2, 4], [-1, -6]]) == [[16, 14], [-2, 2], [6, 7], [6, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 5], [-9, -2], [8, 3], [7, 2]], [[8, 9], [7, 4], [-2, 4], [-1, -6]]) == [[16, 14], [-2, 2], [6, 7], [6, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000140", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([29, 38, 42, 17, 39]) == [17, 29, 38, 39, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([29, 38, 42, 17, 39]) == [17, 29, 38, 39, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000141", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('abaa cbe aeeca') == 'Abaa Cbe Aeeca'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abaa cbe aeeca') == 'Abaa Cbe Aeeca'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000142", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([8, 10, 18, 24, 52, 58, 64, 86], 58) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 10, 18, 24, 52, 58, 64, 86], 58) == 5\nassert binary_search([8, 10, 18, 24, 52, 58, 64, 86], 8) == 0\nassert binary_search([8, 10, 18, 24, 52, 58, 64, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000143", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bcccabaaacbcaac', 'accc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcccabaaacbcaac', 'accc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000144", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 1, 2, 4, 3, 1, 5]) == [4, 1, 2, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 2, 4, 3, 1, 5]) == [4, 1, 2, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000145", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('bdef gh aecfbfd ba dbd') == 'aecfbfd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bdef gh aecfbfd ba dbd') == 'aecfbfd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000146", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([9, 9, 6, 7, 7], 2) == [7, 7, 9, 9, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 9, 6, 7, 7], 2) == [7, 7, 9, 9, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000147", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([50, 20, 13, 17, 24]) == [13, 17, 20, 24, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([50, 20, 13, 17, 24]) == [13, 17, 20, 24, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000148", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(286) == 'CCLXXXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(286) == 'CCLXXXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000149", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([21, 6, 13]) == [6, 13, 21]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([21, 6, 13]) == [6, 13, 21]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_000150", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[2, 4], [3, 5], [4, 8], [4, 8]]) == [[2, 3, 4, 4], [4, 5, 8, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 4], [3, 5], [4, 8], [4, 8]]) == [[2, 3, 4, 4], [4, 5, 8, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000151", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('16 + 12') == 28\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('16 + 12') == 28\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000152", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[1, 2], [-3, 2], [7, -1]], [[-1, -1], [-1, -4], [1, -2]]) == [[0, 1], [-4, -2], [8, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, 2], [-3, 2], [7, -1]], [[-1, -1], [-1, -4], [1, -2]]) == [[0, 1], [-4, -2], [8, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000153", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'date', 'apple', 'banana', 'cherry']) == {'a': ['apple', 'apple'], 'd': ['date'], 'b': ['banana'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'date', 'apple', 'banana', 'cherry']) == {'a': ['apple', 'apple'], 'd': ['date'], 'b': ['banana'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000154", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['bxyx', 'byzy']) == 'b'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bxyx', 'byzy']) == 'b'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000155", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([15, 30, 32, 38, 49, 52, 68, 83], 38) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 30, 32, 38, 49, 52, 68, 83], 38) == 3\nassert binary_search([15, 30, 32, 38, 49, 52, 68, 83], 15) == 0\nassert binary_search([15, 30, 32, 38, 49, 52, 68, 83], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000156", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(19, 24) == 456\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 24) == 456\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000157", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 11, 'a': 88, 'd': 18, 'f': 50}) == {11: 'c', 88: 'a', 18: 'd', 50: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 11, 'a': 88, 'd': 18, 'f': 50}) == {11: 'c', 88: 'a', 18: 'd', 50: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000158", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([20, 27, 0, 27, 20]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 27, 0, 27, 20]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000159", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-6, -3, 6], [5, 6, 4], [-7, 2, -8]], [[5, -5, -4], [4, 8, -1], [5, 5, -4]]) == [[-1, -8, 2], [9, 14, 3], [-2, 7, -12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -3, 6], [5, 6, 4], [-7, 2, -8]], [[5, -5, -4], [4, 8, -1], [5, 5, -4]]) == [[-1, -8, 2], [9, 14, 3], [-2, 7, -12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000160", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(9); s.push(88); s.push(77)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(9); s.push(88); s.push(77)\nassert s.peek() == 77\nassert s.pop() == 77\nassert s.pop() == 88\nassert s.is_empty() == False\nassert s.pop() == 9\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000161", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(64); s.push(4); s.push(62)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(64); s.push(4); s.push(62)\nassert s.peek() == 62\nassert s.pop() == 62\nassert s.pop() == 4\nassert s.is_empty() == False\nassert s.pop() == 64\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000162", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bcbaccabcb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcbaccabcb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000163", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([20, 33, 52, 80, 95], 52) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([20, 33, 52, 80, 95], 52) == 2\nassert binary_search([20, 33, 52, 80, 95], 20) == 0\nassert binary_search([20, 33, 52, 80, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000164", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([0, 8, 7, 7, 1], 4) == [8, 7, 7, 1, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 8, 7, 7, 1], 4) == [8, 7, 7, 1, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000165", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'avocado', 'apple', 'cherry']) == {'b': ['berry'], 'c': ['cherry', 'cherry'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'avocado', 'apple', 'cherry']) == {'b': ['berry'], 'c': ['cherry', 'cherry'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000166", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(19) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(19) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000167", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(50, 15) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(50, 15) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000168", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 11) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 11) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000169", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([19, 24, 27, 59, 61, 71, 72, 99], 59) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([19, 24, 27, 59, 61, 71, 72, 99], 59) == 3\nassert binary_search([19, 24, 27, 59, 61, 71, 72, 99], 19) == 0\nassert binary_search([19, 24, 27, 59, 61, 71, 72, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000170", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('\"ab,a\",\",,,\",aee,\"a,ba\",adbc') == ['ab,a', ',,,', 'aee', 'a,ba', 'adbc']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"ab,a\",\",,,\",aee,\"a,ba\",adbc') == ['ab,a', ',,,', 'aee', 'a,ba', 'adbc']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000171", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('The sat sat, sat the') == {'the': 2, 'sat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The sat sat, sat the') == {'the': 2, 'sat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000172", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([9, 5, 8, 4, 5, 7], [8, 9, 1, 2, 7]) == [9, 8, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 5, 8, 4, 5, 7], [8, 9, 1, 2, 7]) == [9, 8, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000173", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=528; port=on; host=696; user=auto') == {'mode': '528', 'port': 'on', 'host': '696', 'user': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=528; port=on; host=696; user=auto') == {'mode': '528', 'port': 'on', 'host': '696', 'user': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000174", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 0, 4, 4, 6, 6, 4, 6], [4, 2, 0, 0, 2]) == [4, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 0, 4, 4, 6, 6, 4, 6], [4, 2, 0, 0, 2]) == [4, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000175", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'd', 'e']) == {'d': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'e']) == {'d': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000176", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('b)]]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b)]]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000177", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aabbbdcc') == 'a2b3d1c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aabbbdcc') == 'a2b3d1c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000178", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('4h30m16s') == 16216\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h30m16s') == 16216\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000179", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('ccaacacba', 'cbbc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ccaacacba', 'cbbc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000180", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('the! sat! Ran cat sun ran. sat, Cat') == {'the': 1, 'sat': 2, 'ran': 2, 'cat': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the! sat! Ran cat sun ran. sat, Cat') == {'the': 1, 'sat': 2, 'ran': 2, 'cat': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000181", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 2, 8, 1, 6, 3, 6], 4) == [1, 6, 3, 6, 0, 2, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 2, 8, 1, 6, 3, 6], 4) == [1, 6, 3, 6, 0, 2, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000182", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 1, 8, 4, 3, 4, 9, 9], [0, 6, 8, 6]) == [8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 1, 8, 4, 3, 4, 9, 9], [0, 6, 8, 6]) == [8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000183", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('xcfxfeec') == 'ceefxfcx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xcfxfeec') == 'ceefxfcx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000184", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([12, 1, 32, 17, 22, 26, 18]) == [1, 12, 17, 18, 22, 26, 32]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([12, 1, 32, 17, 22, 26, 18]) == [1, 12, 17, 18, 22, 26, 32]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000185", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(38, 32) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(38, 32) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000186", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(200) == [2, 2, 2, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(200) == [2, 2, 2, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000187", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('ptqhax') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ptqhax') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000188", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(652656) == 807\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(652656) == 807\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000189", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-8, 9, -1], [-3, 9, -2], [7, 9, -8], [7, 3, 8]], [[9, 4, 9], [6, -9, -4], [-4, 3, 5], [-6, -3, -1]]) == [[1, 13, 8], [3, 0, -6], [3, 12, -3], [1, 0, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 9, -1], [-3, 9, -2], [7, 9, -8], [7, 3, 8]], [[9, 4, 9], [6, -9, -4], [-4, 3, 5], [-6, -3, -1]]) == [[1, 13, 8], [3, 0, -6], [3, 12, -3], [1, 0, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000190", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('\"a,b,\",76,92') == ['a,b,', '76', '92']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"a,b,\",76,92') == ['a,b,', '76', '92']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000191", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([35, 32, 48, 31, 1]) == [1, 31, 32, 35, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([35, 32, 48, 31, 1]) == [1, 31, 32, 35, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000192", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 8, 0, 2, 3, 0], 4) == [0, 2, 3, 0, 9, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 8, 0, 2, 3, 0], 4) == [0, 2, 3, 0, 9, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000193", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CCCXL') == 340\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXL') == 340\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000194", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([33, 21, 31, 30, 42, 4, 20]) == [4, 20, 21, 30, 31, 33, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([33, 21, 31, 30, 42, 4, 20]) == [4, 20, 21, 30, 31, 33, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000195", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(371)\nacc.deposit(48)\nacc.withdraw(98)\nacc.withdraw(537)\nassert acc.get_balance() == 419\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(371)\nacc.deposit(48)\nassert acc.get_balance() == 419\nacc.withdraw(98)\nassert acc.get_balance() == 321\nacc.withdraw(537)\nassert acc.get_balance() == 321\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000196", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(6, 17) == 102\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 17) == 102\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000197", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('bcxy') == 'yxcb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bcxy') == 'yxcb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000198", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 8}, {'x': 9, 'z': 8, 'w': 8}) == {'x': 17, 'z': 8, 'w': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 8}, {'x': 9, 'z': 8, 'w': 8}) == {'x': 17, 'z': 8, 'w': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000199", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([48, 38, 28, 35, 21, 24, 25, 2, 33]) == [2, 21, 24, 25, 28, 33, 35, 38, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([48, 38, 28, 35, 21, 24, 25, 2, 33]) == [2, 21, 24, 25, 28, 33, 35, 38, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000200", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(420294) == 648\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(420294) == 648\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000201", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=on; user=on') == {'path': 'on', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; user=on') == {'path': 'on', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000202", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([12, 29, 38, 57, 62, 63, 71], 119) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([12, 29, 38, 57, 62, 63, 71], 119) == -1\nassert binary_search([12, 29, 38, 57, 62, 63, 71], 12) == 0\nassert binary_search([12, 29, 38, 57, 62, 63, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000203", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('3h35m18s') == 12918\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h35m18s') == 12918\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000204", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMDCCCXCV') == 2895\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDCCCXCV') == 2895\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000205", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Python', 2) == 'Ravjqp'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 2) == 'Ravjqp'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000206", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['byz', 'by', 'byxx']) == 'by'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['byz', 'by', 'byxx']) == 'by'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000207", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([40, 29, 1, 42, 32]) == [1, 29, 32, 40, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 29, 1, 42, 32]) == [1, 29, 32, 40, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000208", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(368) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(368) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000209", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbabbbbaaaaabb', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabbbbaaaaabb', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000210", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=827; host=767; user=78; port=on') == {'mode': '827', 'host': '767', 'user': '78', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=827; host=767; user=78; port=on') == {'mode': '827', 'host': '767', 'user': '78', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000211", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('edcedbc') == 'edcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edcedbc') == 'edcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000212", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([3, 6, 5, 7], 4) == [3, 6, 5, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 6, 5, 7], 4) == [3, 6, 5, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000213", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(210) == 39\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(210) == 39\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000214", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([30, 39, 6, 13, 31, 6]) == [6, 6, 13, 30, 31, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 39, 6, 13, 31, 6]) == [6, 6, 13, 30, 31, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000215", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(466)\nacc.deposit(16)\nacc.withdraw(280)\nacc.withdraw(663)\nassert acc.get_balance() == 482\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(466)\nacc.deposit(16)\nassert acc.get_balance() == 482\nacc.withdraw(280)\nassert acc.get_balance() == 202\nacc.withdraw(663)\nassert acc.get_balance() == 202\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000216", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('((7 * 9) * (19 + 2))') == 1323\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((7 * 9) * (19 + 2))') == 1323\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000217", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCXCIX') == 299\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXCIX') == 299\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000218", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-2, 8]) == [-2, 6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-2, 8]) == [-2, 6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000219", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[7, 4, 3, 1], [6, 7, 6, 8]]) == [7, 4, 3, 1, 6, 7, 6, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 4, 3, 1], [6, 7, 6, 8]]) == [7, 4, 3, 1, 6, 7, 6, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000220", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(1, 4) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 4) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000221", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([9, 7, 5, 6, 1], [6, 2, 3, 8, 8, 0]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 7, 5, 6, 1], [6, 2, 3, 8, 8, 0]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000222", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h24m43s') == 12283\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h24m43s') == 12283\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000223", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(95) == 105\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(95) == 105\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000224", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 92, 'd': 87}) == {92: 'f', 87: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 92, 'd': 87}) == {92: 'f', 87: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000225", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([49, 8, 21]) == [8, 21, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([49, 8, 21]) == [8, 21, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000226", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([2, 8, 9, 1, 8, 9, 1], [0, 9, 0, 0, 1, 6, 9]) == [9, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 8, 9, 1, 8, 9, 1], [0, 9, 0, 0, 1, 6, 9]) == [9, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000227", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('afdge gccch aeahd acedceg e') == 'acedceg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('afdge gccch aeahd acedceg e') == 'acedceg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000228", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'w': 6}, {'x': 5, 'w': 8, 'y': 7}) == {'z': 2, 'w': 14, 'x': 5, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'w': 6}, {'x': 5, 'w': 8, 'y': 7}) == {'z': 2, 'w': 14, 'x': 5, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000229", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(299) == 117\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(299) == 117\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000230", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-14, -6, -19, 22, -50, -10]) == 22\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-14, -6, -19, 22, -50, -10]) == 22\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000231", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 5, 6, 5, 3, 0], 4) == [6, 5, 3, 0, 0, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 5, 6, 5, 3, 0], 4) == [6, 5, 3, 0, 0, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000232", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h54m5s') == 10445\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h54m5s') == 10445\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000233", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([56, 63, 94], 129) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([56, 63, 94], 129) == -1\nassert binary_search([56, 63, 94], 56) == 0\nassert binary_search([56, 63, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000234", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([35, 8, 30, 25]) == [8, 25, 30, 35]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 8, 30, 25]) == [8, 25, 30, 35]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_000235", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-9, -9], [-9, -1], [-8, -5], [-9, 7]], [[-6, -6], [-1, 1], [7, 2], [3, 7]]) == [[-15, -15], [-10, 0], [-1, -3], [-6, 14]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -9], [-9, -1], [-8, -5], [-9, 7]], [[-6, -6], [-1, 1], [7, 2], [3, 7]]) == [[-15, -15], [-10, 0], [-1, -3], [-6, 14]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000236", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 4}, {'z': 5, 'w': 9, 'x': 4}) == {'y': 4, 'z': 5, 'w': 9, 'x': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 4}, {'z': 5, 'w': 9, 'x': 4}) == {'y': 4, 'z': 5, 'w': 9, 'x': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000237", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([5, 41, 29, 39]) == [5, 29, 39, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([5, 41, 29, 39]) == [5, 29, 39, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000238", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 1, 5, 3, 5, 5, 5, 2, 0, 4, 1]) == [4, 1, 5, 3, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 5, 3, 5, 5, 5, 2, 0, 4, 1]) == [4, 1, 5, 3, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000239", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([2, [1, 7], [6, 4], 6]) == [2, 1, 7, 6, 4, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, [1, 7], [6, 4], 6]) == [2, 1, 7, 6, 4, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000240", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 6, 3], [7, 2, 3, 2]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 6, 3], [7, 2, 3, 2]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000241", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(4971) == 1794\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4971) == 1794\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000242", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'b', 'e', 'e']) == {'d': 1, 'b': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'b', 'e', 'e']) == {'d': 1, 'b': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000243", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cczxz', 'ccxx', 'ccxz']) == 'cc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cczxz', 'ccxx', 'ccxz']) == 'cc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000244", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('9') == 9\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9') == 9\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000245", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'z': 9}, {'x': 8, 'w': 8, 'y': 4}) == {'w': 15, 'z': 9, 'x': 8, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'z': 9}, {'x': 8, 'w': 8, 'y': 4}) == {'w': 15, 'z': 9, 'x': 8, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000246", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(142, 20) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(142, 20) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000247", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([40, 15, 14, 37, 38, 15]) == [14, 15, 15, 37, 38, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([40, 15, 14, 37, 38, 15]) == [14, 15, 15, 37, 38, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000248", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[4], [8, 7, 6, 5], [7, 1, 7]]) == [4, 8, 7, 6, 5, 7, 1, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], [8, 7, 6, 5], [7, 1, 7]]) == [4, 8, 7, 6, 5, 7, 1, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000249", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[4, 3, 1], [2, 4, 5], [8, 8, 8]]) == [[4, 2, 8], [3, 4, 8], [1, 5, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 3, 1], [2, 4, 5], [8, 8, 8]]) == [[4, 2, 8], [3, 4, 8], [1, 5, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000250", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(2581) == 50\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2581) == 50\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000251", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 10, 'c': 4}, 7) == {'b': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 10, 'c': 4}, 7) == {'b': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000252", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dddddddddaaaaaaaaaaabbbbbbbbd') == 'd9a11b8d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddddddaaaaaaaaaaabbbbbbbbd') == 'd9a11b8d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000253", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXXVII') == 277\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXVII') == 277\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000254", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(10, 5) == 10\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(10, 5) == 10\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000255", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'd', 'e']) == {'d': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'e']) == {'d': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000256", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([11, 19, 28]) == [11, 19, 28]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 19, 28]) == [11, 19, 28]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000257", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 2], [5, 2], [3, 3]], [[4, 1], [3, 0]]) == [[6, 0], [26, 5], [21, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2], [5, 2], [3, 3]], [[4, 1], [3, 0]]) == [[6, 0], [26, 5], [21, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000258", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[3, 9, 5], 7]) == [3, 9, 5, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 9, 5], 7]) == [3, 9, 5, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000259", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([6, 56, 62, 74, 88, 93], 56) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([6, 56, 62, 74, 88, 93], 56) == 1\nassert binary_search([6, 56, 62, 74, 88, 93], 6) == 0\nassert binary_search([6, 56, 62, 74, 88, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000260", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('dedcea e') == 'Dedcea E'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dedcea e') == 'Dedcea E'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000261", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[1, 2, 1], [4], [6, 2, 0, 0], [3, 0], [8, 8, 4, 9]]) == [1, 2, 1, 4, 6, 2, 0, 0, 3, 0, 8, 8, 4, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 2, 1], [4], [6, 2, 0, 0], [3, 0], [8, 8, 4, 9]]) == [1, 2, 1, 4, 6, 2, 0, 0, 3, 0, 8, 8, 4, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000262", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['czz', 'cx', 'cx']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['czz', 'cx', 'cx']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000263", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=117; port=off; mode=220; user=878') == {'path': '117', 'port': 'off', 'mode': '220', 'user': '878'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=117; port=off; mode=220; user=878') == {'path': '117', 'port': 'off', 'mode': '220', 'user': '878'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000264", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abbbba', 'bab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbba', 'bab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000265", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'coconut', 'cherry', 'coconut', 'avocado', 'date', 'date']) == {'b': ['berry'], 'c': ['cherry', 'coconut', 'cherry', 'coconut'], 'a': ['avocado'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'coconut', 'cherry', 'coconut', 'avocado', 'date', 'date']) == {'b': ['berry'], 'c': ['cherry', 'coconut', 'cherry', 'coconut'], 'a': ['avocado'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000266", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(458) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(458) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000267", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(6728) == 23\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6728) == 23\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000268", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 33, 'd': 48, 'f': 81, 'e': 30, 'c': 34}) == {33: 'b', 48: 'd', 81: 'f', 30: 'e', 34: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 33, 'd': 48, 'f': 81, 'e': 30, 'c': 34}) == {33: 'b', 48: 'd', 81: 'f', 30: 'e', 34: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000269", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[[8, 0]]]) == [8, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[8, 0]]]) == [8, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000270", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([1, 8, 5, 0, 3], [7, 6, 4, 0, 5, 8, 7, 4]) == [8, 5, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 8, 5, 0, 3], [7, 6, 4, 0, 5, 8, 7, 4]) == [8, 5, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000271", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('ddba bgfbdcf ahcedgf bdbg bebddhf hddfhbce') == 'hddfhbce'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ddba bgfbdcf ahcedgf bdbg bebddhf hddfhbce') == 'hddfhbce'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000272", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[9, 7], [9, 6], [3, 4], [2, 1]]) == [[9, 9, 3, 2], [7, 6, 4, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 7], [9, 6], [3, 4], [2, 1]]) == [[9, 9, 3, 2], [7, 6, 4, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000273", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([16, 16, 13, 12, 13, 12]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 16, 13, 12, 13, 12]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000274", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[5, 7], [-4, -2], [-4, -3]], [[1, 4], [2, -9], [-8, -7]]) == [[6, 11], [-2, -11], [-12, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 7], [-4, -2], [-4, -3]], [[1, 4], [2, -9], [-8, -7]]) == [[6, 11], [-2, -11], [-12, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000275", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCCLXXII') == 372\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXXII') == 372\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000276", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(83) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(83) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000277", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(67); s.push(15); s.push(83)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(67); s.push(15); s.push(83)\nassert s.peek() == 83\nassert s.pop() == 83\nassert s.pop() == 15\nassert s.is_empty() == False\nassert s.pop() == 67\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000278", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([28, 24, 31]) == [24, 28, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([28, 24, 31]) == [24, 28, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000279", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 3}, {'w': 8}) == {'z': 3, 'w': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3}, {'w': 8}) == {'z': 3, 'w': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000280", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('dbde,e') == ['dbde', 'e']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dbde,e') == ['dbde', 'e']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000281", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([8, 11, 25]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 11, 25]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000282", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'apple', 'coconut', 'coconut', 'berry', 'avocado', 'coconut', 'coconut']) == {'d': ['date'], 'a': ['apple', 'avocado'], 'c': ['coconut', 'coconut', 'coconut', 'coconut'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'coconut', 'coconut', 'berry', 'avocado', 'coconut', 'coconut']) == {'d': ['date'], 'a': ['apple', 'avocado'], 'c': ['coconut', 'coconut', 'coconut', 'coconut'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000283", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 8, 5, 2, 9, 9, 3], 2) == [[8, 8], [5, 2], [9, 9], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 8, 5, 2, 9, 9, 3], 2) == [[8, 8], [5, 2], [9, 9], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000284", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['a', 'd', 'e', 'b', 'e', 'b']) == {'a': 1, 'd': 1, 'e': 2, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'e', 'b', 'e', 'b']) == {'a': 1, 'd': 1, 'e': 2, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000285", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[2, 7]]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, 7]]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000286", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('zfzfcdb') == 'bdcfzfz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zfzfcdb') == 'bdcfzfz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000287", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[)))') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[)))') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000288", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(54) == [2, 3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(54) == [2, 3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000289", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('()()[]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()()[]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000290", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-6, -7, 0], [5, 1, 6], [-3, -5, -6]], [[-8, -8, 8], [1, 8, 9], [0, 4, -6]]) == [[-14, -15, 8], [6, 9, 15], [-3, -1, -12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -7, 0], [5, 1, 6], [-3, -5, -6]], [[-8, -8, 8], [1, 8, 9], [0, 4, -6]]) == [[-14, -15, 8], [6, 9, 15], [-3, -1, -12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000291", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('()(){}()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()(){}()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000292", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 2, 2, 15, 19], [0, 4]) == [0, 0, 2, 2, 4, 15, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 2, 2, 15, 19], [0, 4]) == [0, 0, 2, 2, 4, 15, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000293", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[7, 4, 6], [4, 6, 7], 1], [[7, 2, 7]], [0, [7], [5]]]) == 63\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[7, 4, 6], [4, 6, 7], 1], [[7, 2, 7]], [0, [7], [5]]]) == 63\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000294", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('12 - 17 - (9 * 4)') == -41\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('12 - 17 - (9 * 4)') == -41\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000295", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('gf gbeb') == 'gbeb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gf gbeb') == 'gbeb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000296", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([6, [7, 6, 0], [8, 2, 6], 8, 1]) == [6, 7, 6, 0, 8, 2, 6, 8, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [7, 6, 0], [8, 2, 6], 8, 1]) == [6, 7, 6, 0, 8, 2, 6, 8, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000297", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 5, 'y': 1}, {'w': 5, 'y': 3}) == {'w': 10, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5, 'y': 1}, {'w': 5, 'y': 3}) == {'w': 10, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000298", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('cacaad') == 'Cacaad'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cacaad') == 'Cacaad'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000299", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aaaabab', 'bab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaabab', 'bab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000300", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 7, 'e': 2}, 4) == {'d': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 7, 'e': 2}, 4) == {'d': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000301", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 1, 4, 1, 4]) == [2, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 4, 1, 4]) == [2, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000302", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 3, 2, 1, 3]) == [1, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 2, 1, 3]) == [1, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000303", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(4694) == 68\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4694) == 68\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000304", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 5, 'd': 10, 'a': 40, 'f': 55}) == {5: 'e', 10: 'd', 40: 'a', 55: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 5, 'd': 10, 'a': 40, 'f': 55}) == {5: 'e', 10: 'd', 40: 'a', 55: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000305", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([9, 6, -5, 4, -7, -1, -9]) == [9, 15, 10, 14, 7, 6, -3]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, 6, -5, 4, -7, -1, -9]) == [9, 15, 10, 14, 7, 6, -3]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000306", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baaaabbbbaab', 'bba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaaabbbbaab', 'bba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000307", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([17, 2, 14, 7, 24, 12, 13, 4]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 2, 14, 7, 24, 12, 13, 4]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000308", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('baabcccaca', 'ba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabcccaca', 'ba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000309", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['b', 'e', 'b', 'a', 'a', 'c']) == {'b': 2, 'e': 1, 'a': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'e', 'b', 'a', 'a', 'c']) == {'b': 2, 'e': 1, 'a': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000310", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(861171) == 927\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(861171) == 927\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000311", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(20); s.push(24); s.push(99)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(20); s.push(24); s.push(99)\nassert s.peek() == 99\nassert s.pop() == 99\nassert s.pop() == 24\nassert s.is_empty() == False\nassert s.pop() == 20\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000312", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([17, 28, 45, 6, 40]) == [6, 17, 28, 40, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([17, 28, 45, 6, 40]) == [6, 17, 28, 40, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000313", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aeeaeed') == 'aed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aeeaeed') == 'aed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000314", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([23, 4, 11, 19, 23, 23, 19]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 4, 11, 19, 23, 23, 19]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000315", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aabcaacab', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabcaacab', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000316", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dcbbaacedbdda') == 'dcbae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcbbaacedbdda') == 'dcbae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000317", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(19, 4) == 76\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 4) == 76\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000318", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 8, 'y': 4}, {'w': 9, 'y': 4, 'z': 1}) == {'w': 17, 'y': 8, 'z': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 8, 'y': 4}, {'w': 9, 'y': 4, 'z': 1}) == {'w': 17, 'y': 8, 'z': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000319", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'c', 'a', 'd', 'd', 'c', 'a']) == {'e': 1, 'c': 2, 'a': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'c', 'a', 'd', 'd', 'c', 'a']) == {'e': 1, 'c': 2, 'a': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000320", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([0, -1, -6]) == [0, -1, -7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([0, -1, -6]) == [0, -1, -7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000321", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello Python', 9) == 'Qnuux Yhcqxw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Python', 9) == 'Qnuux Yhcqxw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000322", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-3, 5, 2, -6, -2, -6, -2, -6]) == [-3, 2, 4, -2, -4, -10, -12, -18]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-3, 5, 2, -6, -2, -6, -2, -6]) == [-3, 2, 4, -2, -4, -10, -12, -18]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000323", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-3, -1], [-7, 9], [2, -5], [7, 1]], [[-1, -8], [-6, -4], [9, 4], [-1, -8]]) == [[-4, -9], [-13, 5], [11, -1], [6, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, -1], [-7, 9], [2, -5], [7, 1]], [[-1, -8], [-6, -4], [9, 4], [-1, -8]]) == [[-4, -9], [-13, 5], [11, -1], [6, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000324", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([40, 5, 33, 15, 5, 30, 11, 39]) == [5, 5, 11, 15, 30, 33, 39, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 5, 33, 15, 5, 30, 11, 39]) == [5, 5, 11, 15, 30, 33, 39, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000325", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('nqscuzwpn') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('nqscuzwpn') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000326", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([3, 7, 9], [2, 8, 13, 14, 15]) == [2, 3, 7, 8, 9, 13, 14, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 7, 9], [2, 8, 13, 14, 15]) == [2, 3, 7, 8, 9, 13, 14, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000327", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(2826) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2826) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000328", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[2, 2], [5, 0], [3, 3]], [[1, 2], [3, 1]]) == [[8, 6], [5, 10], [12, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 2], [5, 0], [3, 3]], [[1, 2], [3, 1]]) == [[8, 6], [5, 10], [12, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000329", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bcaabxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcaabxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000330", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([30, 45, 30, 27, 12, 46, 31]) == [12, 27, 30, 30, 31, 45, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 45, 30, 27, 12, 46, 31]) == [12, 27, 30, 30, 31, 45, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000331", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(88); s.push(27); s.push(88)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(88); s.push(27); s.push(88)\nassert s.peek() == 88\nassert s.pop() == 88\nassert s.pop() == 27\nassert s.is_empty() == False\nassert s.pop() == 88\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 0.857} {"id": "stagec_000332", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(256) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(256) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000333", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[5, 3, 3], [1, 1, 4]], [[3, 2], [5, 1], [0, 3]]) == [[30, 22], [8, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3, 3], [1, 1, 4]], [[3, 2], [5, 1], [0, 3]]) == [[30, 22], [8, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000334", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[1, 1, 2], [6, 7, 8]]) == [[1, 6], [1, 7], [2, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 1, 2], [6, 7, 8]]) == [[1, 6], [1, 7], [2, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000335", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(74) == [2, 37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(74) == [2, 37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000336", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 2], [3, 4]], [[2, 0], [2, 2]]) == [[12, 4], [14, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2], [3, 4]], [[2, 0], [2, 2]]) == [[12, 4], [14, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000337", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(151, 28) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(151, 28) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000338", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2070) == 'MMLXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2070) == 'MMLXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000339", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('ddd bceae aee bcdac') == 'Ddd Bceae Aee Bcdac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ddd bceae aee bcdac') == 'Ddd Bceae Aee Bcdac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000340", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('}[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000341", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('The cat The sun dog Sat cat cat,') == {'the': 2, 'cat': 3, 'sun': 1, 'dog': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The cat The sun dog Sat cat cat,') == {'the': 2, 'cat': 3, 'sun': 1, 'dog': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000342", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabaccccbccacbbc', 'ab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaccccbccacbbc', 'ab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000343", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(116) == 611\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(116) == 611\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000344", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 69, 'f': 3, 'a': 42, 'd': 98, 'e': 13}) == {69: 'b', 3: 'f', 42: 'a', 98: 'd', 13: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 69, 'f': 3, 'a': 42, 'd': 98, 'e': 13}) == {69: 'b', 3: 'f', 42: 'a', 98: 'd', 13: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000345", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 4, 'd': 36, 'c': 70, 'a': 17, 'b': 10}) == {4: 'f', 36: 'd', 70: 'c', 17: 'a', 10: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 4, 'd': 36, 'c': 70, 'a': 17, 'b': 10}) == {4: 'f', 36: 'd', 70: 'c', 17: 'a', 10: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000346", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('([])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('([])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000347", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=465; port=on') == {'mode': '465', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=465; port=on') == {'mode': '465', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000348", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([2, 3, 13, 13, 14, 16, 19], [7, 18]) == [2, 3, 7, 13, 13, 14, 16, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 3, 13, 13, 14, 16, 19], [7, 18]) == [2, 3, 7, 13, 13, 14, 16, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000349", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(12, 20) == 60\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(12, 20) == 60\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000350", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([31, 6, 6, 4, 34, 28, 28, 46]) == [4, 6, 6, 28, 28, 31, 34, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 6, 6, 4, 34, 28, 28, 46]) == [4, 6, 6, 28, 28, 31, 34, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000351", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([9, 0, 9, 0, 0, 3], [7, 5, 4, 7, 3, 6]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 0, 9, 0, 0, 3], [7, 5, 4, 7, 3, 6]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000352", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 9, 5, 0, 5, 8, 8, 1, 1, 6, 6, 4, 1, 8], 2) == [[6, 9], [5, 0], [5, 8], [8, 1], [1, 6], [6, 4], [1, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 5, 0, 5, 8, 8, 1, 1, 6, 6, 4, 1, 8], 2) == [[6, 9], [5, 0], [5, 8], [8, 1], [1, 6], [6, 4], [1, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000353", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'apple', 'berry', 'apple', 'cherry', 'cherry']) == {'c': ['cherry', 'cherry', 'cherry'], 'a': ['apple', 'apple'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'apple', 'berry', 'apple', 'cherry', 'cherry']) == {'c': ['cherry', 'cherry', 'cherry'], 'a': ['apple', 'apple'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000354", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([0, 3, 4, 1, 5, 2, 1, 2]) == [0, 3, 4, 1, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 3, 4, 1, 5, 2, 1, 2]) == [0, 3, 4, 1, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000355", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(215) == 'CCXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(215) == 'CCXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000356", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(43) == [43]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(43) == [43]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000357", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog. dog Sat Dog Sun') == {'dog': 3, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog. dog Sat Dog Sun') == {'dog': 3, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000358", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 2, 2, 4, 6, 3, 1, 1, 8], 2) == [[1, 2], [2, 4], [6, 3], [1, 1], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 2, 2, 4, 6, 3, 1, 1, 8], 2) == [[1, 2], [2, 4], [6, 3], [1, 1], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000359", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[8, 3], [8, 4]]) == 23\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[8, 3], [8, 4]]) == 23\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000360", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(290) == 'CCXC'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(290) == 'CCXC'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000361", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('(())') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(())') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000362", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(7); s.push(45); s.push(75)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(7); s.push(45); s.push(75)\nassert s.peek() == 75\nassert s.pop() == 75\nassert s.pop() == 45\nassert s.is_empty() == False\nassert s.pop() == 7\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000363", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h10m52s') == 7852\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h10m52s') == 7852\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000364", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(861) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(861) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000365", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 5, 'z': 8}, {'y': 1}) == {'y': 6, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5, 'z': 8}, {'y': 1}) == {'y': 6, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000366", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(82) == 110\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(82) == 110\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000367", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat sun the dog! cat sun') == {'cat': 2, 'sun': 2, 'the': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sun the dog! cat sun') == {'cat': 2, 'sun': 2, 'the': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000368", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 7, 0, 3, 8, 9, 2, 5], [5, 1, 4, 6, 4]) == [1, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 7, 0, 3, 8, 9, 2, 5], [5, 1, 4, 6, 4]) == [1, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000369", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(347) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(347) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000370", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[2, 9, 2, 3], [1, 5, 9, 8], [9, 1, 7, 3]]) == [[2, 1, 9], [9, 5, 1], [2, 9, 7], [3, 8, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 9, 2, 3], [1, 5, 9, 8], [9, 1, 7, 3]]) == [[2, 1, 9], [9, 5, 1], [2, 9, 7], [3, 8, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000371", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sun sun sun the ran ran the') == {'sun': 3, 'the': 2, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun sun the ran ran the') == {'sun': 3, 'the': 2, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000372", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 2, 2, 3], 2) == [2, 3, 1, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 2, 2, 3], 2) == [2, 3, 1, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000373", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCCXLVI') == 346\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXLVI') == 346\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000374", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([19, -7, -9, -8]) == -5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([19, -7, -9, -8]) == -5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000375", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('abcbaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('abcbaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000376", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-4, 0]) == [-4, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-4, 0]) == [-4, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000377", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-1, 3, 0], [2, -1, 7]], [[-4, 9, -8], [1, 9, -9]]) == [[-5, 12, -8], [3, 8, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, 3, 0], [2, -1, 7]], [[-4, 9, -8], [1, 9, -9]]) == [[-5, 12, -8], [3, 8, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000378", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 3, 2, 7, 3, 7, 4], 10) == [3, 7, 4, 1, 3, 2, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 3, 2, 7, 3, 7, 4], 10) == [3, 7, 4, 1, 3, 2, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000379", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(143)\nacc.deposit(154)\nacc.withdraw(233)\nacc.withdraw(448)\nassert acc.get_balance() == 297\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(143)\nacc.deposit(154)\nassert acc.get_balance() == 297\nacc.withdraw(233)\nassert acc.get_balance() == 64\nacc.withdraw(448)\nassert acc.get_balance() == 64\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000380", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 3, 9, 1, 8, 1, 7], 3) == [8, 1, 7, 0, 3, 9, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 3, 9, 1, 8, 1, 7], 3) == [8, 1, 7, 0, 3, 9, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000381", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[0, 9], 3, [5, 0, 1], [3, 1]]) == [0, 9, 3, 5, 0, 1, 3, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 9], 3, [5, 0, 1], [3, 1]]) == [0, 9, 3, 5, 0, 1, 3, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000382", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cbabacacbb', 'bca') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbabacacbb', 'bca') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000383", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([18], [17]) == [17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([18], [17]) == [17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000384", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(457) == 754\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(457) == 754\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000385", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaaaacccccccdddddd') == 'a6c7d6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaacccccccdddddd') == 'a6c7d6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000386", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1378) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1378) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000387", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-8, 8, 1], [3, -9, 4]], [[-9, 3, 6], [-2, -8, 0]]) == [[-17, 11, 7], [1, -17, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 8, 1], [3, -9, 4]], [[-9, 3, 6], [-2, -8, 0]]) == [[-17, 11, 7], [1, -17, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000388", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('27,29') == ['27', '29']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('27,29') == ['27', '29']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000389", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('ccab', 'bcca') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ccab', 'bcca') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000390", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=on; host=121; port=on; mode=off') == {'user': 'on', 'host': '121', 'port': 'on', 'mode': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; host=121; port=on; mode=off') == {'user': 'on', 'host': '121', 'port': 'on', 'mode': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000391", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=475; host=off; mode=445') == {'port': '475', 'host': 'off', 'mode': '445'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=475; host=off; mode=445') == {'port': '475', 'host': 'off', 'mode': '445'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000392", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(2192) == 46\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2192) == 46\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000393", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([2, -5, -2, 18]) == 13\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, -5, -2, 18]) == 13\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000394", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('III') == 3\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('III') == 3\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000395", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('\"a,\",accb,d') == ['a,', 'accb', 'd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"a,\",accb,d') == ['a,', 'accb', 'd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000396", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([21, 8, 44]) == [8, 21, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 8, 44]) == [8, 21, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000397", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('cbbc db ddceb aac') == 'Cbbc Db Ddceb Aac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cbbc db ddceb aac') == 'Cbbc Db Ddceb Aac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000398", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([3, 6, 11, 11, 13, 16], [1, 5, 7, 20, 20]) == [1, 3, 5, 6, 7, 11, 11, 13, 16, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 6, 11, 11, 13, 16], [1, 5, 7, 20, 20]) == [1, 3, 5, 6, 7, 11, 11, 13, 16, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000399", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('XVIII') == 18\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XVIII') == 18\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000400", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=638; host=on; port=841; user=686') == {'mode': '638', 'host': 'on', 'port': '841', 'user': '686'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=638; host=on; port=841; user=686') == {'mode': '638', 'host': 'on', 'port': '841', 'user': '686'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000401", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(13) == 9\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(13) == 9\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000402", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(131, 96) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(131, 96) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000403", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[4, 3, 1], [3, -4, -9], [-3, -6, 9]], [[6, -3, -7], [-1, -1, -8], [3, -1, 3]]) == [[10, 0, -6], [2, -5, -17], [0, -7, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, 3, 1], [3, -4, -9], [-3, -6, 9]], [[6, -3, -7], [-1, -1, -8], [3, -1, 3]]) == [[10, 0, -6], [2, -5, -17], [0, -7, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000404", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(20, 20) == 20\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(20, 20) == 20\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000405", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('b cbdb') == 'B Cbdb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('b cbdb') == 'B Cbdb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000406", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([16, 27, -25, 44, 36, 32, -13, -6, 30]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([16, 27, -25, 44, 36, 32, -13, -6, 30]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000407", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h12m10s') == 15130\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h12m10s') == 15130\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000408", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(70) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(70) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000409", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(86) == [2, 43]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(86) == [2, 43]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000410", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(153) == 'CLIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(153) == 'CLIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000411", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'d': 61, 'e': 95}) == {61: 'd', 95: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 61, 'e': 95}) == {61: 'd', 95: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000412", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([38, 43, 3, 6, 6, 42, 37, 3, 17, 6, 35, 0]) == [0, 3, 3, 6, 6, 6, 17, 35, 37, 38, 42, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([38, 43, 3, 6, 6, 42, 37, 3, 17, 6, 35, 0]) == [0, 3, 3, 6, 6, 6, 17, 35, 37, 38, 42, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000413", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 90, 'c': 6, 'a': 75, 'e': 54, 'b': 68}) == {90: 'd', 6: 'c', 75: 'a', 54: 'e', 68: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 90, 'c': 6, 'a': 75, 'e': 54, 'b': 68}) == {90: 'd', 6: 'c', 75: 'a', 54: 'e', 68: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000414", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(80); s.push(24); s.push(97)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(80); s.push(24); s.push(97)\nassert s.peek() == 97\nassert s.pop() == 97\nassert s.pop() == 24\nassert s.is_empty() == False\nassert s.pop() == 80\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000415", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('1') == 1\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1') == 1\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000416", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([0, 19, 15, 12, 19, 0, 27, 15]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 19, 15, 12, 19, 0, 27, 15]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000417", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(241)\nacc.deposit(33)\nacc.withdraw(249)\nacc.withdraw(325)\nassert acc.get_balance() == 274\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(241)\nacc.deposit(33)\nassert acc.get_balance() == 274\nacc.withdraw(249)\nassert acc.get_balance() == 25\nacc.withdraw(325)\nassert acc.get_balance() == 25\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000418", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbaacaabaaacbb', 'cbc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaacaabaaacbb', 'cbc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000419", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 2}, {'y': 3, 'x': 9, 'w': 4}) == {'y': 5, 'x': 9, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2}, {'y': 3, 'x': 9, 'w': 4}) == {'y': 5, 'x': 9, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000420", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, [4, 5, 2, 7]]) == [8, 4, 5, 2, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [4, 5, 2, 7]]) == [8, 4, 5, 2, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000421", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(375603) == 612\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(375603) == 612\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000422", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([44, 49, 25, 50, 6]) == [6, 25, 44, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 49, 25, 50, 6]) == [6, 25, 44, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000423", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([29, 28, 28, 24, 5]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 28, 28, 24, 5]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000424", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2181) == 'MMCLXXXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2181) == 'MMCLXXXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000425", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Cat sun. cat ran') == {'cat': 2, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat sun. cat ran') == {'cat': 2, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000426", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-4, -35, 34, -21, 50]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-4, -35, 34, -21, 50]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000427", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(290) == 117\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(290) == 117\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000428", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([20, 20, 45, 47, 18, 34, 33, 0, 1, 41, 11, 44, 50, 36]) == [0, 1, 11, 18, 20, 20, 33, 34, 36, 41, 44, 45, 47, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([20, 20, 45, 47, 18, 34, 33, 0, 1, 41, 11, 44, 50, 36]) == [0, 1, 11, 18, 20, 20, 33, 34, 36, 41, 44, 45, 47, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000429", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 3, 5, 0]) == [4, 3, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 3, 5, 0]) == [4, 3, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000430", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(4559) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4559) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000431", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(218) == 'CCXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(218) == 'CCXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000432", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 0], [0, 2]], [[2, 1, 4], [2, 5, 5]]) == [[10, 5, 20], [4, 10, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 0], [0, 2]], [[2, 1, 4], [2, 5, 5]]) == [[10, 5, 20], [4, 10, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000433", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([1, 4, 9, 2, 7, 9, 5, 0, 9, 7, 0, 1, 4, 7, 1], 4) == [[1, 4, 9, 2], [7, 9, 5, 0], [9, 7, 0, 1], [4, 7, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 4, 9, 2, 7, 9, 5, 0, 9, 7, 0, 1, 4, 7, 1], 4) == [[1, 4, 9, 2], [7, 9, 5, 0], [9, 7, 0, 1], [4, 7, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000434", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([4, 13, 29, 34, 37, 82, 89], 111) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 13, 29, 34, 37, 82, 89], 111) == -1\nassert binary_search([4, 13, 29, 34, 37, 82, 89], 4) == 0\nassert binary_search([4, 13, 29, 34, 37, 82, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000435", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(176, 135) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(176, 135) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000436", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[7, 5, 6], 9]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[7, 5, 6], 9]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000437", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('ee,\"bb,,,\"') == ['ee', 'bb,,,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ee,\"bb,,,\"') == ['ee', 'bb,,,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000438", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('caccccbaaa', 'aaa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caccccbaaa', 'aaa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000439", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['b', 'b', 'c', 'b', 'e', 'e', 'b']) == {'b': 4, 'c': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'b', 'c', 'b', 'e', 'e', 'b']) == {'b': 4, 'c': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000440", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([0, 1, 3, 8, 8, 12, 18], [4, 8, 12, 17, 17, 20]) == [0, 1, 3, 4, 8, 8, 8, 12, 12, 17, 17, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 3, 8, 8, 12, 18], [4, 8, 12, 17, 17, 20]) == [0, 1, 3, 4, 8, 8, 8, 12, 12, 17, 17, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000441", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(35); s.push(69); s.push(45)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(35); s.push(69); s.push(45)\nassert s.peek() == 45\nassert s.pop() == 45\nassert s.pop() == 69\nassert s.is_empty() == False\nassert s.pop() == 35\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000442", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([1, 6, 5, 9, 9, 3, 3, 3], [0, 7, 8, 0, 9, 4, 4, 6]) == [6, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 6, 5, 9, 9, 3, 3, 3], [0, 7, 8, 0, 9, 4, 4, 6]) == [6, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000443", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(354) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(354) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000444", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 9) == 'ghi'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 9) == 'ghi'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000445", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=229; path=649; host=82') == {'mode': '229', 'path': '649', 'host': '82'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=229; path=649; host=82') == {'mode': '229', 'path': '649', 'host': '82'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000446", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(4, 4) == 256\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 4) == 256\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000447", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'b': 6, 'a': 5, 'c': 3, 'd': 1}, 2) == {'b': 6, 'a': 5, 'c': 3}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 6, 'a': 5, 'c': 3, 'd': 1}, 2) == {'b': 6, 'a': 5, 'c': 3}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000448", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([42, 77, 98], 77) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([42, 77, 98], 77) == 1\nassert binary_search([42, 77, 98], 42) == 0\nassert binary_search([42, 77, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000449", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(41) == 'XLI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(41) == 'XLI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000450", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('bedcbcadeaeaad') == 'bedca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bedcbcadeaeaad') == 'bedca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000451", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(28, 36) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 36) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000452", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'w': 3, 'y': 7}, {'y': 9}) == {'x': 4, 'w': 3, 'y': 16}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'w': 3, 'y': 7}, {'y': 9}) == {'x': 4, 'w': 3, 'y': 16}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000453", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens(']()') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']()') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000454", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([3, 4, 9, 2, 8, 1, 9, 2, 3], 4) == [[3, 4, 9, 2], [8, 1, 9, 2], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 4, 9, 2, 8, 1, 9, 2, 3], 4) == [[3, 4, 9, 2], [8, 1, 9, 2], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000455", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('ebedb', 'ebedbf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ebedb', 'ebedbf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000456", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([5, 43, 16, 19, 45, 47]) == [5, 16, 19, 43, 45, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([5, 43, 16, 19, 45, 47]) == [5, 16, 19, 43, 45, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000457", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCCXXIV') == 324\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXXIV') == 324\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000458", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-9, 0, 7, 9, 1, 6, -2, -3]) == [-9, -9, -2, 7, 8, 14, 12, 9]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-9, 0, 7, 9, 1, 6, -2, -3]) == [-9, -9, -2, 7, 8, 14, 12, 9]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000459", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('zdcbaexe') == 'exeabcdz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zdcbaexe') == 'exeabcdz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000460", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(366) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(366) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000461", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(271) == 'CCLXXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(271) == 'CCLXXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000462", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('ebdd') == 'Ebdd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ebdd') == 'Ebdd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000463", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(39) == [3, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(39) == [3, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000464", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([5, 9, 9, 28, 25, 9, 1, 9]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 9, 9, 28, 25, 9, 1, 9]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000465", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MDCXCIV') == 1694\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDCXCIV') == 1694\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000466", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([3, 4, 3, 8, 9, 7, 0, 2], 3) == [[3, 4, 3], [8, 9, 7], [0, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 4, 3, 8, 9, 7, 0, 2], 3) == [[3, 4, 3], [8, 9, 7], [0, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000467", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Code Hello', 22) == 'Ykza Dahhk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Hello', 22) == 'Ykza Dahhk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000468", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('3 - 5 + 2') == 0\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('3 - 5 + 2') == 0\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000469", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 5, 'e': 9, 'd': 9}, 5) == {'e': 9, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 5, 'e': 9, 'd': 9}, 5) == {'e': 9, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000470", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([17, 64, 72], 64) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 64, 72], 64) == 1\nassert binary_search([17, 64, 72], 17) == 0\nassert binary_search([17, 64, 72], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000471", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h7m22s') == 14842\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h7m22s') == 14842\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000472", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(6667) == 81\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6667) == 81\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000473", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'date', 'berry', 'avocado', 'berry', 'coconut', 'coconut', 'date']) == {'a': ['avocado', 'avocado'], 'd': ['date', 'date'], 'b': ['berry', 'berry'], 'c': ['coconut', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'berry', 'avocado', 'berry', 'coconut', 'coconut', 'date']) == {'a': ['avocado', 'avocado'], 'd': ['date', 'date'], 'b': ['berry', 'berry'], 'c': ['coconut', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000474", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([46, 2, 41]) == [2, 41, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 2, 41]) == [2, 41, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000475", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(876) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(876) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000476", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('eecb') == 'ecb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eecb') == 'ecb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000477", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1860) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1860) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000478", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('cecdb') == 'cedb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cecdb') == 'cedb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000479", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(1123) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1123) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000480", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=on; port=off; user=355; path=987') == {'host': 'on', 'port': 'off', 'user': '355', 'path': '987'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; port=off; user=355; path=987') == {'host': 'on', 'port': 'off', 'user': '355', 'path': '987'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000481", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([28, 24, 42, 1]) == [1, 24, 28, 42]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([28, 24, 42, 1]) == [1, 24, 28, 42]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000482", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(41); s.push(11); s.push(9)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(41); s.push(11); s.push(9)\nassert s.peek() == 9\nassert s.pop() == 9\nassert s.pop() == 11\nassert s.is_empty() == False\nassert s.pop() == 41\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000483", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 5, 5, 4, 6], 4) == [5, 5, 4, 6, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 5, 4, 6], 4) == [5, 5, 4, 6, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000484", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ntbfglxmzryhl') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ntbfglxmzryhl') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000485", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('xcyzzbaxx') == 'xxabzzycx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xcyzzbaxx') == 'xxabzzycx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000486", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([23, 26, 26, 23, 4]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 26, 26, 23, 4]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000487", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(4); s.push(25); s.push(11)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(4); s.push(25); s.push(11)\nassert s.peek() == 11\nassert s.pop() == 11\nassert s.pop() == 25\nassert s.is_empty() == False\nassert s.pop() == 4\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000488", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([8, 7, 8, [8, 5]]) == [8, 7, 8, 8, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, 7, 8, [8, 5]]) == [8, 7, 8, 8, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000489", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[2, 2], [4, 1]], [[3, 2, 5], [4, 0, 2]]) == [[14, 4, 14], [16, 8, 22]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 2], [4, 1]], [[3, 2, 5], [4, 0, 2]]) == [[14, 4, 14], [16, 8, 22]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000490", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(420) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(420) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000491", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[4], 3]) == [4, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], 3]) == [4, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000492", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([2, 46, 45]) == [2, 45, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 46, 45]) == [2, 45, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_000493", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([21, 16, 16]) == [16, 16, 21]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 16, 16]) == [16, 16, 21]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000494", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 1, 6, 9, 9, 0], [0, 1, 2, 1, 7, 4, 5]) == [4, 1, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 1, 6, 9, 9, 0], [0, 1, 2, 1, 7, 4, 5]) == [4, 1, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000495", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=on; mode=off; path=531') == {'host': 'on', 'mode': 'off', 'path': '531'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; mode=off; path=531') == {'host': 'on', 'mode': 'off', 'path': '531'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000496", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(9825) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9825) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000497", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'd', 'b', 'b', 'd', 'e']) == {'a': 1, 'd': 2, 'b': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'b', 'b', 'd', 'e']) == {'a': 1, 'd': 2, 'b': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000498", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 59, 'd': 96, 'c': 86, 'b': 48, 'e': 35}) == {59: 'f', 96: 'd', 86: 'c', 48: 'b', 35: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 59, 'd': 96, 'c': 86, 'b': 48, 'e': 35}) == {59: 'f', 96: 'd', 86: 'c', 48: 'b', 35: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000499", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'cherry', 'coconut']) == {'d': ['date'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'coconut']) == {'d': ['date'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000500", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(13, 7) == 91\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 7) == 91\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000501", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('aubx') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('aubx') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000502", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[4, 1], [9, 1]]) == [[4, 9], [1, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 1], [9, 1]]) == [[4, 9], [1, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000503", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([42, 6, 30, 5, 7, 27, 7]) == [5, 6, 7, 7, 27, 30, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 6, 30, 5, 7, 27, 7]) == [5, 6, 7, 7, 27, 30, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000504", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(235)\nacc.deposit(219)\nacc.withdraw(3)\nacc.withdraw(568)\nassert acc.get_balance() == 454\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(235)\nacc.deposit(219)\nassert acc.get_balance() == 454\nacc.withdraw(3)\nassert acc.get_balance() == 451\nacc.withdraw(568)\nassert acc.get_balance() == 451\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000505", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(23, 8) == 184\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 8) == 184\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000506", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat ran Sun sat cat cat ran. Ran ran cat!') == {'sat': 2, 'ran': 4, 'sun': 1, 'cat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat ran Sun sat cat cat ran. Ran ran cat!') == {'sat': 2, 'ran': 4, 'sun': 1, 'cat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000507", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([8, 9, 7, 4, 0, 9, 7], [1, 7, 1, 6, 6, 2, 8]) == [8, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 9, 7, 4, 0, 9, 7], [1, 7, 1, 6, 6, 2, 8]) == [8, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000508", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(408) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(408) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000509", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(231) == 127\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(231) == 127\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000510", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([9, 6, 4, 9, 7, 0], 6) == [9, 6, 4, 9, 7, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 6, 4, 9, 7, 0], 6) == [9, 6, 4, 9, 7, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000511", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(434) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(434) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000512", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 0, 0], [5, 6, 9, 8, 6, 2, 6, 5]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 0, 0], [5, 6, 9, 8, 6, 2, 6, 5]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000513", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'avocado', 'apple', 'banana']) == {'b': ['banana', 'banana'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'avocado', 'apple', 'banana']) == {'b': ['banana', 'banana'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000514", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([35, 55, 71, 90, 92, 97], 144) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([35, 55, 71, 90, 92, 97], 144) == -1\nassert binary_search([35, 55, 71, 90, 92, 97], 35) == 0\nassert binary_search([35, 55, 71, 90, 92, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000515", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([3, [0, 4, 2, 0], 4, [4, 7, 2, 1]]) == [3, 0, 4, 2, 0, 4, 4, 7, 2, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [0, 4, 2, 0], 4, [4, 7, 2, 1]]) == [3, 0, 4, 2, 0, 4, 4, 7, 2, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000516", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([44, 11, 7, 9]) == [7, 9, 11, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 11, 7, 9]) == [7, 9, 11, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000517", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('ran! sat cat sun ran') == {'ran': 2, 'sat': 1, 'cat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! sat cat sun ran') == {'ran': 2, 'sat': 1, 'cat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000518", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(93, 185) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(93, 185) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000519", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[8, 3, 8, 4], [8, 9], [1, 4, 8, 8], [6, 4]]) == [8, 3, 8, 4, 8, 9, 1, 4, 8, 8, 6, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 3, 8, 4], [8, 9], [1, 4, 8, 8], [6, 4]]) == [8, 3, 8, 4, 8, 9, 1, 4, 8, 8, 6, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000520", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([11, 36, 15, 32, 35, 47, 26]) == [11, 15, 26, 32, 35, 36, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 36, 15, 32, 35, 47, 26]) == [11, 15, 26, 32, 35, 36, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000521", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('xdxexf') == 'fxexdx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xdxexf') == 'fxexdx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000522", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['a', 'd', 'c']) == {'a': 1, 'd': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'c']) == {'a': 1, 'd': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000523", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'berry', 'berry', 'apple', 'date']) == {'a': ['apple', 'apple'], 'b': ['berry', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'berry', 'berry', 'apple', 'date']) == {'a': ['apple', 'apple'], 'b': ['berry', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000524", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([9, [[3]]]) == 12\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9, [[3]]]) == 12\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000525", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(191) == 44\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(191) == 44\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000526", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([16, 10, 8, 27, 2, 9, 8, 2]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 10, 8, 27, 2, 9, 8, 2]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000527", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=on; host=on') == {'port': 'on', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; host=on') == {'port': 'on', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000528", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMDCIII') == 2603\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDCIII') == 2603\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000529", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 4, 2, 5, 1, 0]) == [1, 4, 2, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 2, 5, 1, 0]) == [1, 4, 2, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000530", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'x': 5, 'z': 4, 'w': 6}) == {'z': 12, 'x': 5, 'w': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'x': 5, 'z': 4, 'w': 6}) == {'z': 12, 'x': 5, 'w': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000531", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[8, 5], 0, 1]) == [8, 5, 0, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 5], 0, 1]) == [8, 5, 0, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000532", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([16, 39, 25, 12, 28, 2, 14, 25, 35, 38, 45]) == [2, 12, 14, 16, 25, 25, 28, 35, 38, 39, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([16, 39, 25, 12, 28, 2, 14, 25, 35, 38, 45]) == [2, 12, 14, 16, 25, 25, 28, 35, 38, 39, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000533", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-3, 15]) == 12\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-3, 15]) == 12\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000534", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9], [9, 7], [9], [6, 1, 5, 6], [5, 1, 7]]) == [9, 9, 7, 9, 6, 1, 5, 6, 5, 1, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9], [9, 7], [9], [6, 1, 5, 6], [5, 1, 7]]) == [9, 9, 7, 9, 6, 1, 5, 6, 5, 1, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000535", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccccaaa') == 'c6a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccaaa') == 'c6a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000536", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[6, [8, 0, 7], [6, 5]], [[4], [7, 6, 9]], 2]) == 60\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[6, [8, 0, 7], [6, 5]], [[4], [7, 6, 9]], 2]) == 60\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000537", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([25, 44, 4, 0, 38, 12, 2, 7]) == [0, 2, 4, 7, 12, 25, 38, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 44, 4, 0, 38, 12, 2, 7]) == [0, 2, 4, 7, 12, 25, 38, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000538", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(317) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(317) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000539", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(64) == [2, 2, 2, 2, 2, 2]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(64) == [2, 2, 2, 2, 2, 2]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000540", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 1) == 'yza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 1) == 'yza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000541", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[8, 0], 1, [4]]]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[8, 0], 1, [4]]]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000542", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(5489) == 74\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5489) == 74\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000543", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('bcada') == 'bcad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcada') == 'bcad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000544", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-6, -1, 0], [1, 0, -7]], [[4, -5, 3], [-4, 9, -6]]) == [[-2, -6, 3], [-3, 9, -13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -1, 0], [1, 0, -7]], [[4, -5, 3], [-4, 9, -6]]) == [[-2, -6, 3], [-3, 9, -13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000545", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'b', 'c', 'b', 'b', 'b', 'd']) == {'e': 1, 'b': 4, 'c': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'c', 'b', 'b', 'b', 'd']) == {'e': 1, 'b': 4, 'c': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000546", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[2, 2], [3, 0]], [[1, 4, 5], [4, 2, 5]]) == [[10, 12, 20], [3, 12, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 2], [3, 0]], [[1, 4, 5], [4, 2, 5]]) == [[10, 12, 20], [3, 12, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000547", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'banana', 'date', 'cherry', 'berry']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'banana', 'date', 'cherry', 'berry']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000548", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(22, 8) == 88\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 8) == 88\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000549", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['ax', 'ax', 'axz']) == 'ax'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ax', 'ax', 'axz']) == 'ax'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000550", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-6, -7], [-8, 2]], [[3, 6], [-7, 2]]) == [[-3, -1], [-15, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -7], [-8, 2]], [[3, 6], [-7, 2]]) == [[-3, -1], [-15, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000551", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(15, 76, 70) == 15\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(15, 76, 70) == 15\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000552", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(12 + 18 + (17 + 9))') == 56\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(12 + 18 + (17 + 9))') == 56\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000553", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('aced') == 'Aced'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aced') == 'Aced'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000554", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([12, 6, 6, 12, 7, 20, 6]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 6, 6, 12, 7, 20, 6]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000555", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 3, 2, 1, 0, 3, 5]) == [1, 3, 2, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 2, 1, 0, 3, 5]) == [1, 3, 2, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000556", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(904) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(904) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000557", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['byx', 'bxz', 'b', 'byx']) == 'b'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['byx', 'bxz', 'b', 'byx']) == 'b'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000558", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('geypmybqzvq') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('geypmybqzvq') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000559", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('acbbbcbaabcb', 'ba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acbbbcbaabcb', 'ba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000560", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([2, 13, 37, 21, 45, 3, 29, 34, 47, 29, 45, 38, 38]) == [2, 3, 13, 21, 29, 29, 34, 37, 38, 38, 45, 45, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([2, 13, 37, 21, 45, 3, 29, 34, 47, 29, 45, 38, 38]) == [2, 3, 13, 21, 29, 29, 34, 37, 38, 38, 45, 45, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000561", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(379)\nacc.deposit(219)\nacc.withdraw(580)\nacc.withdraw(612)\nassert acc.get_balance() == 598\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(379)\nacc.deposit(219)\nassert acc.get_balance() == 598\nacc.withdraw(580)\nassert acc.get_balance() == 18\nacc.withdraw(612)\nassert acc.get_balance() == 18\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000562", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(16) == 4\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(16) == 4\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000563", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[5, 7, 2], [3, 6, 8], [8, 4, 1], [5, 2, 3]]) == [[5, 3, 8, 5], [7, 6, 4, 2], [2, 8, 1, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 7, 2], [3, 6, 8], [8, 4, 1], [5, 2, 3]]) == [[5, 3, 8, 5], [7, 6, 4, 2], [2, 8, 1, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000564", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[9, 7, 2, 7], [7, 4, 3], [8, 2, 6]]) == [9, 7, 2, 7, 7, 4, 3, 8, 2, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 7, 2, 7], [7, 4, 3], [8, 2, 6]]) == [9, 7, 2, 7, 7, 4, 3, 8, 2, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000565", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(827) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(827) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000566", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(29, 55) == 1595\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(29, 55) == 1595\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000567", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(50, 62, 582) == 22\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(50, 62, 582) == 22\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000568", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 29, 'e': 65, 'd': 45}) == {29: 'a', 65: 'e', 45: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 29, 'e': 65, 'd': 45}) == {29: 'a', 65: 'e', 45: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000569", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=14; path=off; host=on') == {'mode': '14', 'path': 'off', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=14; path=off; host=on') == {'mode': '14', 'path': 'off', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000570", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[4, 2, 3], [0, 4, 5]], [[1, 2], [0, 3], [0, 2]]) == [[4, 20], [0, 22]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2, 3], [0, 4, 5]], [[1, 2], [0, 3], [0, 2]]) == [[4, 20], [0, 22]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000571", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([35, 41, 38, 26]) == [26, 35, 38, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 41, 38, 26]) == [26, 35, 38, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000572", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[(a(]a(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[(a(]a(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000573", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'c', 'c']) == {'e': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'c', 'c']) == {'e': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000574", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([15, 8, 28, 20, 21, 28, 28, 17]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 8, 28, 20, 21, 28, 28, 17]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000575", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[a}){(}(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[a}){(}(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000576", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('caa') == 'c1a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('caa') == 'c1a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000577", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([3, 2, 1, 8], [6, 6, 9, 3]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 2, 1, 8], [6, 6, 9, 3]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000578", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbbbbababa', 'babb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbababa', 'babb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000579", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([30, 1, 9]) == [1, 9, 30]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 1, 9]) == [1, 9, 30]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_000580", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(88); s.push(9); s.push(70)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(88); s.push(9); s.push(70)\nassert s.peek() == 70\nassert s.pop() == 70\nassert s.pop() == 9\nassert s.is_empty() == False\nassert s.pop() == 88\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000581", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=auto; user=148') == {'path': 'auto', 'user': '148'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=auto; user=148') == {'path': 'auto', 'user': '148'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000582", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 39, 'e': 24, 'b': 97}) == {39: 'd', 24: 'e', 97: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 39, 'e': 24, 'b': 97}) == {39: 'd', 24: 'e', 97: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000583", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([20, 22, 50, 4, 11, 46, 3, 18]) == [3, 4, 11, 18, 20, 22, 46, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 22, 50, 4, 11, 46, 3, 18]) == [3, 4, 11, 18, 20, 22, 46, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000584", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(26, 136) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(26, 136) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000585", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(27)\nacc.deposit(22)\nacc.withdraw(38)\nacc.withdraw(125)\nassert acc.get_balance() == 49\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(27)\nacc.deposit(22)\nassert acc.get_balance() == 49\nacc.withdraw(38)\nassert acc.get_balance() == 11\nacc.withdraw(125)\nassert acc.get_balance() == 11\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000586", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([46, 20, 9, 29]) == [9, 20, 29, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 20, 9, 29]) == [9, 20, 29, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000587", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(98) == [2, 7, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(98) == [2, 7, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000588", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('(]{}[})') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(]{}[})') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000589", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(917055) == 957\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(917055) == 957\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000590", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat. cat ran ran ran. dog cat ran cat. ran') == {'sat': 1, 'cat': 3, 'ran': 5, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat. cat ran ran ran. dog cat ran cat. ran') == {'sat': 1, 'cat': 3, 'ran': 5, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000591", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun ran Cat Sun dog ran') == {'sun': 2, 'ran': 2, 'cat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun ran Cat Sun dog ran') == {'sun': 2, 'ran': 2, 'cat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000592", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['b', 'b', 'e', 'b', 'b', 'd', 'c', 'e', 'b', 'c']) == {'b': 5, 'e': 2, 'd': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'b', 'e', 'b', 'b', 'd', 'c', 'e', 'b', 'c']) == {'b': 5, 'e': 2, 'd': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000593", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 4, 1, 1, 5, 1]) == [3, 4, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 1, 1, 5, 1]) == [3, 4, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000594", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[1], 2, [2, 6, 4], 8, [4]]) == [1, 2, 2, 6, 4, 8, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1], 2, [2, 6, 4], 8, [4]]) == [1, 2, 2, 6, 4, 8, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000595", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aacxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aacxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000596", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('a ggagc') == 'ggagc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('a ggagc') == 'ggagc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000597", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(9, 2) == 81\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 2) == 81\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000598", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 1, 2, 4, 6, 10, 13], [0, 0, 5, 8, 10]) == [0, 0, 0, 1, 2, 4, 5, 6, 8, 10, 10, 13]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 2, 4, 6, 10, 13], [0, 0, 5, 8, 10]) == [0, 0, 0, 1, 2, 4, 5, 6, 8, 10, 10, 13]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000599", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 59, 'e': 84, 'a': 35}) == {59: 'f', 84: 'e', 35: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 59, 'e': 84, 'a': 35}) == {59: 'f', 84: 'e', 35: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000600", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MCDLVIII') == 1458\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCDLVIII') == 1458\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000601", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([1, 11, 26]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 11, 26]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000602", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[9], [[8, 8]]]) == 25\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9], [[8, 8]]]) == 25\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000603", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([18, 1, 9]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 1, 9]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000604", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([3, [5, 9]]) == [3, 5, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [5, 9]]) == [3, 5, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000605", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 6, 2, 0, 8, 5], [5, 4, 3, 4, 8]) == [5, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 6, 2, 0, 8, 5], [5, 4, 3, 4, 8]) == [5, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000606", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'banana', 'cherry', 'coconut', 'banana']) == {'b': ['berry', 'banana', 'banana'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'cherry', 'coconut', 'banana']) == {'b': ['berry', 'banana', 'banana'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000607", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[6, 0, 5, 3], [0, 9, 3, 8], [2, 5, 3, 5]]) == [[6, 0, 2], [0, 9, 5], [5, 3, 3], [3, 8, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 0, 5, 3], [0, 9, 3, 8], [2, 5, 3, 5]]) == [[6, 0, 2], [0, 9, 5], [5, 3, 3], [3, 8, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000608", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('5h31m28s') == 19888\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h31m28s') == 19888\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000609", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat dog sat. cat Cat sat sun sun Sun') == {'sat': 3, 'dog': 1, 'cat': 2, 'sun': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat dog sat. cat Cat sat sun sun Sun') == {'sat': 3, 'dog': 1, 'cat': 2, 'sun': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000610", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([0, [9]]) == [0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, [9]]) == [0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000611", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello', 15) == 'Wtaad'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 15) == 'Wtaad'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000612", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 49, 'c': 19, 'b': 91}) == {49: 'f', 19: 'c', 91: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 49, 'c': 19, 'b': 91}) == {49: 'f', 19: 'c', 91: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000613", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'z': 6, 'y': 9, 'w': 2}) == {'z': 14, 'y': 9, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'z': 6, 'y': 9, 'w': 2}) == {'z': 14, 'y': 9, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000614", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 1}, {'x': 9, 'y': 1}) == {'x': 10, 'y': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1}, {'x': 9, 'y': 1}) == {'x': 10, 'y': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000615", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(8, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000616", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(96); s.push(31); s.push(97)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(96); s.push(31); s.push(97)\nassert s.peek() == 97\nassert s.pop() == 97\nassert s.pop() == 31\nassert s.is_empty() == False\nassert s.pop() == 96\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000617", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 4, 1, 3, 0, 5, 5]) == [2, 4, 1, 3, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 1, 3, 0, 5, 5]) == [2, 4, 1, 3, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000618", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat sat! sun! dog, The') == {'cat': 1, 'sat': 1, 'sun': 1, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sat! sun! dog, The') == {'cat': 1, 'sat': 1, 'sun': 1, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000619", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-7, 4], [5, 5]], [[4, -3], [-1, -9]]) == [[-3, 1], [4, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 4], [5, 5]], [[4, -3], [-1, -9]]) == [[-3, 1], [4, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000620", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abababaabaab', 'ba') == 4\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abababaabaab', 'ba') == 4\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000621", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'c', 'e', 'a', 'c', 'a', 'd', 'b', 'a', 'e']) == {'d': 2, 'c': 2, 'e': 2, 'a': 3, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'c', 'e', 'a', 'c', 'a', 'd', 'b', 'a', 'e']) == {'d': 2, 'c': 2, 'e': 2, 'a': 3, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000622", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([50, 54, 55, 57, 75, 96, 97], 96) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([50, 54, 55, 57, 75, 96, 97], 96) == 5\nassert binary_search([50, 54, 55, 57, 75, 96, 97], 50) == 0\nassert binary_search([50, 54, 55, 57, 75, 96, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000623", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aaaaaaaabbabbbb', 'aaa') == 6\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaaaaabbabbbb', 'aaa') == 6\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000624", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 8, 3, 0, 9, 9, 3, 5], [0, 8, 1, 3]) == [8, 3, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 8, 3, 0, 9, 9, 3, 5], [0, 8, 1, 3]) == [8, 3, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000625", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(491063) == 700\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(491063) == 700\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000626", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(')[{(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')[{(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000627", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 6, 3, 8, 3], [2, 4, 4, 4]) == [2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 6, 3, 8, 3], [2, 4, 4, 4]) == [2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000628", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([33, 1, 27]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([33, 1, 27]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000629", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, 3], [1, 3]], [[4, 0], [0, -7]]) == [[10, 3], [1, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, 3], [1, 3]], [[4, 0], [0, -7]]) == [[10, 3], [1, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000630", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([22, 6, 6, 19, 22]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 6, 6, 19, 22]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000631", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aaaabbababbbaaab', 'aa') == 5\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaabbababbbaaab', 'aa') == 5\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000632", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'date', 'banana', 'coconut', 'date', 'cherry']) == {'a': ['avocado'], 'd': ['date', 'date'], 'b': ['banana'], 'c': ['coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'banana', 'coconut', 'date', 'cherry']) == {'a': ['avocado'], 'd': ['date', 'date'], 'b': ['banana'], 'c': ['coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000633", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([28, 43, 48], 155) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([28, 43, 48], 155) == -1\nassert binary_search([28, 43, 48], 28) == 0\nassert binary_search([28, 43, 48], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000634", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([30, 14, 10]) == [10, 14, 30]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([30, 14, 10]) == [10, 14, 30]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000635", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 8, 9, 4, 1, 5, 1, 7], [2, 8, 4]) == [8, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 8, 9, 4, 1, 5, 1, 7], [2, 8, 4]) == [8, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000636", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('39m3s') == 2343\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('39m3s') == 2343\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000637", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 1, 0, 0, 3, 3, 1]) == [3, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 0, 0, 3, 3, 1]) == [3, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000638", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 1}, {'z': 2, 'x': 5, 'y': 2}) == {'x': 6, 'z': 2, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1}, {'z': 2, 'x': 5, 'y': 2}) == {'x': 6, 'z': 2, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000639", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dddaa') == 'd3a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddaa') == 'd3a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000640", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([58, 64, 79], 79) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([58, 64, 79], 79) == 2\nassert binary_search([58, 64, 79], 58) == 0\nassert binary_search([58, 64, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000641", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(')]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000642", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[0, 9], 9, [9, 0]]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 9], 9, [9, 0]]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000643", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('ccccbaaccbc', 'cba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ccccbaaccbc', 'cba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000644", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=off; port=auto; host=144') == {'user': 'off', 'port': 'auto', 'host': '144'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; port=auto; host=144') == {'user': 'off', 'port': 'auto', 'host': '144'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000645", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([5, [1]]) == [5, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [1]]) == [5, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000646", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 1, 'y': 6, 'w': 9}, {'y': 5}) == {'x': 1, 'y': 11, 'w': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1, 'y': 6, 'w': 9}, {'y': 5}) == {'x': 1, 'y': 11, 'w': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000647", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('((aaab') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('((aaab') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000648", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([9, 5, 2, 4, 7, 0, 4], [2, 0, 2, 7, 8]) == [2, 7, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 5, 2, 4, 7, 0, 4], [2, 0, 2, 7, 8]) == [2, 7, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000649", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[1, -8, -2], [-9, -7, 8], [2, 6, 7], [8, 9, -9]], [[-8, -3, -4], [-5, 8, 6], [-3, -7, -4], [4, 0, -8]]) == [[-7, -11, -6], [-14, 1, 14], [-1, -1, 3], [12, 9, -17]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -8, -2], [-9, -7, 8], [2, 6, 7], [8, 9, -9]], [[-8, -3, -4], [-5, 8, 6], [-3, -7, -4], [4, 0, -8]]) == [[-7, -11, -6], [-14, 1, 14], [-1, -1, 3], [12, 9, -17]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000650", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(90) == 'XC'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(90) == 'XC'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000651", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([37, 34, 32, 18, -38, 12, -35]) == 37\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([37, 34, 32, 18, -38, 12, -35]) == 37\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000652", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['d', 'e', 'e', 'c', 'd', 'b', 'a', 'd']) == {'d': 3, 'e': 2, 'c': 1, 'b': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'e', 'c', 'd', 'b', 'a', 'd']) == {'d': 3, 'e': 2, 'c': 1, 'b': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000653", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('abcdcbdbabe') == 'abcde'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abcdcbdbabe') == 'abcde'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000654", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('Sun sun ran ran, the ran! the, The sun Cat') == {'sun': 3, 'ran': 3, 'the': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sun sun ran ran, the ran! the, The sun Cat') == {'sun': 3, 'ran': 3, 'the': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000655", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('vutqcq') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('vutqcq') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000656", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('}[b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}[b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000657", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 9, 3, 4, 7, 1, 6, 0, 0, 9], 3) == [[6, 9, 3], [4, 7, 1], [6, 0, 0], [9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 3, 4, 7, 1, 6, 0, 0, 9], 3) == [[6, 9, 3], [4, 7, 1], [6, 0, 0], [9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000658", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(19, 51) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 51) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000659", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 28, 'c': 38, 'd': 73, 'f': 51, 'a': 78}) == {28: 'b', 38: 'c', 73: 'd', 51: 'f', 78: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 28, 'c': 38, 'd': 73, 'f': 51, 'a': 78}) == {28: 'b', 38: 'c', 73: 'd', 51: 'f', 78: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000660", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(224) == [2, 2, 2, 2, 2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(224) == [2, 2, 2, 2, 2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000661", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[5, 4, 4], [2, 3, 3]], [[5, 5, 5], [5, 4, 1], [5, 3, 2]]) == [[65, 53, 37], [40, 31, 19]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 4, 4], [2, 3, 3]], [[5, 5, 5], [5, 4, 1], [5, 3, 2]]) == [[65, 53, 37], [40, 31, 19]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000662", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[0, 4, 8, 0], [5, 9, 5, 0], [9, 1, 3, 2], [8, 5, 8, 9]]) == [[0, 5, 9, 8], [4, 9, 1, 5], [8, 5, 3, 8], [0, 0, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 4, 8, 0], [5, 9, 5, 0], [9, 1, 3, 2], [8, 5, 8, 9]]) == [[0, 5, 9, 8], [4, 9, 1, 5], [8, 5, 3, 8], [0, 0, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000663", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'date', 'berry', 'coconut', 'berry', 'apple']) == {'b': ['berry', 'berry', 'berry'], 'd': ['date'], 'c': ['coconut'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'berry', 'coconut', 'berry', 'apple']) == {'b': ['berry', 'berry', 'berry'], 'd': ['date'], 'c': ['coconut'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000664", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran. the sun cat sat cat Cat dog, the dog') == {'ran': 1, 'the': 2, 'sun': 1, 'cat': 3, 'sat': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran. the sun cat sat cat Cat dog, the dog') == {'ran': 1, 'the': 2, 'sun': 1, 'cat': 3, 'sat': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000665", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'd', 'a', 'c', 'e']) == {'e': 2, 'd': 1, 'a': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'd', 'a', 'c', 'e']) == {'e': 2, 'd': 1, 'a': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000666", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([7, 9, 5, 8, 1, 3, 6, 2, 2, 6, 1, 9, 4, 9, 2, 1], 3) == [[7, 9, 5], [8, 1, 3], [6, 2, 2], [6, 1, 9], [4, 9, 2], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 9, 5, 8, 1, 3, 6, 2, 2, 6, 1, 9, 4, 9, 2, 1], 3) == [[7, 9, 5], [8, 1, 3], [6, 2, 2], [6, 1, 9], [4, 9, 2], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000667", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([36, 10, 9, 16, 35, 31, 28, 13, 6, 13, 16]) == [6, 9, 10, 13, 13, 16, 16, 28, 31, 35, 36]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([36, 10, 9, 16, 35, 31, 28, 13, 6, 13, 16]) == [6, 9, 10, 13, 13, 16, 16, 28, 31, 35, 36]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000668", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cbaaaaaab', 'aac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbaaaaaab', 'aac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000669", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[3, 6, 4, -5], [-5, 9, -3, -3], [3, 1, -4, 9], [-4, 5, -1, 4]], [[-3, 3, -2, -1], [6, -1, -2, 5], [-4, 1, -3, 9], [4, 7, -4, 7]]) == [[0, 9, 2, -6], [1, 8, -5, 2], [-1, 2, -7, 18], [0, 12, -5, 11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, 6, 4, -5], [-5, 9, -3, -3], [3, 1, -4, 9], [-4, 5, -1, 4]], [[-3, 3, -2, -1], [6, -1, -2, 5], [-4, 1, -3, 9], [4, 7, -4, 7]]) == [[0, 9, 2, -6], [1, 8, -5, 2], [-1, 2, -7, 18], [0, 12, -5, 11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000670", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(1482) == 15\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1482) == 15\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000671", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('5h1s') == 18001\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h1s') == 18001\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000672", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 6, 1, 2, 7, 3, 4, 7], [6, 0, 7, 8, 4, 3, 7, 2]) == [4, 6, 2, 7, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 6, 1, 2, 7, 3, 4, 7], [6, 0, 7, 8, 4, 3, 7, 2]) == [4, 6, 2, 7, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000673", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('][{{]b){') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('][{{]b){') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000674", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(81); s.push(31); s.push(21)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(31); s.push(21)\nassert s.peek() == 21\nassert s.pop() == 21\nassert s.pop() == 31\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000675", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('1h18m53s') == 4733\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h18m53s') == 4733\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000676", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(3191) == 1913\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3191) == 1913\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000677", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([3, 37, 39, 52, 61, 70, 88, 89, 99], 165) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 37, 39, 52, 61, 70, 88, 89, 99], 165) == -1\nassert binary_search([3, 37, 39, 52, 61, 70, 88, 89, 99], 3) == 0\nassert binary_search([3, 37, 39, 52, 61, 70, 88, 89, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000678", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('\"b,bab\",\"a,\",71,98,aab') == ['b,bab', 'a,', '71', '98', 'aab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"b,bab\",\"a,\",71,98,aab') == ['b,bab', 'a,', '71', '98', 'aab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000679", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([3, 7, 1, 3, 0, 1, 6, 7, 2, 2], 9) == [7, 1, 3, 0, 1, 6, 7, 2, 2, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 7, 1, 3, 0, 1, 6, 7, 2, 2], 9) == [7, 1, 3, 0, 1, 6, 7, 2, 2, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000680", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([32, 32, 42, 46, 20, 41, 41, 39, 30, 14, 49, 38]) == [14, 20, 30, 32, 32, 38, 39, 41, 41, 42, 46, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([32, 32, 42, 46, 20, 41, 41, 39, 30, 14, 49, 38]) == [14, 20, 30, 32, 32, 38, 39, 41, 41, 42, 46, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000681", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=274; port=auto; path=off; mode=356') == {'user': '274', 'port': 'auto', 'path': 'off', 'mode': '356'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=274; port=auto; path=off; mode=356') == {'user': '274', 'port': 'auto', 'path': 'off', 'mode': '356'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000682", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 2, 5, 5, 1, 0]) == [5, 2, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 5, 5, 1, 0]) == [5, 2, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000683", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, 6], [-2, 6], [-5, 2]], [[-5, 5], [6, 2], [-8, 2]]) == [[-12, 11], [4, 8], [-13, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 6], [-2, 6], [-5, 2]], [[-5, 5], [6, 2], [-8, 2]]) == [[-12, 11], [4, 8], [-13, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000684", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(177) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(177) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000685", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(3489) == 'MMMCDLXXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3489) == 'MMMCDLXXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000686", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([28, 28, 25, 25, 25, 20]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 28, 25, 25, 25, 20]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000687", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 9, 0, 9, 3, 7, 6, 6, 7, 6], 10) == [1, 9, 0, 9, 3, 7, 6, 6, 7, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 9, 0, 9, 3, 7, 6, 6, 7, 6], 10) == [1, 9, 0, 9, 3, 7, 6, 6, 7, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000688", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'y': 2}, {'z': 7, 'x': 6, 'y': 3}) == {'w': 7, 'y': 5, 'z': 7, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'y': 2}, {'z': 7, 'x': 6, 'y': 3}) == {'w': 7, 'y': 5, 'z': 7, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000689", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(47, 32) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(47, 32) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000690", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[9, 1, 7, 8], [8, 9, 8, 8], [8, 4, 9, 2], [4, 8, 4, 6]]) == [[9, 8, 8, 4], [1, 9, 4, 8], [7, 8, 9, 4], [8, 8, 2, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 1, 7, 8], [8, 9, 8, 8], [8, 4, 9, 2], [4, 8, 4, 6]]) == [[9, 8, 8, 4], [1, 9, 4, 8], [7, 8, 9, 4], [8, 8, 2, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000691", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(99) == 25\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(99) == 25\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000692", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MCMLXXII') == 1972\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCMLXXII') == 1972\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000693", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('ccbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000694", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([48, 4, 20, 12, 19]) == [4, 12, 19, 20, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 4, 20, 12, 19]) == [4, 12, 19, 20, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000695", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('the! Sat Sat cat the! dog') == {'the': 2, 'sat': 2, 'cat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the! Sat Sat cat the! dog') == {'the': 2, 'sat': 2, 'cat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000696", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(284) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(284) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000697", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'e': 9, 'd': 1, 'b': 6}, 2) == {'e': 9, 'b': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 9, 'd': 1, 'b': 6}, 2) == {'e': 9, 'b': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000698", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(17, 22) == 374\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 22) == 374\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000699", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('daeb') == 'daeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daeb') == 'daeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000700", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([0, 32, 13]) == [0, 13, 32]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([0, 32, 13]) == [0, 13, 32]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000701", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([3, 5, 0, 8, 5, 6, 0, 9, 9], 16) == [0, 8, 5, 6, 0, 9, 9, 3, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 5, 0, 8, 5, 6, 0, 9, 9], 16) == [0, 8, 5, 6, 0, 9, 9, 3, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000702", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ddcdddddd') == 'd2c1d6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddcdddddd') == 'd2c1d6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000703", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'cherry', 'date', 'coconut', 'apple', 'avocado']) == {'c': ['coconut', 'cherry', 'coconut'], 'b': ['banana'], 'd': ['date'], 'a': ['apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'cherry', 'date', 'coconut', 'apple', 'avocado']) == {'c': ['coconut', 'cherry', 'coconut'], 'b': ['banana'], 'd': ['date'], 'a': ['apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000704", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCXVII') == 217\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXVII') == 217\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000705", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat sun the! Cat sat cat.') == {'sat': 2, 'sun': 1, 'the': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun the! Cat sat cat.') == {'sat': 2, 'sun': 1, 'the': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000706", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([10, 17, 18], [8, 12, 14]) == [8, 10, 12, 14, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([10, 17, 18], [8, 12, 14]) == [8, 10, 12, 14, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000707", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(50); s.push(42); s.push(87)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(50); s.push(42); s.push(87)\nassert s.peek() == 87\nassert s.pop() == 87\nassert s.pop() == 42\nassert s.is_empty() == False\nassert s.pop() == 50\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000708", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(100) == 25\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(100) == 25\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000709", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('edb,babb') == ['edb', 'babb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('edb,babb') == ['edb', 'babb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000710", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCLXI') == 261\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXI') == 261\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000711", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('ebee dfgd h gg') == 'ebee'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ebee dfgd h gg') == 'ebee'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000712", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3055) == 'MMMLV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3055) == 'MMMLV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000713", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fg ba ded ddch efebfeb eb') == 'efebfeb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fg ba ded ddch efebfeb eb') == 'efebfeb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000714", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(841979) == 917\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(841979) == 917\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000715", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 4, 9], 3) == [2, 4, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 4, 9], 3) == [2, 4, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000716", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9196) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9196) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000717", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(67) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(67) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000718", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('ccb ee gbgafehc hac geeeebf') == 'gbgafehc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ccb ee gbgafehc hac geeeebf') == 'gbgafehc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000719", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(31, 25) == 775\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(31, 25) == 775\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000720", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[1, 1], [2, 3]], [[3, 0, 1], [0, 4, 4]]) == [[3, 4, 5], [6, 12, 14]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1], [2, 3]], [[3, 0, 1], [0, 4, 4]]) == [[3, 4, 5], [6, 12, 14]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000721", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1792) == 2971\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1792) == 2971\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000722", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'w': 7, 'y': 6}, {'z': 3}) == {'z': 12, 'w': 7, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'w': 7, 'y': 6}, {'z': 3}) == {'z': 12, 'w': 7, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000723", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[]()[]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]()[]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000724", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(1875) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1875) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000725", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(747) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(747) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000726", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(28); s.push(86); s.push(55)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(28); s.push(86); s.push(55)\nassert s.peek() == 55\nassert s.pop() == 55\nassert s.pop() == 86\nassert s.is_empty() == False\nassert s.pop() == 28\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000727", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 79, 'd': 68, 'f': 61, 'e': 16, 'a': 31}) == {79: 'b', 68: 'd', 61: 'f', 16: 'e', 31: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 79, 'd': 68, 'f': 61, 'e': 16, 'a': 31}) == {79: 'b', 68: 'd', 61: 'f', 16: 'e', 31: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000728", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=348; path=328; mode=370') == {'user': '348', 'path': '328', 'mode': '370'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=348; path=328; mode=370') == {'user': '348', 'path': '328', 'mode': '370'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000729", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(5 + 9 - (14 * 1))') == 0\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(5 + 9 - (14 * 1))') == 0\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000730", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 9, 'z': 9, 'y': 5}, {'x': 3}) == {'w': 9, 'z': 9, 'y': 5, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9, 'z': 9, 'y': 5}, {'x': 3}) == {'w': 9, 'z': 9, 'y': 5, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000731", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(4616) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4616) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000732", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([17, 26, 28, 40, 73, 75, 84, 86, 88], 17) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 26, 28, 40, 73, 75, 84, 86, 88], 17) == 0\nassert binary_search([17, 26, 28, 40, 73, 75, 84, 86, 88], 17) == 0\nassert binary_search([17, 26, 28, 40, 73, 75, 84, 86, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000733", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([0, 5, 22, 75, 76, 89], 5) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 5, 22, 75, 76, 89], 5) == 1\nassert binary_search([0, 5, 22, 75, 76, 89], 0) == 0\nassert binary_search([0, 5, 22, 75, 76, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000734", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(177) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(177) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000735", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-4, 7, 6], [-5, -1, -2], [5, -7, 2]], [[-9, 4, -5], [-9, -2, -4], [-6, -2, 0]]) == [[-13, 11, 1], [-14, -3, -6], [-1, -9, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 7, 6], [-5, -1, -2], [5, -7, 2]], [[-9, 4, -5], [-9, -2, -4], [-6, -2, 0]]) == [[-13, 11, 1], [-14, -3, -6], [-1, -9, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000736", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(287)\nacc.deposit(224)\nacc.withdraw(391)\nacc.withdraw(591)\nassert acc.get_balance() == 511\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(287)\nacc.deposit(224)\nassert acc.get_balance() == 511\nacc.withdraw(391)\nassert acc.get_balance() == 120\nacc.withdraw(591)\nassert acc.get_balance() == 120\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000737", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(17); s.push(76); s.push(98)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(17); s.push(76); s.push(98)\nassert s.peek() == 98\nassert s.pop() == 98\nassert s.pop() == 76\nassert s.is_empty() == False\nassert s.pop() == 17\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000738", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 1, 2, 1, 9], [7, 0, 6]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 1, 2, 1, 9], [7, 0, 6]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000739", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=auto; mode=on; user=878') == {'port': 'auto', 'mode': 'on', 'user': '878'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; mode=on; user=878') == {'port': 'auto', 'mode': 'on', 'user': '878'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000740", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('aacfdab', 'dabacaf') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aacfdab', 'dabacaf') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000741", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[9, 0, 6, 0], [8], [9, 9]]) == [9, 0, 6, 0, 8, 9, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 0, 6, 0], [8], [9, 9]]) == [9, 0, 6, 0, 8, 9, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000742", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(67) == [67]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(67) == [67]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000743", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([27, 43, 61, 88], 88) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([27, 43, 61, 88], 88) == 3\nassert binary_search([27, 43, 61, 88], 27) == 0\nassert binary_search([27, 43, 61, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000744", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(42, 7, 133) == 63\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(42, 7, 133) == 63\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000745", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'avocado', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['coconut', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'avocado', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['coconut', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000746", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aaebbcba') == 'aebc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaebbcba') == 'aebc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000747", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 5, 2, 3, 4, 4, 4]) == [3, 5, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 2, 3, 4, 4, 4]) == [3, 5, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000748", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([0, 2, 2, 44, 1, 4, 10, 14, 24, 43, 38, 33]) == [0, 1, 2, 2, 4, 10, 14, 24, 33, 38, 43, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([0, 2, 2, 44, 1, 4, 10, 14, 24, 43, 38, 33]) == [0, 1, 2, 2, 4, 10, 14, 24, 33, 38, 43, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000749", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'apple', 'cherry', 'coconut', 'berry', 'avocado', 'coconut']) == {'c': ['coconut', 'cherry', 'coconut', 'coconut'], 'a': ['apple', 'apple', 'avocado'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'apple', 'cherry', 'coconut', 'berry', 'avocado', 'coconut']) == {'c': ['coconut', 'cherry', 'coconut', 'coconut'], 'a': ['apple', 'apple', 'avocado'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000750", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('fcbc', 'fcbcb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fcbc', 'fcbcb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000751", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 2, 1, 5, 0, 4, 3, 1, 4]) == [1, 2, 5, 0, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 1, 5, 0, 4, 3, 1, 4]) == [1, 2, 5, 0, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000752", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=42; host=on; port=off') == {'path': '42', 'host': 'on', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=42; host=on; port=off') == {'path': '42', 'host': 'on', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000753", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(2748) == 'MMDCCXLVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2748) == 'MMDCCXLVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000754", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h4m4s') == 7444\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h4m4s') == 7444\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000755", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(57); s.push(30); s.push(87)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(57); s.push(30); s.push(87)\nassert s.peek() == 87\nassert s.pop() == 87\nassert s.pop() == 30\nassert s.is_empty() == False\nassert s.pop() == 57\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000756", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(4 * 1) - 4') == 0\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(4 * 1) - 4') == 0\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000757", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 2], [0, 2]], [[0, 4, 5], [3, 5, 3]]) == [[6, 22, 21], [6, 10, 6]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 2], [0, 2]], [[0, 4, 5], [3, 5, 3]]) == [[6, 22, 21], [6, 10, 6]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000758", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['c', 'a', 'c', 'e']) == {'c': 2, 'a': 1, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'c', 'e']) == {'c': 2, 'a': 1, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000759", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('edcbaada') == 'edcba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edcbaada') == 'edcba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000760", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 0, 8, 7, 9, 5, 4, 8, 8, 5, 1], 3) == [[6, 0, 8], [7, 9, 5], [4, 8, 8], [5, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 0, 8, 7, 9, 5, 4, 8, 8, 5, 1], 3) == [[6, 0, 8], [7, 9, 5], [4, 8, 8], [5, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000761", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(1173) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1173) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000762", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-6, -3, -6, 9], [0, 1, 1, 4]], [[0, 7, -7, -6], [9, -4, -4, -5]]) == [[-6, 4, -13, 3], [9, -3, -3, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -3, -6, 9], [0, 1, 1, 4]], [[0, 7, -7, -6], [9, -4, -4, -5]]) == [[-6, 4, -13, 3], [9, -3, -3, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000763", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([22, 22, 27, 26, 22, 27]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 22, 27, 26, 22, 27]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000764", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('31,9,ee,e,bdbe') == ['31', '9', 'ee', 'e', 'bdbe']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('31,9,ee,e,bdbe') == ['31', '9', 'ee', 'e', 'bdbe']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000765", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([3, 19, 24, 1, 7, 10]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 19, 24, 1, 7, 10]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000766", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([4, 6, [1, 8]]) == 19\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, 6, [1, 8]]) == 19\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000767", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(30, 21) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(30, 21) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000768", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Hello Python', 15) == 'Wtaad Eniwdc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Python', 15) == 'Wtaad Eniwdc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000769", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('18') == 18\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('18') == 18\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000770", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(54, 56) == 1512\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(54, 56) == 1512\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000771", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 1, 4, 1]) == [3, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 4, 1]) == [3, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000772", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(194, 180) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(194, 180) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000773", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([7, [8]]) == [7, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([7, [8]]) == [7, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000774", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('World Code', 21) == 'Rjmgy Xjyz'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Code', 21) == 'Rjmgy Xjyz'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000775", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([28, 10, 20, 20, 29]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 10, 20, 20, 29]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000776", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dedeae caddbc dad acdb') == 'Dedeae Caddbc Dad Acdb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dedeae caddbc dad acdb') == 'Dedeae Caddbc Dad Acdb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000777", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([0, 3, 30, 32, 40, 63, 97], 32) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 3, 30, 32, 40, 63, 97], 32) == 3\nassert binary_search([0, 3, 30, 32, 40, 63, 97], 0) == 0\nassert binary_search([0, 3, 30, 32, 40, 63, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000778", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('caxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000779", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'x': 9, 'y': 2, 'z': 6}) == {'z': 14, 'x': 9, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'x': 9, 'y': 2, 'z': 6}) == {'z': 14, 'x': 9, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000780", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 1, 4], [0, 5, 3], [2, 5, 3]], [[2, 5, 5], [1, 2, 4], [2, 1, 0]]) == [[11, 11, 9], [11, 13, 20], [15, 23, 30]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 4], [0, 5, 3], [2, 5, 3]], [[2, 5, 5], [1, 2, 4], [2, 1, 0]]) == [[11, 11, 9], [11, 13, 20], [15, 23, 30]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000781", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-3, 6], [-1, 3], [-3, 8]], [[6, 5], [3, -1], [6, 4]]) == [[3, 11], [2, 2], [3, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 6], [-1, 3], [-3, 8]], [[6, 5], [3, -1], [6, 4]]) == [[3, 11], [2, 2], [3, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000782", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('ac e bbdbed') == 'Ac E Bbdbed'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ac e bbdbed') == 'Ac E Bbdbed'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000783", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(6, 35, 32) == 0\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(6, 35, 32) == 0\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000784", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('hchdeheg afbedcd bdbdch') == 'hchdeheg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hchdeheg afbedcd bdbdch') == 'hchdeheg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000785", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(47, 24, 61) == 1\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(47, 24, 61) == 1\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000786", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCLXXXVI') == 286\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXXVI') == 286\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000787", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=169; mode=auto; port=off; user=auto') == {'path': '169', 'mode': 'auto', 'port': 'off', 'user': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=169; mode=auto; port=off; user=auto') == {'path': '169', 'mode': 'auto', 'port': 'off', 'user': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000788", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[1, 3, 0], [3, 0, 3]], [[0, 0, 5], [4, 0, 4], [3, 1, 5]]) == [[12, 0, 17], [9, 3, 30]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 3, 0], [3, 0, 3]], [[0, 0, 5], [4, 0, 4], [3, 1, 5]]) == [[12, 0, 17], [9, 3, 30]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000789", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('aolhdm') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('aolhdm') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000790", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-34, -2, 14, -9]) == 14\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-34, -2, 14, -9]) == 14\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000791", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(9510) == 159\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(9510) == 159\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000792", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([4, 11, 12], [0, 0, 2, 15, 16, 18]) == [0, 0, 2, 4, 11, 12, 15, 16, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 11, 12], [0, 0, 2, 15, 16, 18]) == [0, 0, 2, 4, 11, 12, 15, 16, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000793", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(25727) == 160\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(25727) == 160\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000794", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 7}, {'w': 2, 'z': 6}) == {'w': 9, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7}, {'w': 2, 'z': 6}) == {'w': 9, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000795", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cccyy', 'cccy', 'ccczy', 'ccc']) == 'ccc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cccyy', 'cccy', 'ccczy', 'ccc']) == 'ccc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000796", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('daachde eefeheh gcdcdgbb cahcd') == 'gcdcdgbb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('daachde eefeheh gcdcdgbb cahcd') == 'gcdcdgbb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000797", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('63,dd') == ['63', 'dd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('63,dd') == ['63', 'dd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000798", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([38, 15, 12, 6]) == [6, 12, 15, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([38, 15, 12, 6]) == [6, 12, 15, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000799", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('gegcee fccfdb edbabbd ffahaa abahbdg dfeege') == 'edbabbd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gegcee fccfdb edbabbd ffahaa abahbdg dfeege') == 'edbabbd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000800", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=411; path=305') == {'host': '411', 'path': '305'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=411; path=305') == {'host': '411', 'path': '305'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000801", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([0, 46, 36, 23, 50, 1]) == [0, 1, 23, 36, 46, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 46, 36, 23, 50, 1]) == [0, 1, 23, 36, 46, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000802", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([5, 7, 6, 7, 4, 8, 9, 2, 0, 1], 15) == [8, 9, 2, 0, 1, 5, 7, 6, 7, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 7, 6, 7, 4, 8, 9, 2, 0, 1], 15) == [8, 9, 2, 0, 1, 5, 7, 6, 7, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000803", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['banana', 'apple', 'banana', 'banana', 'banana', 'cherry', 'avocado']) == {'b': ['banana', 'banana', 'banana', 'banana'], 'a': ['apple', 'avocado'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'banana', 'banana', 'banana', 'cherry', 'avocado']) == {'b': ['banana', 'banana', 'banana', 'banana'], 'a': ['apple', 'avocado'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000804", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([2, 28, 48]) == [2, 28, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([2, 28, 48]) == [2, 28, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000805", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('bcdba') == 'bcda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcdba') == 'bcda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000806", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 7, 4, 1], 1) == [1, 1, 7, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 7, 4, 1], 1) == [1, 1, 7, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000807", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(52)\nacc.deposit(7)\nacc.withdraw(55)\nacc.withdraw(177)\nassert acc.get_balance() == 59\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(52)\nacc.deposit(7)\nassert acc.get_balance() == 59\nacc.withdraw(55)\nassert acc.get_balance() == 4\nacc.withdraw(177)\nassert acc.get_balance() == 4\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000808", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([12, 18], [4, 4, 7, 7, 12, 14, 14]) == [4, 4, 7, 7, 12, 12, 14, 14, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([12, 18], [4, 4, 7, 7, 12, 14, 14]) == [4, 4, 7, 7, 12, 12, 14, 14, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000809", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(3972) == 63\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3972) == 63\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000810", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(474) == 35\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(474) == 35\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000811", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('World Python', 12) == 'Iadxp Bkftaz'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Python', 12) == 'Iadxp Bkftaz'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000812", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'cherry', 'date', 'avocado']) == {'b': ['banana'], 'c': ['coconut', 'cherry'], 'd': ['date'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'cherry', 'date', 'avocado']) == {'b': ['banana'], 'c': ['coconut', 'cherry'], 'd': ['date'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000813", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(94, 177) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(94, 177) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000814", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([10, 10, 24, 12, 10]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 10, 24, 12, 10]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000815", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([34, 6, 9, 7, 1, 24, 34, 25, 21, 33, 36]) == [1, 6, 7, 9, 21, 24, 25, 33, 34, 34, 36]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([34, 6, 9, 7, 1, 24, 34, 25, 21, 33, 36]) == [1, 6, 7, 9, 21, 24, 25, 33, 34, 34, 36]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000816", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=34; path=494; mode=on; host=819') == {'port': '34', 'path': '494', 'mode': 'on', 'host': '819'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=34; path=494; mode=on; host=819') == {'port': '34', 'path': '494', 'mode': 'on', 'host': '819'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000817", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([20, 42, 48, 29, 22]) == [20, 22, 29, 42, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 42, 48, 29, 22]) == [20, 22, 29, 42, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000818", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(5, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000819", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(12) == 'XII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(12) == 'XII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000820", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([15, 16, 7]) == [7, 15, 16]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([15, 16, 7]) == [7, 15, 16]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000821", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCLXXXIV') == 284\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXXIV') == 284\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000822", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(18, 16) == 144\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(18, 16) == 144\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000823", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'e': 5, 'c': 9, 'd': 4, 'a': 6}, 2) == {'e': 5, 'c': 9, 'd': 4, 'a': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 5, 'c': 9, 'd': 4, 'a': 6}, 2) == {'e': 5, 'c': 9, 'd': 4, 'a': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000824", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(463) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(463) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000825", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([9, 7, 7, 9, 4, 4, 4, 2, 0, 3], 3) == [2, 0, 3, 9, 7, 7, 9, 4, 4, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 7, 7, 9, 4, 4, 4, 2, 0, 3], 3) == [2, 0, 3, 9, 7, 7, 9, 4, 4, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000826", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MCDXXXVI') == 1436\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCDXXXVI') == 1436\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000827", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([6, 0, -8, 1, -9, -1, 3]) == [6, 6, -2, -1, -10, -11, -8]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([6, 0, -8, 1, -9, -1, 3]) == [6, 6, -2, -1, -10, -11, -8]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000828", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([23, 50, -8, -23, -45, -32]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([23, 50, -8, -23, -45, -32]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000829", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 6, 'z': 5, 'w': 8}, {'y': 2}) == {'x': 6, 'z': 5, 'w': 8, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 6, 'z': 5, 'w': 8}, {'y': 2}) == {'x': 6, 'z': 5, 'w': 8, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000830", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 0, 5, 5, 7], 1) == [7, 8, 0, 5, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 0, 5, 5, 7], 1) == [7, 8, 0, 5, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000831", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('da baee bdb cee') == 'Da Baee Bdb Cee'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('da baee bdb cee') == 'Da Baee Bdb Cee'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000832", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([0, 9, [2, 9], [5], [7, 1]]) == [0, 9, 2, 9, 5, 7, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, 9, [2, 9], [5], [7, 1]]) == [0, 9, 2, 9, 5, 7, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000833", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran dog sat sun, ran') == {'ran': 2, 'dog': 1, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog sat sun, ran') == {'ran': 2, 'dog': 1, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000834", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('World World', 16) == 'Mehbt Mehbt'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World World', 16) == 'Mehbt Mehbt'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000835", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=off; host=914') == {'mode': 'off', 'host': '914'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=off; host=914') == {'mode': 'off', 'host': '914'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000836", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['ayy', 'a', 'ayy', 'ayyx']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ayy', 'a', 'ayy', 'ayyx']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000837", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([8, 0, 7, 3, 2, 5, 4], [8, 0, 2, 2, 0, 0, 8]) == [8, 0, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 0, 7, 3, 2, 5, 4], [8, 0, 2, 2, 0, 0, 8]) == [8, 0, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000838", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('12') == 12\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('12') == 12\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000839", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([0, 39, 39, 0, 49, 24, 8, 32]) == [0, 0, 8, 24, 32, 39, 39, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([0, 39, 39, 0, 49, 24, 8, 32]) == [0, 0, 8, 24, 32, 39, 39, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000840", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ccabea') == 'cabe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ccabea') == 'cabe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000841", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 1}, {'x': 7}) == {'w': 1, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 1}, {'x': 7}) == {'w': 1, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000842", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(93); s.push(27); s.push(22)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(93); s.push(27); s.push(22)\nassert s.peek() == 22\nassert s.pop() == 22\nassert s.pop() == 27\nassert s.is_empty() == False\nassert s.pop() == 93\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000843", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 2, 9], [4, 8, 6]]) == [[7, 4], [2, 8], [9, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 2, 9], [4, 8, 6]]) == [[7, 4], [2, 8], [9, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000844", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-1, -36, -19, -16]) == -1\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-1, -36, -19, -16]) == -1\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000845", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 4) == 'bcd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 4) == 'bcd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000846", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(22) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(22) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000847", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([13, 28, 8, 49, 38, 39, 27]) == [8, 13, 27, 28, 38, 39, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([13, 28, 8, 49, 38, 39, 27]) == [8, 13, 27, 28, 38, 39, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000848", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(90) == 17\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(90) == 17\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000849", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(4593) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4593) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000850", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([2, 9, 3, 0, 8], 6) == [8, 2, 9, 3, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 9, 3, 0, 8], 6) == [8, 2, 9, 3, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000851", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=auto; mode=auto; host=996; path=762') == {'port': 'auto', 'mode': 'auto', 'host': '996', 'path': '762'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; mode=auto; host=996; path=762') == {'port': 'auto', 'mode': 'auto', 'host': '996', 'path': '762'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000852", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('5 + 16 + (10 + 12)') == 43\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('5 + 16 + (10 + 12)') == 43\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000853", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[3, 3, 5], [8, 9, 8], [3, 5]]) == 44\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[3, 3, 5], [8, 9, 8], [3, 5]]) == 44\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000854", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 4, 4, 9, 6, 1], 4) == [[2, 4, 4, 9], [6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 4, 4, 9, 6, 1], 4) == [[2, 4, 4, 9], [6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000855", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(22, 49) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(22, 49) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000856", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(213) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(213) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000857", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(87) == 30\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(87) == 30\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000858", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ccff', 'ccffc') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ccff', 'ccffc') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000859", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('e,ab') == ['e', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('e,ab') == ['e', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000860", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(723) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(723) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000861", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(35, 145) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 145) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000862", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([44, 76, 80, 88], 119) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([44, 76, 80, 88], 119) == -1\nassert binary_search([44, 76, 80, 88], 44) == 0\nassert binary_search([44, 76, 80, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000863", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([20, 41, 15, 15, 8, 7, 10, 49, 40, 19, 43, 39, 41]) == [7, 8, 10, 15, 15, 19, 20, 39, 40, 41, 41, 43, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([20, 41, 15, 15, 8, 7, 10, 49, 40, 19, 43, 39, 41]) == [7, 8, 10, 15, 15, 19, 20, 39, 40, 41, 41, 43, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000864", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([2, [[9], [3, 8]]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([2, [[9], [3, 8]]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000865", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2175) == 'MMCLXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2175) == 'MMCLXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000866", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=off; port=727; host=382') == {'user': 'off', 'port': '727', 'host': '382'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; port=727; host=382') == {'user': 'off', 'port': '727', 'host': '382'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000867", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(2659) == 'MMDCLIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2659) == 'MMDCLIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000868", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 1, 3], [0, 3, 4]], [[1, 0, 5], [1, 2, 1], [5, 2, 0]]) == [[17, 8, 6], [23, 14, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 3], [0, 3, 4]], [[1, 0, 5], [1, 2, 1], [5, 2, 0]]) == [[17, 8, 6], [23, 14, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000869", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[9], 4, [1]]) == 14\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9], 4, [1]]) == 14\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000870", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=151; port=auto') == {'user': '151', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=151; port=auto') == {'user': '151', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000871", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([4, 5, 1, 2, 0, 1, 4]) == [4, 5, 1, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 1, 2, 0, 1, 4]) == [4, 5, 1, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000872", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(14 - (11 * 12))') == -118\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(14 - (11 * 12))') == -118\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000873", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Python Python', 23) == 'Mvqelk Mvqelk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Python', 23) == 'Mvqelk Mvqelk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000874", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('caaaeedbedb') == 'caedb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caaaeedbedb') == 'caedb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000875", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([28, 12, 21, 13]) == [12, 13, 21, 28]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([28, 12, 21, 13]) == [12, 13, 21, 28]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000876", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(350) == 'CCCL'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(350) == 'CCCL'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000877", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'apple', 'date', 'date', 'coconut']) == {'a': ['apple', 'apple'], 'd': ['date', 'date'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'apple', 'date', 'date', 'coconut']) == {'a': ['apple', 'apple'], 'd': ['date', 'date'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000878", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 37, 'c': 79}) == {37: 'f', 79: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 37, 'c': 79}) == {37: 'f', 79: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000879", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([8]) == [8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([8]) == [8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000880", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([19], [1, 13, 17, 18, 18]) == [1, 13, 17, 18, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([19], [1, 13, 17, 18, 18]) == [1, 13, 17, 18, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000881", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([16, 2, 37, 26, 34, 47, 23, 30]) == [2, 16, 23, 26, 30, 34, 37, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([16, 2, 37, 26, 34, 47, 23, 30]) == [2, 16, 23, 26, 30, 34, 37, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000882", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(59, 15) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 15) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000883", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['a', 'b', 'b', 'a']) == {'a': 2, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'b', 'a']) == {'a': 2, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000884", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([20, 47, 48, 8, 28, 0, 33, 5, 37, 11]) == [0, 5, 8, 11, 20, 28, 33, 37, 47, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([20, 47, 48, 8, 28, 0, 33, 5, 37, 11]) == [0, 5, 8, 11, 20, 28, 33, 37, 47, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000885", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ccccd') == 'c4d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccd') == 'c4d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000886", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbbbbbbbaaba', 'baab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbbbbaaba', 'baab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000887", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-2, 7], [-7, -8], [-7, -3]], [[8, -8], [1, -8], [9, 6]]) == [[6, -1], [-6, -16], [2, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, 7], [-7, -8], [-7, -3]], [[8, -8], [1, -8], [9, 6]]) == [[6, -1], [-6, -16], [2, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000888", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([46, 28, 10]) == [10, 28, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 28, 10]) == [10, 28, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000889", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(81, 172) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(81, 172) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000890", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(60) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(60) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000891", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[5, 3], [2, 2]], [[4, 4], [3, 0]]) == [[29, 20], [14, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3], [2, 2]], [[4, 4], [3, 0]]) == [[29, 20], [14, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000892", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abaabba', 'bbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abaabba', 'bbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000893", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['az', 'ax']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['az', 'ax']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000894", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 3, 4, 0, 7, 0, 8], 5) == [[8, 3, 4, 0, 7], [0, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 3, 4, 0, 7, 0, 8], 5) == [[8, 3, 4, 0, 7], [0, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000895", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('baab') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('baab') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000896", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 1, 5, 0, 3]) == [3, 1, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 5, 0, 3]) == [3, 1, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000897", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([3, 29, 18]) == [3, 18, 29]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([3, 29, 18]) == [3, 18, 29]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000898", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[7, 9, 9]]) == [7, 9, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 9, 9]]) == [7, 9, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000899", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(47, 2) == 94\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(47, 2) == 94\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000900", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([0, [7], 3]) == [0, 7, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [7], 3]) == [0, 7, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000901", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(122) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(122) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000902", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-9, 7, -5], [5, 8, -6]], [[-7, 5, 3], [4, 6, 5]]) == [[-16, 12, -2], [9, 14, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 7, -5], [5, 8, -6]], [[-7, 5, 3], [4, 6, 5]]) == [[-16, 12, -2], [9, 14, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000903", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'apple', 'berry']) == {'c': ['coconut', 'cherry'], 'a': ['apple'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'apple', 'berry']) == {'c': ['coconut', 'cherry'], 'a': ['apple'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000904", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('babbbbbbabbbabab', 'baab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbbbbbabbbabab', 'baab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000905", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('aaedba ddd b') == 'Aaedba Ddd B'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aaedba ddd b') == 'Aaedba Ddd B'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000906", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[({))}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[({))}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000907", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-1, 19, 34, 32]) == 34\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-1, 19, 34, 32]) == 34\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000908", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 8}, {'z': 1}) == {'w': 8, 'z': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 8}, {'z': 1}) == {'w': 8, 'z': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000909", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('axcc') == 'ccxa'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('axcc') == 'ccxa'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000910", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([0, 17, 20, 29, 23]) == [0, 17, 20, 23, 29]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([0, 17, 20, 29, 23]) == [0, 17, 20, 23, 29]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000911", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([1, 27, 36, 36, 5, 5, 46, 50, 32]) == [1, 5, 5, 27, 32, 36, 36, 46, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([1, 27, 36, 36, 5, 5, 46, 50, 32]) == [1, 5, 5, 27, 32, 36, 36, 46, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000912", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[{}]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{}]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000913", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 2, 3, 7, 9, 9, 17], [1, 5, 6, 7, 15, 17, 17]) == [0, 1, 2, 3, 5, 6, 7, 7, 9, 9, 15, 17, 17, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 2, 3, 7, 9, 9, 17], [1, 5, 6, 7, 15, 17, 17]) == [0, 1, 2, 3, 5, 6, 7, 7, 9, 9, 15, 17, 17, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000914", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([6, 18, 21, 69, 72, 73], 69) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([6, 18, 21, 69, 72, 73], 69) == 3\nassert binary_search([6, 18, 21, 69, 72, 73], 6) == 0\nassert binary_search([6, 18, 21, 69, 72, 73], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000915", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 23) == 'uvw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 23) == 'uvw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000916", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 0, 9, 8, 9, 8, 13]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 0, 9, 8, 9, 8, 13]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000917", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=on; mode=on') == {'user': 'on', 'mode': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; mode=on') == {'user': 'on', 'mode': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000918", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('aspifyisvdmicj') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('aspifyisvdmicj') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000919", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([3, 8, -6]) == [3, 11, 5]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 8, -6]) == [3, 11, 5]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000920", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([7, 4, 8, 9, 7, 3, 6, 2], 5) == [9, 7, 3, 6, 2, 7, 4, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 4, 8, 9, 7, 3, 6, 2], 5) == [9, 7, 3, 6, 2, 7, 4, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000921", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('32m47s') == 1967\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('32m47s') == 1967\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000922", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-9, 3], [6, 9], [-6, 3]], [[8, -1], [2, -6], [8, 6]]) == [[-1, 2], [8, 3], [2, 9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 3], [6, 9], [-6, 3]], [[8, -1], [2, -6], [8, 6]]) == [[-1, 2], [8, 3], [2, 9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000923", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([13, 11, 35, 48, 28, 31, 31, 44]) == [11, 13, 28, 31, 31, 35, 44, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([13, 11, 35, 48, 28, 31, 31, 44]) == [11, 13, 28, 31, 31, 35, 44, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000924", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([51, 54, 96], 54) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([51, 54, 96], 54) == 1\nassert binary_search([51, 54, 96], 51) == 0\nassert binary_search([51, 54, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000925", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(146, 149) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(146, 149) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000926", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 5, 3, 4, 5, 0, 4, 3]) == [4, 5, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 3, 4, 5, 0, 4, 3]) == [4, 5, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000927", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('eefee', 'eefeea') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('eefee', 'eefeea') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000928", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('dabb adcea') == 'Dabb Adcea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dabb adcea') == 'Dabb Adcea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000929", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('17') == 17\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('17') == 17\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000930", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[9], [7, 6, 5]]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9], [7, 6, 5]]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000931", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(8267) == 7628\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8267) == 7628\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000932", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('3h7m17s') == 11237\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h7m17s') == 11237\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000933", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-1, -2, -9], [-6, -4, 8]], [[4, -4, 2], [-9, 7, 4]]) == [[3, -6, -7], [-15, 3, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -2, -9], [-6, -4, 8]], [[4, -4, 2], [-9, 7, 4]]) == [[3, -6, -7], [-15, 3, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000934", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 4, 'd': 91, 'b': 49, 'a': 47, 'e': 36}) == {4: 'c', 91: 'd', 49: 'b', 47: 'a', 36: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 4, 'd': 91, 'b': 49, 'a': 47, 'e': 36}) == {4: 'c', 91: 'd', 49: 'b', 47: 'a', 36: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000935", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('50,\"ab,\"') == ['50', 'ab,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('50,\"ab,\"') == ['50', 'ab,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000936", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(2, 24) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(2, 24) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000937", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('ecfdza') == 'azdfce'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ecfdza') == 'azdfce'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000938", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([16, 18, 19, 26, 49, 57, 99], 141) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 18, 19, 26, 49, 57, 99], 141) == -1\nassert binary_search([16, 18, 19, 26, 49, 57, 99], 16) == 0\nassert binary_search([16, 18, 19, 26, 49, 57, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000939", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([3, 6, 9, 2, 7], 2) == [[3, 6], [9, 2], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 6, 9, 2, 7], 2) == [[3, 6], [9, 2], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000940", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([4, 2, 1, 9, 6, 6, 2, 3, 1, 6], 9) == [2, 1, 9, 6, 6, 2, 3, 1, 6, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 2, 1, 9, 6, 6, 2, 3, 1, 6], 9) == [2, 1, 9, 6, 6, 2, 3, 1, 6, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000941", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(65) == [5, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(65) == [5, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000942", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 9, 8], [9, 5, 1, 6, 9, 9]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 9, 8], [9, 5, 1, 6, 9, 9]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000943", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=654; mode=924; port=371') == {'user': '654', 'mode': '924', 'port': '371'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=654; mode=924; port=371') == {'user': '654', 'mode': '924', 'port': '371'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000944", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 7, 'w': 5}, {'z': 7, 'y': 2, 'w': 7}) == {'y': 9, 'w': 12, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 7, 'w': 5}, {'z': 7, 'y': 2, 'w': 7}) == {'y': 9, 'w': 12, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000945", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMMDCXX') == 3620\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCXX') == 3620\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000946", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(774728) == 880\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(774728) == 880\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000947", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 6, 1, 1, 7], 6) == [7, 1, 6, 1, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 1, 1, 7], 6) == [7, 1, 6, 1, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000948", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(114) == 'CXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(114) == 'CXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000949", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h29m24s') == 19764\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h29m24s') == 19764\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000950", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('}][a]}[]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}][a]}[]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000951", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([0, 16, 55, 59, 99], 99) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 16, 55, 59, 99], 99) == 4\nassert binary_search([0, 16, 55, 59, 99], 0) == 0\nassert binary_search([0, 16, 55, 59, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000952", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('((14 + 1) - 6)') == 9\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((14 + 1) - 6)') == 9\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000953", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([48, 44, 18, 27, 14]) == [14, 18, 27, 44, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 44, 18, 27, 14]) == [14, 18, 27, 44, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000954", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(1, 4) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 4) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000955", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Sun sun Cat sat sun, the') == {'sun': 3, 'cat': 1, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sun sun Cat sat sun, the') == {'sun': 3, 'cat': 1, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000956", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('bcabbacb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcabbacb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000957", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fdgg fdgbc') == 'fdgbc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fdgg fdgbc') == 'fdgbc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000958", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog sun sat Cat Cat') == {'dog': 1, 'sun': 1, 'sat': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sun sat Cat Cat') == {'dog': 1, 'sun': 1, 'sat': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000959", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([30, 28, 37, 20, 0, 16]) == [0, 16, 20, 28, 30, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 28, 37, 20, 0, 16]) == [0, 16, 20, 28, 30, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000960", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, -5, 9], [5, 2, -6], [1, -9, -7]], [[-5, 6, -7], [8, -1, -1], [0, 4, 4]]) == [[3, 1, 2], [13, 1, -7], [1, -5, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -5, 9], [5, 2, -6], [1, -9, -7]], [[-5, 6, -7], [8, -1, -1], [0, 4, 4]]) == [[3, 1, 2], [13, 1, -7], [1, -5, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000961", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=auto; user=on') == {'mode': 'auto', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=auto; user=on') == {'mode': 'auto', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000962", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('dadcea') == 'dace'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dadcea') == 'dace'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000963", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(37, 72, 747) == 217\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(37, 72, 747) == 217\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000964", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(109) == [109]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(109) == [109]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000965", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('\"a,,\",a,82,50,de') == ['a,,', 'a', '82', '50', 'de']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"a,,\",a,82,50,de') == ['a,,', 'a', '82', '50', 'de']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000966", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(36)\nacc.deposit(268)\nacc.withdraw(242)\nacc.withdraw(420)\nassert acc.get_balance() == 304\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(36)\nacc.deposit(268)\nassert acc.get_balance() == 304\nacc.withdraw(242)\nassert acc.get_balance() == 62\nacc.withdraw(420)\nassert acc.get_balance() == 62\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000967", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat, dog sat Sat Cat Sat dog Ran dog Dog') == {'sat': 4, 'dog': 4, 'cat': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat, dog sat Sat Cat Sat dog Ran dog Dog') == {'sat': 4, 'dog': 4, 'cat': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000968", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 3, 5, 9, 0], [6, 1, 6, 8, 3, 9, 1]) == [3, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 3, 5, 9, 0], [6, 1, 6, 8, 3, 9, 1]) == [3, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000969", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([5, 26, 20, 27, 11, 41, 14, 0, 17, 8, 49, 1, 26, 21]) == [0, 1, 5, 8, 11, 14, 17, 20, 21, 26, 26, 27, 41, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([5, 26, 20, 27, 11, 41, 14, 0, 17, 8, 49, 1, 26, 21]) == [0, 1, 5, 8, 11, 14, 17, 20, 21, 26, 26, 27, 41, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000970", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aaaaababaaababa', 'aa') == 6\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaababaaababa', 'aa') == 6\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_000971", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([7, -4, -6, -9]) == [7, 3, -3, -12]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([7, -4, -6, -9]) == [7, 3, -3, -12]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000972", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ddbbbbbbbbbddddddddbbbccccc') == 'd2b9d8b3c5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddbbbbbbbbbddddddddbbbccccc') == 'd2b9d8b3c5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000973", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('aa c bec be') == 'Aa C Bec Be'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aa c bec be') == 'Aa C Bec Be'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000974", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(16, 12) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(16, 12) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000975", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([24, 36, 46, 22, 17, 45, 25, 36]) == [17, 22, 24, 25, 36, 36, 45, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([24, 36, 46, 22, 17, 45, 25, 36]) == [17, 22, 24, 25, 36, 36, 45, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000976", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 2, 2, 1, 2, 1, 2, 0, 3, 5, 1, 0]) == [2, 1, 0, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 2, 1, 2, 1, 2, 0, 3, 5, 1, 0]) == [2, 1, 0, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000977", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(12, 9) == 36\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(12, 9) == 36\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000978", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 3, 3], 3) == [2, 3, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 3, 3], 3) == [2, 3, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000979", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ebdfdea', 'ebdfdeac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ebdfdea', 'ebdfdeac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000980", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 7, 'y': 5, 'x': 9}, {'z': 5, 'w': 6, 'x': 6}) == {'z': 12, 'y': 5, 'x': 15, 'w': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7, 'y': 5, 'x': 9}, {'z': 5, 'w': 6, 'x': 6}) == {'z': 12, 'y': 5, 'x': 15, 'w': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000981", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('((1 - 20) - 6 - 5)') == -30\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((1 - 20) - 6 - 5)') == -30\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000982", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('16m52s') == 1012\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('16m52s') == 1012\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000983", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-41, -46, 7, -48, 46, 23]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-41, -46, 7, -48, 46, 23]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000984", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([48, 15, 33, 29, 20, -40, 14, -38]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([48, 15, 33, 29, 20, -40, 14, -38]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000985", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=645; host=off') == {'mode': '645', 'host': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=645; host=off') == {'mode': '645', 'host': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000986", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('bba,47') == ['bba', '47']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bba,47') == ['bba', '47']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000987", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(48); s.push(6); s.push(83)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(48); s.push(6); s.push(83)\nassert s.peek() == 83\nassert s.pop() == 83\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 48\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000988", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(5 * 18 * 9)') == 810\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(5 * 18 * 9)') == 810\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000989", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(60) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(60) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_000990", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(178) == 31\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(178) == 31\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000991", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(41, 40) == 1640\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(41, 40) == 1640\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000992", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([25, 46, 18, 23, 30]) == [18, 23, 25, 30, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 46, 18, 23, 30]) == [18, 23, 25, 30, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_000993", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('19') == 19\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19') == 19\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_000994", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=auto; host=auto; mode=auto') == {'user': 'auto', 'host': 'auto', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; host=auto; mode=auto') == {'user': 'auto', 'host': 'auto', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000995", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 1, 1, 3, 5, 5, 2, 3]) == [5, 1, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 1, 3, 5, 5, 2, 3]) == [5, 1, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000996", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 6, 4, 3, 8, 9, 6, 5, 4, 5], 12) == [4, 5, 4, 6, 4, 3, 8, 9, 6, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 6, 4, 3, 8, 9, 6, 5, 4, 5], 12) == [4, 5, 4, 6, 4, 3, 8, 9, 6, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000997", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-6, 2]) == -4\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, 2]) == -4\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_000998", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(21); s.push(55); s.push(64)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(21); s.push(55); s.push(64)\nassert s.peek() == 64\nassert s.pop() == 64\nassert s.pop() == 55\nassert s.is_empty() == False\nassert s.pop() == 21\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_000999", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'berry', 'apple', 'coconut', 'date']) == {'a': ['apple', 'apple'], 'c': ['cherry', 'coconut'], 'b': ['berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'berry', 'apple', 'coconut', 'date']) == {'a': ['apple', 'apple'], 'c': ['cherry', 'coconut'], 'b': ['berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001000", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([24, 33, 46, 55, 59, 73, 78, 79], 59) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([24, 33, 46, 55, 59, 73, 78, 79], 59) == 4\nassert binary_search([24, 33, 46, 55, 59, 73, 78, 79], 24) == 0\nassert binary_search([24, 33, 46, 55, 59, 73, 78, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001001", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(80)\nacc.deposit(199)\nacc.withdraw(44)\nacc.withdraw(415)\nassert acc.get_balance() == 279\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(80)\nacc.deposit(199)\nassert acc.get_balance() == 279\nacc.withdraw(44)\nassert acc.get_balance() == 235\nacc.withdraw(415)\nassert acc.get_balance() == 235\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001002", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([0, 3, 10, 14, 30, 47, 56, 92], 121) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 3, 10, 14, 30, 47, 56, 92], 121) == -1\nassert binary_search([0, 3, 10, 14, 30, 47, 56, 92], 0) == 0\nassert binary_search([0, 3, 10, 14, 30, 47, 56, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001003", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Sat sat, ran sat') == {'sat': 3, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat sat, ran sat') == {'sat': 3, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001004", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([6, 14]) == 20\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([6, 14]) == 20\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001005", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([46, 6, 25, 33, 40, 14, 28, 8, 40]) == [6, 8, 14, 25, 28, 33, 40, 40, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 6, 25, 33, 40, 14, 28, 8, 40]) == [6, 8, 14, 25, 28, 33, 40, 40, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001006", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(2 - 9) + 11 * 2') == 15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(2 - 9) + 11 * 2') == 15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001007", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=on; host=949') == {'port': 'on', 'host': '949'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; host=949') == {'port': 'on', 'host': '949'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001008", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dec b dbbddd') == 'Dec B Dbbddd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dec b dbbddd') == 'Dec B Dbbddd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001009", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([5, 12, 16, 5]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 12, 16, 5]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001010", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 7, 'y': 2}, {'y': 6, 'x': 7, 'w': 1}) == {'z': 7, 'y': 8, 'x': 7, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7, 'y': 2}, {'y': 6, 'x': 7, 'w': 1}) == {'z': 7, 'y': 8, 'x': 7, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001011", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(39, 164, 65) == 26\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(39, 164, 65) == 26\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001012", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'b', 'a', 'd', 'e', 'c', 'e', 'd', 'c']) == {'d': 3, 'b': 1, 'a': 1, 'e': 2, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'b', 'a', 'd', 'e', 'c', 'e', 'd', 'c']) == {'d': 3, 'b': 1, 'a': 1, 'e': 2, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001013", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('5 * 15 * 11') == 825\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('5 * 15 * 11') == 825\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001014", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(99); s.push(5); s.push(72)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(5); s.push(72)\nassert s.peek() == 72\nassert s.pop() == 72\nassert s.pop() == 5\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001015", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9, 1, 8], [0, 4, 4, 8]]) == [9, 1, 8, 0, 4, 4, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 1, 8], [0, 4, 4, 8]]) == [9, 1, 8, 0, 4, 4, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001016", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(22, 52) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(22, 52) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001017", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'y': 4, 'z': 4}, {'w': 1, 'z': 7}) == {'x': 9, 'y': 4, 'z': 11, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'y': 4, 'z': 4}, {'w': 1, 'z': 7}) == {'x': 9, 'y': 4, 'z': 11, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001018", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(4660) == 664\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4660) == 664\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001019", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aad') == 'a2d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aad') == 'a2d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001020", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(136, 171) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(136, 171) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001021", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(10)\nacc.deposit(49)\nacc.withdraw(24)\nacc.withdraw(187)\nassert acc.get_balance() == 59\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(10)\nacc.deposit(49)\nassert acc.get_balance() == 59\nacc.withdraw(24)\nassert acc.get_balance() == 35\nacc.withdraw(187)\nassert acc.get_balance() == 35\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001022", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(3038) == 55\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3038) == 55\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001023", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('abdc', 'abdc') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('abdc', 'abdc') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001024", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([39, 69, 85, 91], 120) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([39, 69, 85, 91], 120) == -1\nassert binary_search([39, 69, 85, 91], 39) == 0\nassert binary_search([39, 69, 85, 91], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001025", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(226) == 'CCXXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(226) == 'CCXXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001026", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([8, 8, 14, 16, 27, 8, 26, 0, 0]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 8, 14, 16, 27, 8, 26, 0, 0]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001027", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([14, 21, 6, 44, 27, 47, 35]) == [6, 14, 21, 27, 35, 44, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([14, 21, 6, 44, 27, 47, 35]) == [6, 14, 21, 27, 35, 44, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001028", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 20, 'a': 28, 'c': 82, 'b': 45, 'd': 64}) == {20: 'f', 28: 'a', 82: 'c', 45: 'b', 64: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 20, 'a': 28, 'c': 82, 'b': 45, 'd': 64}) == {20: 'f', 28: 'a', 82: 'c', 45: 'b', 64: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001029", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(367) == 'CCCLXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(367) == 'CCCLXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001030", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('dbaabe be') == 'Dbaabe Be'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dbaabe be') == 'Dbaabe Be'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001031", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(6) == 'VI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(6) == 'VI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001032", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bbbcbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbbcbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001033", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('efce', 'cefe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efce', 'cefe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001034", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([5, 14, 46, 47, 69, 71, 87], 102) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 14, 46, 47, 69, 71, 87], 102) == -1\nassert binary_search([5, 14, 46, 47, 69, 71, 87], 5) == 0\nassert binary_search([5, 14, 46, 47, 69, 71, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001035", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([11, 16, 17, 23, 24, 38, 41, 70, 81, 94], 163) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([11, 16, 17, 23, 24, 38, 41, 70, 81, 94], 163) == -1\nassert binary_search([11, 16, 17, 23, 24, 38, 41, 70, 81, 94], 11) == 0\nassert binary_search([11, 16, 17, 23, 24, 38, 41, 70, 81, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001036", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 6, 5, 4, 2, 1, 7, 0, 6], 4) == [[4, 6, 5, 4], [2, 1, 7, 0], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 6, 5, 4, 2, 1, 7, 0, 6], 4) == [[4, 6, 5, 4], [2, 1, 7, 0], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001037", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[2, 4, 8, -6], [2, -3, 0, -5], [8, 0, -8, -7], [-6, 1, -2, -6]], [[5, 6, -6, 5], [4, -4, 8, 0], [-5, 8, 4, 2], [5, -2, -9, 1]]) == [[7, 10, 2, -1], [6, -7, 8, -5], [3, 8, -4, -5], [-1, -1, -11, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, 4, 8, -6], [2, -3, 0, -5], [8, 0, -8, -7], [-6, 1, -2, -6]], [[5, 6, -6, 5], [4, -4, 8, 0], [-5, 8, 4, 2], [5, -2, -9, 1]]) == [[7, 10, 2, -1], [6, -7, 8, -5], [3, 8, -4, -5], [-1, -1, -11, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001038", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(23, 21) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(23, 21) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001039", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(37, 51) == 1887\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(37, 51) == 1887\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001040", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=on; user=928; path=auto; port=on') == {'host': 'on', 'user': '928', 'path': 'auto', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; user=928; path=auto; port=on') == {'host': 'on', 'user': '928', 'path': 'auto', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001041", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 52, 'a': 82}) == {52: 'f', 82: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 52, 'a': 82}) == {52: 'f', 82: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001042", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('abc', 5) == 'fgh'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 5) == 'fgh'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001043", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 5, 5, 4, 0, 1, 0, 1, 1]) == [4, 5, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 5, 4, 0, 1, 0, 1, 1]) == [4, 5, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001044", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(621) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(621) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001045", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabbbb', 'aba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbbb', 'aba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001046", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, -6, -8], [7, -5, 9], [6, 1, 0]], [[-9, -6, 7], [-3, -4, 9], [-8, -6, -6]]) == [[-1, -12, -1], [4, -9, 18], [-2, -5, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -6, -8], [7, -5, 9], [6, 1, 0]], [[-9, -6, 7], [-3, -4, 9], [-8, -6, -6]]) == [[-1, -12, -1], [4, -9, 18], [-2, -5, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001047", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-22, -39, 0, -47, -1, -32, -44]) == 0\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-22, -39, 0, -47, -1, -32, -44]) == 0\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001048", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 6, 15, 15], [0, 1, 4, 7, 13]) == [0, 1, 1, 4, 6, 7, 13, 15, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 6, 15, 15], [0, 1, 4, 7, 13]) == [0, 1, 1, 4, 6, 7, 13, 15, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001049", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(140) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(140) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001050", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(2, 67, 953) == 477\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(2, 67, 953) == 477\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001051", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 1, 0, 6, 4, 5, 3], 3) == [[4, 1, 0], [6, 4, 5], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 1, 0, 6, 4, 5, 3], 3) == [[4, 1, 0], [6, 4, 5], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001052", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(11); s.push(51); s.push(2)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(11); s.push(51); s.push(2)\nassert s.peek() == 2\nassert s.pop() == 2\nassert s.pop() == 51\nassert s.is_empty() == False\nassert s.pop() == 11\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001053", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaaddbb') == 'a4d2b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaddbb') == 'a4d2b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001054", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('cbea') == 'cbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbea') == 'cbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001055", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-28, 3, -42, -13, 49, 47, -49, 32]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-28, 3, -42, -13, 49, 47, -49, 32]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001056", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(2) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(2) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001057", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(206) == 'CCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(206) == 'CCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001058", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('3h51m52s') == 13912\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h51m52s') == 13912\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001059", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 0, 3, 0]) == [3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 3, 0]) == [3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001060", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 5, 5, 9, 5, 3, 8], [1, 3, 9, 6, 9, 5, 9, 1]) == [5, 9, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 5, 5, 9, 5, 3, 8], [1, 3, 9, 6, 9, 5, 9, 1]) == [5, 9, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001061", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([5, 4, 1, 8, 7, 1, 0, 3], 2) == [0, 3, 5, 4, 1, 8, 7, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 4, 1, 8, 7, 1, 0, 3], 2) == [0, 3, 5, 4, 1, 8, 7, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001062", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 78, 'a': 18, 'f': 99, 'd': 4}) == {78: 'b', 18: 'a', 99: 'f', 4: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 78, 'a': 18, 'f': 99, 'd': 4}) == {78: 'b', 18: 'a', 99: 'f', 4: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001063", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbbbb', 'bbba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbb', 'bbba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001064", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([0, 18, 61, 63, 64, 65, 69], 0) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 18, 61, 63, 64, 65, 69], 0) == 0\nassert binary_search([0, 18, 61, 63, 64, 65, 69], 0) == 0\nassert binary_search([0, 18, 61, 63, 64, 65, 69], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001065", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(2172) == 46\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2172) == 46\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001066", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([50, 47, 0, 42, 42, 31, 22, 25, 50, 32]) == [0, 22, 25, 31, 32, 42, 42, 47, 50, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([50, 47, 0, 42, 42, 31, 22, 25, 50, 32]) == [0, 22, 25, 31, 32, 42, 42, 47, 50, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001067", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([1, 49, 16, 21, 25]) == [1, 16, 21, 25, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 49, 16, 21, 25]) == [1, 16, 21, 25, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001068", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([0, 9, 5, 4, 6], 3) == [5, 4, 6, 0, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 9, 5, 4, 6], 3) == [5, 4, 6, 0, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001069", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['cb', 'cbz']) == 'cb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cb', 'cbz']) == 'cb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001070", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(4547) == 67\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4547) == 67\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001071", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(6, 12) == 2176782336\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(6, 12) == 2176782336\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001072", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[4, 3], [2, 5], [3, 5]], [[5, 2], [4, 5]]) == [[32, 23], [30, 29], [35, 31]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 3], [2, 5], [3, 5]], [[5, 2], [4, 5]]) == [[32, 23], [30, 29], [35, 31]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001073", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([1, 6, 5, 1, 5], 9) == [6, 5, 1, 5, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 5, 1, 5], 9) == [6, 5, 1, 5, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001074", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('cdba cace daedec') == 'Cdba Cace Daedec'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cdba cace daedec') == 'Cdba Cace Daedec'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001075", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['zxy', '', '']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zxy', '', '']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001076", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(477) == 'CDLXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(477) == 'CDLXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001077", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 1, 2], 3) == [1, 1, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 1, 2], 3) == [1, 1, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001078", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(288) == 24\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(288) == 24\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001079", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(167) == 67\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(167) == 67\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001080", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 1, 4, 10, 15], [4]) == [0, 1, 4, 4, 10, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 4, 10, 15], [4]) == [0, 1, 4, 4, 10, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001081", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 5}, {'z': 9}) == {'x': 5, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 5}, {'z': 9}) == {'x': 5, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001082", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 26, 'b': 43, 'a': 81}) == {26: 'f', 43: 'b', 81: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 26, 'b': 43, 'a': 81}) == {26: 'f', 43: 'b', 81: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001083", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 0, 0, 1]) == [0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 0, 1]) == [0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001084", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'coconut', 'coconut', 'berry', 'coconut']) == {'c': ['coconut', 'cherry', 'coconut', 'coconut', 'coconut'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'coconut', 'coconut', 'berry', 'coconut']) == {'c': ['coconut', 'cherry', 'coconut', 'coconut', 'coconut'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001085", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Cat Sun cat cat Ran') == {'cat': 3, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat Sun cat cat Ran') == {'cat': 3, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001086", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h43m42s') == 13422\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h43m42s') == 13422\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001087", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(403393) == 635\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(403393) == 635\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001088", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-8, -4, 9, 9, -1, -5]) == [-8, -12, -3, 6, 5, 0]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, -4, 9, 9, -1, -5]) == [-8, -12, -3, 6, 5, 0]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001089", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[3, 0], [0, 5, 6], [5, 7, 0]]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[3, 0], [0, 5, 6], [5, 7, 0]]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001090", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMDCCCXXV') == 2825\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDCCCXXV') == 2825\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001091", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 8, 'f': 59, 'e': 28}) == {8: 'b', 59: 'f', 28: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 8, 'f': 59, 'e': 28}) == {8: 'b', 59: 'f', 28: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001092", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(1926) == 43\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1926) == 43\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001093", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=483; host=on; mode=275') == {'port': '483', 'host': 'on', 'mode': '275'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=483; host=on; mode=275') == {'port': '483', 'host': 'on', 'mode': '275'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001094", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(34, 92, 985) == 536\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(34, 92, 985) == 536\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001095", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 43, 'd': 89, 'a': 50, 'b': 61, 'c': 74}) == {43: 'e', 89: 'd', 50: 'a', 61: 'b', 74: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 43, 'd': 89, 'a': 50, 'b': 61, 'c': 74}) == {43: 'e', 89: 'd', 50: 'a', 61: 'b', 74: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001096", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(287) == 'CCLXXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(287) == 'CCLXXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001097", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(20, 13) == 260\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(20, 13) == 260\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001098", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([1, 0, 17, 22, 18, 11, 2]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 0, 17, 22, 18, 11, 2]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001099", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 0, 3], [0, 2, 5], [5, 1, 5]], [[3, 3], [5, 2], [5, 5]]) == [[18, 18], [35, 29], [45, 42]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 0, 3], [0, 2, 5], [5, 1, 5]], [[3, 3], [5, 2], [5, 5]]) == [[18, 18], [35, 29], [45, 42]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001100", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abbabbaabbaaaab', 'bb') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbabbaabbaaaab', 'bb') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001101", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-6, 10, -16, 15, 3]) == 6\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, 10, -16, 15, 3]) == 6\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001102", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([32, 50, 15, 29, 6]) == [6, 15, 29, 32, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([32, 50, 15, 29, 6]) == [6, 15, 29, 32, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001103", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 5, 'w': 6, 'z': 9}, {'z': 7}) == {'x': 5, 'w': 6, 'z': 16}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 5, 'w': 6, 'z': 9}, {'z': 7}) == {'x': 5, 'w': 6, 'z': 16}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001104", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('20,c') == ['20', 'c']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('20,c') == ['20', 'c']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001105", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([23, 4, 20, 13, 9]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 4, 20, 13, 9]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001106", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([19, 46, 1]) == [1, 19, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([19, 46, 1]) == [1, 19, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001107", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([0, 42, 43, 12, 35, 0, 34, 19]) == [0, 0, 12, 19, 34, 35, 42, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 42, 43, 12, 35, 0, 34, 19]) == [0, 0, 12, 19, 34, 35, 42, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001108", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([0, [[7, 7]], [7, [5, 0, 0]]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, [[7, 7]], [7, [5, 0, 0]]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001109", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(96); s.push(79); s.push(52)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(96); s.push(79); s.push(52)\nassert s.peek() == 52\nassert s.pop() == 52\nassert s.pop() == 79\nassert s.is_empty() == False\nassert s.pop() == 96\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001110", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 7, 8, 9, 4, 6, 6, 6, 8, 0], 1) == [0, 0, 7, 8, 9, 4, 6, 6, 6, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 7, 8, 9, 4, 6, 6, 6, 8, 0], 1) == [0, 0, 7, 8, 9, 4, 6, 6, 6, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001111", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(322226) == 567\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(322226) == 567\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001112", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('}{)b{a]}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}{)b{a]}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001113", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(48, 53, 87) == 60\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(48, 53, 87) == 60\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001114", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([2, 2, 7, 7, 2, 1, 7], 5) == [[2, 2, 7, 7, 2], [1, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 2, 7, 7, 2, 1, 7], 5) == [[2, 2, 7, 7, 2], [1, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001115", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([28, 10, 14, 22, 12, 10, 15, 1]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 10, 14, 22, 12, 10, 15, 1]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001116", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(70) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(70) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001117", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 39, 'b': 96, 'c': 37, 'f': 68, 'd': 2}) == {39: 'a', 96: 'b', 37: 'c', 68: 'f', 2: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 39, 'b': 96, 'c': 37, 'f': 68, 'd': 2}) == {39: 'a', 96: 'b', 37: 'c', 68: 'f', 2: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001118", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('bdbae') == 'Bdbae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bdbae') == 'Bdbae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001119", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=on; mode=913; port=719; path=976') == {'user': 'on', 'mode': '913', 'port': '719', 'path': '976'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; mode=913; port=719; path=976') == {'user': 'on', 'mode': '913', 'port': '719', 'path': '976'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001120", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([17, 13, 6, 13, 1, 15, 15]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 13, 6, 13, 1, 15, 15]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001121", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([10, 26, 21, 3, 12, 11, 31, 24]) == [3, 10, 11, 12, 21, 24, 26, 31]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([10, 26, 21, 3, 12, 11, 31, 24]) == [3, 10, 11, 12, 21, 24, 26, 31]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001122", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([1, 35, 36, 48, 49, 53, 59, 72], 48) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 35, 36, 48, 49, 53, 59, 72], 48) == 3\nassert binary_search([1, 35, 36, 48, 49, 53, 59, 72], 1) == 0\nassert binary_search([1, 35, 36, 48, 49, 53, 59, 72], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001123", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(214) == 'CCXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(214) == 'CCXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001124", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(147) == 116\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(147) == 116\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001125", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 57, 'b': 70, 'f': 96, 'd': 92}) == {57: 'a', 70: 'b', 96: 'f', 92: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 57, 'b': 70, 'f': 96, 'd': 92}) == {57: 'a', 70: 'b', 96: 'f', 92: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001126", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([28, 3, 0, 1, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 3, 0, 1, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001127", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([7, -1, 4, -3, -6, 6, -8, -6]) == [7, 6, 10, 7, 1, 7, -1, -7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([7, -1, 4, -3, -6, 6, -8, -6]) == [7, 6, 10, 7, 1, 7, -1, -7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001128", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(5832) == 2385\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5832) == 2385\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001129", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('cebb') == 'Cebb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cebb') == 'Cebb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001130", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('abc', 6) == 'ghi'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 6) == 'ghi'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001131", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'w': 8, 'y': 3}, {'w': 1}) == {'x': 3, 'w': 9, 'y': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'w': 8, 'y': 3}, {'w': 1}) == {'x': 3, 'w': 9, 'y': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001132", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([13, 8, 8, 22, 13, 7, 1, 13, 12, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 8, 8, 22, 13, 7, 1, 13, 12, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001133", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([39, 10, 32, 13, 39, 38]) == [10, 13, 32, 38, 39, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([39, 10, 32, 13, 39, 38]) == [10, 13, 32, 38, 39, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001134", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CDXXVII') == 427\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXVII') == 427\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001135", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(303) == 'CCCIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(303) == 'CCCIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001136", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[0, 2, 5], [4, 5, 0]], [[5, 2], [1, 5], [2, 1]]) == [[12, 15], [25, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2, 5], [4, 5, 0]], [[5, 2], [1, 5], [2, 1]]) == [[12, 15], [25, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001137", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 0, 3, 5, 4, 0, 2]) == [0, 3, 5, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 3, 5, 4, 0, 2]) == [0, 3, 5, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001138", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'coconut', 'cherry', 'avocado']) == {'a': ['apple', 'avocado'], 'c': ['coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'coconut', 'cherry', 'avocado']) == {'a': ['apple', 'avocado'], 'c': ['coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001139", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('fea', 'efa') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fea', 'efa') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001140", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abcbcacabaca', 'ab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abcbcacabaca', 'ab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001141", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('dcedce') == 'dce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcedce') == 'dce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001142", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=797; user=on; host=328') == {'port': '797', 'user': 'on', 'host': '328'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=797; user=on; host=328') == {'port': '797', 'user': 'on', 'host': '328'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001143", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(9) == 'IX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(9) == 'IX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001144", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('10') == 10\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10') == 10\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001145", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('ad') == 'Ad'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ad') == 'Ad'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001146", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([25, 33]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([25, 33]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001147", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(28) == 'XXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(28) == 'XXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001148", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(17); s.push(36); s.push(50)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(17); s.push(36); s.push(50)\nassert s.peek() == 50\nassert s.pop() == 50\nassert s.pop() == 36\nassert s.is_empty() == False\nassert s.pop() == 17\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001149", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001150", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'b': 6, 'e': 10}, 4) == {'b': 6, 'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 6, 'e': 10}, 4) == {'b': 6, 'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001151", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([26, 5, 33, 4, 2, 16, 30, 21, 24, 28, 0, 32]) == [0, 2, 4, 5, 16, 21, 24, 26, 28, 30, 32, 33]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 5, 33, 4, 2, 16, 30, 21, 24, 28, 0, 32]) == [0, 2, 4, 5, 16, 21, 24, 26, 28, 30, 32, 33]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001152", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('baabbbaaaaaaa') == 'b1a2b3a7'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('baabbbaaaaaaa') == 'b1a2b3a7'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001153", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-44, 9, -2, -25, -22, -44, 44, 29]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-44, 9, -2, -25, -22, -44, 44, 29]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001154", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([0, 5, 0, 5, 4, 1]) == [0, 5, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 0, 5, 4, 1]) == [0, 5, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001155", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 10, 5, 4, 5, 10, 17]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 10, 5, 4, 5, 10, 17]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001156", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('babxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('babxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001157", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(31, 123, 2) == 1\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(31, 123, 2) == 1\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001158", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1995) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1995) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001159", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ebcddaedeee') == 'ebcda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebcddaedeee') == 'ebcda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001160", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'x': 1, 'y': 5}, {'x': 9, 'w': 8, 'z': 4}) == {'z': 8, 'x': 10, 'y': 5, 'w': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'x': 1, 'y': 5}, {'x': 9, 'w': 8, 'z': 4}) == {'z': 8, 'x': 10, 'y': 5, 'w': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001161", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 1, 2, 1, 8], [7, 8, 1, 3, 5]) == [1, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 1, 2, 1, 8], [7, 8, 1, 3, 5]) == [1, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001162", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(6570) == 756\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6570) == 756\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001163", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([27, 29, 29, 10, 4, 26, 7, 4, 17, 27, 13]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([27, 29, 29, 10, 4, 26, 7, 4, 17, 27, 13]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001164", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(25, 15) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(25, 15) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001165", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('fbfbdd', 'dbfbfd') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fbfbdd', 'dbfbfd') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001166", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(1030) == 32\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1030) == 32\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001167", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 9, 'b': 5}) == {9: 'c', 5: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 9, 'b': 5}) == {9: 'c', 5: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001168", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran sun. sun ran dog sun ran! cat') == {'ran': 3, 'sun': 3, 'dog': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sun. sun ran dog sun ran! cat') == {'ran': 3, 'sun': 3, 'dog': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001169", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'a', 'b', 'c', 'b', 'c']) == {'a': 2, 'b': 2, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'a', 'b', 'c', 'b', 'c']) == {'a': 2, 'b': 2, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001170", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbddddddddddd') == 'b4d11'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbddddddddddd') == 'b4d11'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001171", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h10m22s') == 4222\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h10m22s') == 4222\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001172", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ddddaaaa') == 'd4a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddaaaa') == 'd4a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001173", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 12) == 'mno'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 12) == 'mno'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001174", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[5, 3, 3], [7, 1, 8]]) == [[5, 7], [3, 1], [3, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 3, 3], [7, 1, 8]]) == [[5, 7], [3, 1], [3, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001175", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([10, 23, 5, 7, 7, 29, 21, 8]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 23, 5, 7, 7, 29, 21, 8]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001176", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(194) == 119\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(194) == 119\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001177", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 2, 8, 3], 3) == [[5, 2, 8], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 2, 8, 3], 3) == [[5, 2, 8], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001178", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(45, 95, 918) == 405\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(45, 95, 918) == 405\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001179", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=639; port=475') == {'mode': '639', 'port': '475'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=639; port=475') == {'mode': '639', 'port': '475'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001180", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(81); s.push(33); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(33); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 33\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001181", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['date', 'cherry', 'cherry', 'coconut', 'date', 'date', 'berry']) == {'d': ['date', 'date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'cherry', 'coconut', 'date', 'date', 'berry']) == {'d': ['date', 'date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001182", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(16, 15, 621) == 469\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(16, 15, 621) == 469\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001183", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(70, 34) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(70, 34) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001184", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(206) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(206) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001185", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(16) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(16) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001186", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 2, 2], [5, 0, 3], [1, 5, 4]], [[2, 3], [3, 5], [4, 5]]) == [[16, 23], [22, 30], [33, 48]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2, 2], [5, 0, 3], [1, 5, 4]], [[2, 3], [3, 5], [4, 5]]) == [[16, 23], [22, 30], [33, 48]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001187", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(403) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(403) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001188", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(118) == 33\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(118) == 33\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001189", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('abc', 21) == 'vwx'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 21) == 'vwx'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001190", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('Ran Sun dog sun sun. ran Ran sat, the Sun') == {'ran': 3, 'sun': 4, 'dog': 1, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran Sun dog sun sun. ran Ran sat, the Sun') == {'ran': 3, 'sun': 4, 'dog': 1, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001191", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([3, 7, 8, 8, 4, 4, 4, 1, 8, 5, 2], 5) == [[3, 7, 8, 8, 4], [4, 4, 1, 8, 5], [2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 7, 8, 8, 4, 4, 4, 1, 8, 5, 2], 5) == [[3, 7, 8, 8, 4], [4, 4, 1, 8, 5], [2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001192", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('10m25s') == 625\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('10m25s') == 625\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001193", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['a', 'e', 'b', 'e', 'd', 'a', 'a', 'b', 'e']) == {'a': 3, 'e': 3, 'b': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'e', 'b', 'e', 'd', 'a', 'a', 'b', 'e']) == {'a': 3, 'e': 3, 'b': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001194", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(90) == [2, 3, 3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(90) == [2, 3, 3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001195", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 1, 'w': 3}, {'z': 2, 'w': 1, 'y': 7}) == {'y': 8, 'w': 4, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1, 'w': 3}, {'z': 2, 'w': 1, 'y': 7}) == {'y': 8, 'w': 4, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001196", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'b', 'c', 'c', 'e']) == {'e': 2, 'b': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'c', 'c', 'e']) == {'e': 2, 'b': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001197", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('xbayaeebby') == 'ybbeeayabx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xbayaeebby') == 'ybbeeayabx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001198", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('29m17s') == 1757\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('29m17s') == 1757\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001199", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=746; host=auto; mode=547') == {'path': '746', 'host': 'auto', 'mode': '547'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=746; host=auto; mode=547') == {'path': '746', 'host': 'auto', 'mode': '547'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001200", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([6, 9, 7, 9], 5) == [[6, 9, 7, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 7, 9], 5) == [[6, 9, 7, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001201", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[5, 9, 4], 7]) == 25\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5, 9, 4], 7]) == 25\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001202", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('50,bbb,\"a,,ab\",daa') == ['50', 'bbb', 'a,,ab', 'daa']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('50,bbb,\"a,,ab\",daa') == ['50', 'bbb', 'a,,ab', 'daa']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001203", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[6, 9, 1], [3], [0, 3]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[6, 9, 1], [3], [0, 3]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001204", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(30, 40) == 120\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(30, 40) == 120\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001205", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[4, 0], [4, 0, 8], [0]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[4, 0], [4, 0, 8], [0]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001206", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([4, [9, 9], 3, [1]]) == [4, 9, 9, 3, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [9, 9], 3, [1]]) == [4, 9, 9, 3, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001207", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[3, 1], [8, 0]]) == [[3, 8], [1, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 1], [8, 0]]) == [[3, 8], [1, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001208", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(16 - 7 - 20)') == -11\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(16 - 7 - 20)') == -11\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001209", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMCCXCVII') == 2297\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCCXCVII') == 2297\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001210", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('cxdzzayxz') == 'zxyazzdxc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cxdzzayxz') == 'zxyazzdxc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001211", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'c': 5, 'b': 8, 'e': 0, 'd': 10}, 5) == {'b': 8, 'd': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 5, 'b': 8, 'e': 0, 'd': 10}, 5) == {'b': 8, 'd': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001212", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(7, 7) == 7\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(7, 7) == 7\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001213", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 3, 6, 2, 3, 3, 6, 4, 9, 0, 0], 5) == [[8, 3, 6, 2, 3], [3, 6, 4, 9, 0], [0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 3, 6, 2, 3, 3, 6, 4, 9, 0, 0], 5) == [[8, 3, 6, 2, 3], [3, 6, 4, 9, 0], [0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001214", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=281; user=177; host=on') == {'path': '281', 'user': '177', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=281; user=177; host=on') == {'path': '281', 'user': '177', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001215", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('adbbcbdc') == 'adbc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adbbcbdc') == 'adbc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001216", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([0, [1, 4], 3, [3, 4, 8]]) == [0, 1, 4, 3, 3, 4, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, [1, 4], 3, [3, 4, 8]]) == [0, 1, 4, 3, 3, 4, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001217", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[3, 8, 0, 8], [9, 5, 3, 9]]) == [[3, 9], [8, 5], [0, 3], [8, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 8, 0, 8], [9, 5, 3, 9]]) == [[3, 9], [8, 5], [0, 3], [8, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001218", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('a]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001219", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(8) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(8) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001220", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[8, [3]], [5]]) == [8, 3, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8, [3]], [5]]) == [8, 3, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001221", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(4497) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4497) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001222", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(30) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(30) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001223", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(1155) == 5511\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1155) == 5511\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001224", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9825) == 99\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9825) == 99\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001225", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([22, 29, 20]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 29, 20]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001226", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(81); s.push(52); s.push(65)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(52); s.push(65)\nassert s.peek() == 65\nassert s.pop() == 65\nassert s.pop() == 52\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001227", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('a]bba(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a]bba(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001228", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(33); s.push(83); s.push(63)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(33); s.push(83); s.push(63)\nassert s.peek() == 63\nassert s.pop() == 63\nassert s.pop() == 83\nassert s.is_empty() == False\nassert s.pop() == 33\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001229", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[0, 7, 7, 3], [3, 8, 3, 0], [8, 1, 9], [0, 9, 9, 1], 8]) == [0, 7, 7, 3, 3, 8, 3, 0, 8, 1, 9, 0, 9, 9, 1, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 7, 7, 3], [3, 8, 3, 0], [8, 1, 9], [0, 9, 9, 1], 8]) == [0, 7, 7, 3, 3, 8, 3, 0, 8, 1, 9, 0, 9, 9, 1, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001230", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[0, 8, 1, 2], [0, 2, 5, 5], [3, 8, 2, 3]]) == [[0, 0, 3], [8, 2, 8], [1, 5, 2], [2, 5, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 8, 1, 2], [0, 2, 5, 5], [3, 8, 2, 3]]) == [[0, 0, 3], [8, 2, 8], [1, 5, 2], [2, 5, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001231", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'coconut', 'banana', 'banana', 'apple', 'date']) == {'b': ['berry', 'banana', 'banana'], 'c': ['cherry', 'coconut'], 'a': ['apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'coconut', 'banana', 'banana', 'apple', 'date']) == {'b': ['berry', 'banana', 'banana'], 'c': ['cherry', 'coconut'], 'a': ['apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001232", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(396)\nacc.deposit(274)\nacc.withdraw(594)\nacc.withdraw(755)\nassert acc.get_balance() == 670\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(396)\nacc.deposit(274)\nassert acc.get_balance() == 670\nacc.withdraw(594)\nassert acc.get_balance() == 76\nacc.withdraw(755)\nassert acc.get_balance() == 76\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001233", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabaababbab', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaababbab', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001234", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([29, 15, 45, 18, 49, 43]) == [15, 18, 29, 43, 45, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([29, 15, 45, 18, 49, 43]) == [15, 18, 29, 43, 45, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001235", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=on; path=off; mode=877; port=123') == {'user': 'on', 'path': 'off', 'mode': '877', 'port': '123'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; path=off; mode=877; port=123') == {'user': 'on', 'path': 'off', 'mode': '877', 'port': '123'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001236", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(415) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(415) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001237", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ab') == 'Ab'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ab') == 'Ab'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001238", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[1, -1], [0, -6], [-5, -6]], [[-6, -3], [0, 1], [0, -5]]) == [[-5, -4], [0, -5], [-5, -11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -1], [0, -6], [-5, -6]], [[-6, -3], [0, 1], [0, -5]]) == [[-5, -4], [0, -5], [-5, -11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001239", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abbbbaabaaaa', 'bbb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbbaabaaaa', 'bbb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001240", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('5h1m37s') == 18097\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h1m37s') == 18097\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001241", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(24, 10) == 120\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 10) == 120\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001242", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=307; path=920; host=715') == {'port': '307', 'path': '920', 'host': '715'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=307; path=920; host=715') == {'port': '307', 'path': '920', 'host': '715'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001243", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([0, 19, 20, 37, 39, 43, 44, 58, 63, 93, 94, 99], 19) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 19, 20, 37, 39, 43, 44, 58, 63, 93, 94, 99], 19) == 1\nassert binary_search([0, 19, 20, 37, 39, 43, 44, 58, 63, 93, 94, 99], 0) == 0\nassert binary_search([0, 19, 20, 37, 39, 43, 44, 58, 63, 93, 94, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001244", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([8, 7, 50, 16, 46, 32, 44]) == [7, 8, 16, 32, 44, 46, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([8, 7, 50, 16, 46, 32, 44]) == [7, 8, 16, 32, 44, 46, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001245", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([2, 2, 5]) == [2, 2, 5]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 2, 5]) == [2, 2, 5]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_001246", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'d': 7, 'a': 9, 'b': 0, 'c': 1}, 3) == {'d': 7, 'a': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 7, 'a': 9, 'b': 0, 'c': 1}, 3) == {'d': 7, 'a': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001247", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(196)\nacc.deposit(74)\nacc.withdraw(215)\nacc.withdraw(383)\nassert acc.get_balance() == 270\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(196)\nacc.deposit(74)\nassert acc.get_balance() == 270\nacc.withdraw(215)\nassert acc.get_balance() == 55\nacc.withdraw(383)\nassert acc.get_balance() == 55\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001248", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 2], [4, 5], [2, 0]], [[5, 3, 0], [3, 2, 2]]) == [[21, 13, 4], [35, 22, 10], [10, 6, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 2], [4, 5], [2, 0]], [[5, 3, 0], [3, 2, 2]]) == [[21, 13, 4], [35, 22, 10], [10, 6, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001249", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([19, 24, 27, 32, 42, 43, 46, 57, 70, 92, 98, 99], 149) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([19, 24, 27, 32, 42, 43, 46, 57, 70, 92, 98, 99], 149) == -1\nassert binary_search([19, 24, 27, 32, 42, 43, 46, 57, 70, 92, 98, 99], 19) == 0\nassert binary_search([19, 24, 27, 32, 42, 43, 46, 57, 70, 92, 98, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001250", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0], [1, 1, 8, 7], [1, 7, 8, 9], [0, 3, 2], 4]) == [0, 1, 1, 8, 7, 1, 7, 8, 9, 0, 3, 2, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], [1, 1, 8, 7], [1, 7, 8, 9], [0, 3, 2], 4]) == [0, 1, 1, 8, 7, 1, 7, 8, 9, 0, 3, 2, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001251", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([4, 3, 8, 26, 28, 8, 10, 28]) == [3, 4, 8, 8, 10, 26, 28, 28]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 3, 8, 26, 28, 8, 10, 28]) == [3, 4, 8, 8, 10, 26, 28, 28]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001252", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([6, 5, 5], [9, 0, 2, 9, 8, 6]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 5, 5], [9, 0, 2, 9, 8, 6]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001253", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cbbbeaebcdeea') == 'cbead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbbbeaebcdeea') == 'cbead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001254", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([7, 12, 19, 19], [7, 20]) == [7, 7, 12, 19, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7, 12, 19, 19], [7, 20]) == [7, 7, 12, 19, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001255", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([46, 31, 23, 44, 23, -1, 49, 47]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([46, 31, 23, 44, 23, -1, 49, 47]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001256", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([15, 42, 50, 54, 82, 84, 90, 91, 94, 97], 84) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 42, 50, 54, 82, 84, 90, 91, 94, 97], 84) == 5\nassert binary_search([15, 42, 50, 54, 82, 84, 90, 91, 94, 97], 15) == 0\nassert binary_search([15, 42, 50, 54, 82, 84, 90, 91, 94, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001257", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(952) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(952) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001258", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-10, -20, 3, -18, -3]) == -48\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-10, -20, 3, -18, -3]) == -48\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001259", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[3, 0, 1, 5], [3, 7, 6, 2]]) == [[3, 3], [0, 7], [1, 6], [5, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 0, 1, 5], [3, 7, 6, 2]]) == [[3, 3], [0, 7], [1, 6], [5, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001260", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=auto; path=520; user=off') == {'host': 'auto', 'path': '520', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; path=520; user=off') == {'host': 'auto', 'path': '520', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001261", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(888) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(888) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001262", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([24, 24, 14, 24, 2, 6]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([24, 24, 14, 24, 2, 6]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001263", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(71, 78) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(71, 78) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001264", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(2202) == 6\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2202) == 6\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001265", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['date', 'cherry', 'banana']) == {'d': ['date'], 'c': ['cherry'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'banana']) == {'d': ['date'], 'c': ['cherry'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001266", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[8, 6], 8, [8, 4, 0, 3], [4, 1, 1, 6]]) == [8, 6, 8, 8, 4, 0, 3, 4, 1, 1, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 6], 8, [8, 4, 0, 3], [4, 1, 1, 6]]) == [8, 6, 8, 8, 4, 0, 3, 4, 1, 1, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001267", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbbbbab', 'aa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbab', 'aa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001268", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(3) == 7\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(3) == 7\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001269", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([19, 21, 24, 28, 37, 50, 67, 88], 21) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([19, 21, 24, 28, 37, 50, 67, 88], 21) == 1\nassert binary_search([19, 21, 24, 28, 37, 50, 67, 88], 19) == 0\nassert binary_search([19, 21, 24, 28, 37, 50, 67, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001270", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h2m36s') == 18156\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h2m36s') == 18156\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001271", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1445) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1445) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001272", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(4, 6) == 12\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 6) == 12\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001273", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('be,ba') == ['be', 'ba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('be,ba') == ['be', 'ba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001274", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([7, [3, 5], 0]) == [7, 3, 5, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([7, [3, 5], 0]) == [7, 3, 5, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001275", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(172) == 31\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(172) == 31\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001276", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([31, 0, 15, 15, 44, 34, 23, 18]) == [0, 15, 15, 18, 23, 31, 34, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([31, 0, 15, 15, 44, 34, 23, 18]) == [0, 15, 15, 18, 23, 31, 34, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001277", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[3], 8, [0, 0, 5]]) == [3, 8, 0, 0, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[3], 8, [0, 0, 5]]) == [3, 8, 0, 0, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001278", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(95)\nacc.deposit(290)\nacc.withdraw(86)\nacc.withdraw(467)\nassert acc.get_balance() == 385\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(95)\nacc.deposit(290)\nassert acc.get_balance() == 385\nacc.withdraw(86)\nassert acc.get_balance() == 299\nacc.withdraw(467)\nassert acc.get_balance() == 299\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001279", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'avocado', 'cherry', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['avocado'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'avocado', 'cherry', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['avocado'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001280", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([3, 3, 3, 11, 15, 17], [1, 5, 16, 18]) == [1, 3, 3, 3, 5, 11, 15, 16, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 3, 3, 11, 15, 17], [1, 5, 16, 18]) == [1, 3, 3, 3, 5, 11, 15, 16, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001281", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(33, 26) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 26) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001282", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(459)\nacc.deposit(179)\nacc.withdraw(257)\nacc.withdraw(683)\nassert acc.get_balance() == 638\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(459)\nacc.deposit(179)\nassert acc.get_balance() == 638\nacc.withdraw(257)\nassert acc.get_balance() == 381\nacc.withdraw(683)\nassert acc.get_balance() == 381\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001283", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('dabc d') == 'Dabc D'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dabc d') == 'Dabc D'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001284", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(48, 47) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 47) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001285", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-7, 0, -4, -5]) == [-7, -7, -11, -16]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, 0, -4, -5]) == [-7, -7, -11, -16]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001286", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-36, -2, 25]) == 25\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-36, -2, 25]) == 25\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001287", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([1, 9, [[8, 6]]]) == [1, 9, 8, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1, 9, [[8, 6]]]) == [1, 9, 8, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001288", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2) == 'II'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2) == 'II'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001289", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('59,cece,56,babb') == ['59', 'cece', '56', 'babb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('59,cece,56,babb') == ['59', 'cece', '56', 'babb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001290", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('4 * 13 + 10 * 1') == 62\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('4 * 13 + 10 * 1') == 62\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001291", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([5, 0, 2, 5, 4, 4]) == [5, 0, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 2, 5, 4, 4]) == [5, 0, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001292", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('cd,90,\",,bba\"') == ['cd', '90', ',,bba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cd,90,\",,bba\"') == ['cd', '90', ',,bba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001293", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(159) == 15\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(159) == 15\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001294", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(4522) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4522) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001295", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([25, 36, 35, 44, 47, 39]) == [25, 35, 36, 39, 44, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([25, 36, 35, 44, 47, 39]) == [25, 35, 36, 39, 44, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001296", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('hcceee c gda') == 'hcceee'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hcceee c gda') == 'hcceee'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001297", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([7, 7, 0], 2) == [7, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 7, 0], 2) == [7, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001298", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-3, 39, 33, -50, -47]) == 39\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-3, 39, 33, -50, -47]) == 39\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001299", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('baabb', 'ba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabb', 'ba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001300", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2647) == 'MMDCXLVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2647) == 'MMDCXLVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001301", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(6265) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6265) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001302", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[4], 9, [3, 8], [8, 9, 9, 2], 6]) == [4, 9, 3, 8, 8, 9, 9, 2, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], 9, [3, 8], [8, 9, 9, 2], 6]) == [4, 9, 3, 8, 8, 9, 9, 2, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001303", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2497) == 'MMCDXCVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2497) == 'MMCDXCVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001304", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(417) == 'CDXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(417) == 'CDXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001305", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[2]]) == [2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2]]) == [2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001306", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=315; host=719; port=auto') == {'mode': '315', 'host': '719', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=315; host=719; port=auto') == {'mode': '315', 'host': '719', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001307", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('abc', 7) == 'hij'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 7) == 'hij'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001308", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('aaca,11,bcee,27,22') == ['aaca', '11', 'bcee', '27', '22']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aaca,11,bcee,27,22') == ['aaca', '11', 'bcee', '27', '22']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001309", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(493) == 'CDXCIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(493) == 'CDXCIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001310", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(944) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(944) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001311", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('cdeb', 'dbec') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cdeb', 'dbec') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001312", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 1, 1, 1, 2, 2, 3, 3]) == [0, 1, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 1, 1, 1, 2, 2, 3, 3]) == [0, 1, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001313", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-9, 9], [7, 7], [-3, -3]], [[-4, -5], [2, -7], [6, 0]]) == [[-13, 4], [9, 0], [3, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 9], [7, 7], [-3, -3]], [[-4, -5], [2, -7], [6, 0]]) == [[-13, 4], [9, 0], [3, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001314", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 10], [2, 6, 12, 20]) == [0, 2, 6, 10, 12, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 10], [2, 6, 12, 20]) == [0, 2, 6, 10, 12, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001315", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'banana', 'berry', 'banana', 'berry']) == {'b': ['berry', 'banana', 'berry', 'banana', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'berry', 'banana', 'berry']) == {'b': ['berry', 'banana', 'berry', 'banana', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001316", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(99); s.push(54); s.push(13)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(54); s.push(13)\nassert s.peek() == 13\nassert s.pop() == 13\nassert s.pop() == 54\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001317", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(61) == 'LXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(61) == 'LXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001318", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(']a[ba}aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']a[ba}aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001319", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(8, 12) == 68719476736\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 12) == 68719476736\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001320", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([9, 8]) == 17\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9, 8]) == 17\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001321", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([7, 3, 6, 6, 7, 7, 26]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 3, 6, 6, 7, 7, 26]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001322", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(483) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(483) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001323", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(']{]](') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']{]](') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001324", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['a', 'a', 'a', 'e', 'e', 'c']) == {'a': 3, 'e': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'a', 'a', 'e', 'e', 'c']) == {'a': 3, 'e': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001325", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('1 - 8') == -7\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1 - 8') == -7\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001326", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([7, 2, 2, 5, 0, 4, 1, 7, 3, 4], 4) == [[7, 2, 2, 5], [0, 4, 1, 7], [3, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 2, 2, 5, 0, 4, 1, 7, 3, 4], 4) == [[7, 2, 2, 5], [0, 4, 1, 7], [3, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001327", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(42, 53) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(42, 53) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001328", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(3459) == 58\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3459) == 58\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001329", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ddcbbcecaae') == 'dcbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddcbbcecaae') == 'dcbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001330", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[1, 2, 1], [0, 2, 3], [2, 4, 4]], [[3, 1], [5, 5], [0, 2]]) == [[13, 13], [10, 16], [26, 30]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2, 1], [0, 2, 3], [2, 4, 4]], [[3, 1], [5, 5], [0, 2]]) == [[13, 13], [10, 16], [26, 30]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001331", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(6466) == 6646\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6466) == 6646\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001332", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(3943) == 3493\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3943) == 3493\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001333", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([5, 14, 19, 19], [3, 3, 3, 3, 9, 12, 16]) == [3, 3, 3, 3, 5, 9, 12, 14, 16, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 14, 19, 19], [3, 3, 3, 3, 9, 12, 16]) == [3, 3, 3, 3, 5, 9, 12, 14, 16, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001334", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([14, 68, 74, 94], 111) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 68, 74, 94], 111) == -1\nassert binary_search([14, 68, 74, 94], 14) == 0\nassert binary_search([14, 68, 74, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001335", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h28m25s') == 12505\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h28m25s') == 12505\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001336", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cade') == 'cade'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cade') == 'cade'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001337", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 7, 'd': 17, 'e': 82, 'f': 73, 'b': 59}) == {7: 'a', 17: 'd', 82: 'e', 73: 'f', 59: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 7, 'd': 17, 'e': 82, 'f': 73, 'b': 59}) == {7: 'a', 17: 'd', 82: 'e', 73: 'f', 59: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001338", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('d,2,\"b,,a,\",eabb,\",b\"') == ['d', '2', 'b,,a,', 'eabb', ',b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,2,\"b,,a,\",eabb,\",b\"') == ['d', '2', 'b,,a,', 'eabb', ',b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001339", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([29, 9, 2, 3, 3, 2, 6, 4, 27, 29, 47, 16]) == [2, 2, 3, 3, 4, 6, 9, 16, 27, 29, 29, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([29, 9, 2, 3, 3, 2, 6, 4, 27, 29, 47, 16]) == [2, 2, 3, 3, 4, 6, 9, 16, 27, 29, 29, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001340", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['apple', 'coconut', 'coconut', 'avocado', 'date', 'avocado', 'date', 'berry']) == {'a': ['apple', 'avocado', 'avocado'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'coconut', 'coconut', 'avocado', 'date', 'avocado', 'date', 'berry']) == {'a': ['apple', 'avocado', 'avocado'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001341", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"bb,\",e,b,72,8') == ['bb,', 'e', 'b', '72', '8']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"bb,\",e,b,72,8') == ['bb,', 'e', 'b', '72', '8']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001342", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 1], [4, 4], [0, 3]], [[3, 0], [1, 1]]) == [[10, 1], [16, 4], [3, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1], [4, 4], [0, 3]], [[3, 0], [1, 1]]) == [[10, 1], [16, 4], [3, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001343", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('caedea', 'aadeec') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('caedea', 'aadeec') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001344", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(425) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(425) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001345", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(94, 188) == 94\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(94, 188) == 94\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001346", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 4, 5, 2, 4, 6, 2], 1) == [2, 8, 4, 5, 2, 4, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 4, 5, 2, 4, 6, 2], 1) == [2, 8, 4, 5, 2, 4, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001347", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('beccbae', 'beccbaea') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('beccbae', 'beccbaea') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001348", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[7, 9, 6], [7, -9, -1], [-2, 7, 1]], [[-1, -9, -9], [5, 7, -2], [3, 1, -9]]) == [[6, 0, -3], [12, -2, -3], [1, 8, -8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 9, 6], [7, -9, -1], [-2, 7, 1]], [[-1, -9, -9], [5, 7, -2], [3, 1, -9]]) == [[6, 0, -3], [12, -2, -3], [1, 8, -8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001349", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=auto; mode=34; path=597; host=on') == {'user': 'auto', 'mode': '34', 'path': '597', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; mode=34; path=597; host=on') == {'user': 'auto', 'mode': '34', 'path': '597', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001350", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 2, 2, 6, 4, 8, 5], 5) == [[1, 2, 2, 6, 4], [8, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 2, 2, 6, 4, 8, 5], 5) == [[1, 2, 2, 6, 4], [8, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001351", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[7, 4, 9], 4, 8, 7]) == [7, 4, 9, 4, 8, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 4, 9], 4, 8, 7]) == [7, 4, 9, 4, 8, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001352", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(8, 4) == 4096\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 4) == 4096\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001353", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(36) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(36) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001354", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['acyy', 'ac', 'aczxy', 'acx']) == 'ac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acyy', 'ac', 'aczxy', 'acx']) == 'ac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001355", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([0, [4], 7]) == [0, 4, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [4], 7]) == [0, 4, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001356", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(34, 31) == 1054\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(34, 31) == 1054\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001357", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(54)\nacc.deposit(155)\nacc.withdraw(78)\nacc.withdraw(342)\nassert acc.get_balance() == 209\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(54)\nacc.deposit(155)\nassert acc.get_balance() == 209\nacc.withdraw(78)\nassert acc.get_balance() == 131\nacc.withdraw(342)\nassert acc.get_balance() == 131\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001358", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([19, 14, 18]) == [14, 18, 19]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([19, 14, 18]) == [14, 18, 19]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001359", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1777) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1777) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001360", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(92) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(92) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001361", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([50, 35, 48, 1, 0, 45, 4]) == [0, 1, 4, 35, 45, 48, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([50, 35, 48, 1, 0, 45, 4]) == [0, 1, 4, 35, 45, 48, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001362", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 5, 1, 4, 5, 8, 4, 1, 4, 3, 7, 3, 5, 7], 3) == [[2, 5, 1], [4, 5, 8], [4, 1, 4], [3, 7, 3], [5, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 1, 4, 5, 8, 4, 1, 4, 3, 7, 3, 5, 7], 3) == [[2, 5, 1], [4, 5, 8], [4, 1, 4], [3, 7, 3], [5, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001363", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 6, 'e': 4, 'c': 7}, 3) == {'d': 6, 'e': 4, 'c': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 6, 'e': 4, 'c': 7}, 3) == {'d': 6, 'e': 4, 'c': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001364", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([0, 1, 5, 7, 4, 4, 7, 0, 8, 9, 0, 3], 3) == [[0, 1, 5], [7, 4, 4], [7, 0, 8], [9, 0, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 1, 5, 7, 4, 4, 7, 0, 8, 9, 0, 3], 3) == [[0, 1, 5], [7, 4, 4], [7, 0, 8], [9, 0, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001365", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('beecaa') == 'beca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beecaa') == 'beca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001366", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('edcb,ab,da,\"a,\"') == ['edcb', 'ab', 'da', 'a,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('edcb,ab,da,\"a,\"') == ['edcb', 'ab', 'da', 'a,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001367", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('aabxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aabxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001368", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('eebcd ecacea eca beb') == 'Eebcd Ecacea Eca Beb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eebcd ecacea eca beb') == 'Eebcd Ecacea Eca Beb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001369", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(119) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(119) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001370", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(9) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(9) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001371", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([7, 1, 8, 8], 1) == [8, 7, 1, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 1, 8, 8], 1) == [8, 7, 1, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001372", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbabbaaabbbbba', 'abb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabbaaabbbbba', 'abb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001373", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=287; port=off; mode=73; host=56') == {'user': '287', 'port': 'off', 'mode': '73', 'host': '56'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=287; port=off; mode=73; host=56') == {'user': '287', 'port': 'off', 'mode': '73', 'host': '56'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001374", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([4, 6, 2], [6, 4, 9, 8, 4]) == [4, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 6, 2], [6, 4, 9, 8, 4]) == [4, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001375", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[5, 7], [5, 1, 0], [2, 8, 8, 1], 0, 1]) == [5, 7, 5, 1, 0, 2, 8, 8, 1, 0, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 7], [5, 1, 0], [2, 8, 8, 1], 0, 1]) == [5, 7, 5, 1, 0, 2, 8, 8, 1, 0, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001376", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['apple', 'date', 'apple']) == {'a': ['apple', 'apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'date', 'apple']) == {'a': ['apple', 'apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001377", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([44, 24, 44, 41]) == [24, 41, 44, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([44, 24, 44, 41]) == [24, 41, 44, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001378", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(5, 5) == 3125\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 5) == 3125\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001379", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 4, 7, 4, 9, 0, 7, 6], 9) == [6, 8, 4, 7, 4, 9, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 4, 7, 4, 9, 0, 7, 6], 9) == [6, 8, 4, 7, 4, 9, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001380", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([43, 2, 34, 12, 36, 10]) == [2, 10, 12, 34, 36, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([43, 2, 34, 12, 36, 10]) == [2, 10, 12, 34, 36, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001381", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([6, 10, 32, 55, 57, 65], 57) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([6, 10, 32, 55, 57, 65], 57) == 4\nassert binary_search([6, 10, 32, 55, 57, 65], 6) == 0\nassert binary_search([6, 10, 32, 55, 57, 65], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001382", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDX') == 410\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDX') == 410\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001383", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001384", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[[][]]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[[][]]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001385", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([2, 4, 8, 1, 6], [6, 3, 7, 6, 0, 0]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 4, 8, 1, 6], [6, 3, 7, 6, 0, 0]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001386", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('ccbccbcc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccbccbcc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001387", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbaaaaabab', 'bbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaaaaabab', 'bbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001388", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([1, 16, 40, 51, 56], 199) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 16, 40, 51, 56], 199) == -1\nassert binary_search([1, 16, 40, 51, 56], 1) == 0\nassert binary_search([1, 16, 40, 51, 56], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001389", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('bddfbab', 'bddfbaba') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bddfbab', 'bddfbaba') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001390", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(75); s.push(99); s.push(64)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(75); s.push(99); s.push(64)\nassert s.peek() == 64\nassert s.pop() == 64\nassert s.pop() == 99\nassert s.is_empty() == False\nassert s.pop() == 75\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001391", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['cherry', 'date', 'cherry', 'date', 'avocado', 'avocado', 'date']) == {'c': ['cherry', 'cherry'], 'd': ['date', 'date', 'date'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'date', 'cherry', 'date', 'avocado', 'avocado', 'date']) == {'c': ['cherry', 'cherry'], 'd': ['date', 'date', 'date'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001392", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(901) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(901) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001393", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 8, 'c': 16, 'b': 57, 'd': 15, 'f': 62}) == {8: 'a', 16: 'c', 57: 'b', 15: 'd', 62: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 8, 'c': 16, 'b': 57, 'd': 15, 'f': 62}) == {8: 'a', 16: 'c', 57: 'b', 15: 'd', 62: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001394", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[6], 4, 2, 4, 3]) == [6, 4, 2, 4, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6], 4, 2, 4, 3]) == [6, 4, 2, 4, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001395", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([25, 21, 45, 50]) == [21, 25, 45, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([25, 21, 45, 50]) == [21, 25, 45, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001396", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMCXCI') == 2191\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCXCI') == 2191\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001397", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(400) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(400) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001398", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('d bddeeg hcebbd hb dhegcbbg hhhf') == 'dhegcbbg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('d bddeeg hcebbd hb dhegcbbg hhhf') == 'dhegcbbg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001399", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([18, 23, 27, 28, 50, 73, 98], 161) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([18, 23, 27, 28, 50, 73, 98], 161) == -1\nassert binary_search([18, 23, 27, 28, 50, 73, 98], 18) == 0\nassert binary_search([18, 23, 27, 28, 50, 73, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001400", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=910; port=569') == {'host': '910', 'port': '569'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=910; port=569') == {'host': '910', 'port': '569'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001401", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([14, 23, 26, 27, 30, 34, 51, 52, 66, 75, 76], 66) == 8\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 23, 26, 27, 30, 34, 51, 52, 66, 75, 76], 66) == 8\nassert binary_search([14, 23, 26, 27, 30, 34, 51, 52, 66, 75, 76], 14) == 0\nassert binary_search([14, 23, 26, 27, 30, 34, 51, 52, 66, 75, 76], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001402", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([17, 5, 14, 10, 17, 19, 16, 8, 16]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 5, 14, 10, 17, 19, 16, 8, 16]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001403", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(34, 24) == 408\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(34, 24) == 408\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001404", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aaccccccaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaccccccaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001405", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('daedae addae adc') == 'Daedae Addae Adc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('daedae addae adc') == 'Daedae Addae Adc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001406", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code Code', 2) == 'Eqfg Eqfg'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Code', 2) == 'Eqfg Eqfg'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001407", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aabababbbabbbaa', 'abbb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabababbbabbbaa', 'abbb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001408", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[0, 8, 1, 5], [3, 9, 4, 7], [0, 5, 4, 9]]) == [[0, 3, 0], [8, 9, 5], [1, 4, 4], [5, 7, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 8, 1, 5], [3, 9, 4, 7], [0, 5, 4, 9]]) == [[0, 3, 0], [8, 9, 5], [1, 4, 4], [5, 7, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001409", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([4, 5, 1, 1, 9, 3, 5], [0, 2, 8, 4]) == [4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 5, 1, 1, 9, 3, 5], [0, 2, 8, 4]) == [4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001410", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(118) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(118) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001411", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([23, 41, 24]) == [23, 24, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 41, 24]) == [23, 24, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_001412", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 1, 1, 7, 7, 1, 9, 2], 8) == [8, 1, 1, 7, 7, 1, 9, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 1, 1, 7, 7, 1, 9, 2], 8) == [8, 1, 1, 7, 7, 1, 9, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001413", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('b}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001414", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('37m58s') == 2278\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('37m58s') == 2278\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001415", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 0, 1, 4, 5, 2]) == [3, 0, 1, 4, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 1, 4, 5, 2]) == [3, 0, 1, 4, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001416", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('pjdjkznzlna') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('pjdjkznzlna') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001417", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(9, 60) == 180\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 60) == 180\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001418", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-42, -39, 6, -47, 14, 6, -30, -19, 19]) == 19\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-42, -39, 6, -47, 14, 6, -30, -19, 19]) == 19\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001419", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([41, 32, 32, 1, 28, 28, 46, 46]) == [1, 28, 28, 32, 32, 41, 46, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([41, 32, 32, 1, 28, 28, 46, 46]) == [1, 28, 28, 32, 32, 41, 46, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001420", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 2, 'y': 8, 'z': 8}, {'w': 6, 'x': 7, 'z': 5}) == {'w': 8, 'y': 8, 'z': 13, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2, 'y': 8, 'z': 8}, {'w': 6, 'x': 7, 'z': 5}) == {'w': 8, 'y': 8, 'z': 13, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001421", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 3, 'z': 6, 'x': 6}, {'w': 3}) == {'y': 3, 'z': 6, 'x': 6, 'w': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3, 'z': 6, 'x': 6}, {'w': 3}) == {'y': 3, 'z': 6, 'x': 6, 'w': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001422", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['cherry', 'banana', 'cherry', 'apple', 'coconut', 'banana']) == {'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana', 'banana'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'banana', 'cherry', 'apple', 'coconut', 'banana']) == {'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana', 'banana'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001423", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([39, 36, 15, 19, 37, 35, 20, 49, 47, 46]) == [15, 19, 20, 35, 36, 37, 39, 46, 47, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([39, 36, 15, 19, 37, 35, 20, 49, 47, 46]) == [15, 19, 20, 35, 36, 37, 39, 46, 47, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001424", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'a': 8, 'd': 0, 'c': 7, 'e': 5}, 5) == {'a': 8, 'c': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 8, 'd': 0, 'c': 7, 'e': 5}, 5) == {'a': 8, 'c': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001425", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('cbacaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbacaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001426", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(124) == 11\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(124) == 11\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001427", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([2, 10, 12, 21, 24, 36, 48, 53, 71, 85, 87, 98], 24) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 10, 12, 21, 24, 36, 48, 53, 71, 85, 87, 98], 24) == 4\nassert binary_search([2, 10, 12, 21, 24, 36, 48, 53, 71, 85, 87, 98], 2) == 0\nassert binary_search([2, 10, 12, 21, 24, 36, 48, 53, 71, 85, 87, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001428", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(94); s.push(4); s.push(98)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(94); s.push(4); s.push(98)\nassert s.peek() == 98\nassert s.pop() == 98\nassert s.pop() == 4\nassert s.is_empty() == False\nassert s.pop() == 94\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001429", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([2, 7], [0, 4, 11, 12, 20]) == [0, 2, 4, 7, 11, 12, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 7], [0, 4, 11, 12, 20]) == [0, 2, 4, 7, 11, 12, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001430", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([46, 65, 87], 46) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([46, 65, 87], 46) == 0\nassert binary_search([46, 65, 87], 46) == 0\nassert binary_search([46, 65, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001431", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('aafbcf', 'aafbcfb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aafbcf', 'aafbcfb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001432", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([3, 46, 4, 8, 32, 8, 21, 29, 23, 30]) == [3, 4, 8, 8, 21, 23, 29, 30, 32, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([3, 46, 4, 8, 32, 8, 21, 29, 23, 30]) == [3, 4, 8, 8, 21, 23, 29, 30, 32, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001433", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['cz', 'c', 'cxy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cz', 'c', 'cxy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001434", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('ghf ad heb b acfe') == 'acfe'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ghf ad heb b acfe') == 'acfe'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001435", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(247203) == 497\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(247203) == 497\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001436", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 4, 5, 1, 0]) == [4, 5, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 5, 1, 0]) == [4, 5, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001437", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[5], 3]) == [5, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5], 3]) == [5, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001438", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CDLXVIII') == 468\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXVIII') == 468\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001439", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 0, 'd': 2, 'a': 10, 'b': 9}, 6) == {'a': 10, 'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 0, 'd': 2, 'a': 10, 'b': 9}, 6) == {'a': 10, 'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001440", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(230)\nacc.deposit(289)\nacc.withdraw(415)\nacc.withdraw(539)\nassert acc.get_balance() == 519\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(230)\nacc.deposit(289)\nassert acc.get_balance() == 519\nacc.withdraw(415)\nassert acc.get_balance() == 104\nacc.withdraw(539)\nassert acc.get_balance() == 104\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001441", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 5, 9, 6, 7, 7], 2) == [[8, 5], [9, 6], [7, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 5, 9, 6, 7, 7], 2) == [[8, 5], [9, 6], [7, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001442", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'z': 3}, {'z': 5, 'y': 1, 'w': 7}) == {'y': 7, 'z': 8, 'w': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'z': 3}, {'z': 5, 'y': 1, 'w': 7}) == {'y': 7, 'z': 8, 'w': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001443", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(7332) == 15\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7332) == 15\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001444", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('ccaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001445", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([14, 39, 44, 47, 68, 75, 92, 96], 172) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 39, 44, 47, 68, 75, 92, 96], 172) == -1\nassert binary_search([14, 39, 44, 47, 68, 75, 92, 96], 14) == 0\nassert binary_search([14, 39, 44, 47, 68, 75, 92, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001446", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(41, 2) == 82\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(41, 2) == 82\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001447", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('bbb aaeaa') == 'Bbb Aaeaa'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bbb aaeaa') == 'Bbb Aaeaa'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001448", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(5371) == 1735\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5371) == 1735\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001449", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1, 10, 12, 14, 19, 19], [1, 2, 5, 8, 12, 18]) == [1, 1, 2, 5, 8, 10, 12, 12, 14, 18, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 10, 12, 14, 19, 19], [1, 2, 5, 8, 12, 18]) == [1, 1, 2, 5, 8, 10, 12, 12, 14, 18, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001450", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([44, 27, 6, 1, 2, 42, 3, 36, 29, 14, 17]) == [1, 2, 3, 6, 14, 17, 27, 29, 36, 42, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([44, 27, 6, 1, 2, 42, 3, 36, 29, 14, 17]) == [1, 2, 3, 6, 14, 17, 27, 29, 36, 42, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001451", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(296) == 'CCXCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(296) == 'CCXCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001452", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[5, 2, 8], [7, 7, 7]]) == [5, 2, 8, 7, 7, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 2, 8], [7, 7, 7]]) == [5, 2, 8, 7, 7, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001453", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('cac') == 'Cac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cac') == 'Cac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001454", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([40, 39, 6, 0, 1]) == [0, 1, 6, 39, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([40, 39, 6, 0, 1]) == [0, 1, 6, 39, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001455", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(2, 3) == 8\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 3) == 8\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001456", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 9, 8, 0, 3, 8, 7, 7, 1, 9], 4) == [[5, 9, 8, 0], [3, 8, 7, 7], [1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 9, 8, 0, 3, 8, 7, 7, 1, 9], 4) == [[5, 9, 8, 0], [3, 8, 7, 7], [1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001457", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(66) == 27\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(66) == 27\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001458", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(3152) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3152) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001459", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 17, 20, 22, 52, 56, 58, 62, 67, 71, 76], 20) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 17, 20, 22, 52, 56, 58, 62, 67, 71, 76], 20) == 2\nassert binary_search([4, 17, 20, 22, 52, 56, 58, 62, 67, 71, 76], 4) == 0\nassert binary_search([4, 17, 20, 22, 52, 56, 58, 62, 67, 71, 76], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001460", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(301) == 16\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(301) == 16\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001461", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 3, 'w': 9, 'x': 5}, {'y': 2}) == {'y': 5, 'w': 9, 'x': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3, 'w': 9, 'x': 5}, {'y': 2}) == {'y': 5, 'w': 9, 'x': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001462", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, -1, -6, 6], [-7, 7, 1, 2], [7, 9, 9, 5], [5, -4, -8, 9]], [[-9, 6, -1, 1], [-1, 9, 9, -2], [-3, -7, -3, -1], [0, -6, -1, -6]]) == [[-3, 5, -7, 7], [-8, 16, 10, 0], [4, 2, 6, 4], [5, -10, -9, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -1, -6, 6], [-7, 7, 1, 2], [7, 9, 9, 5], [5, -4, -8, 9]], [[-9, 6, -1, 1], [-1, 9, 9, -2], [-3, -7, -3, -1], [0, -6, -1, -6]]) == [[-3, 5, -7, 7], [-8, 16, 10, 0], [4, 2, 6, 4], [5, -10, -9, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001463", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 2, 0, 7, 0], [2, 5, 4, 1, 7]) == [2, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 2, 0, 7, 0], [2, 5, 4, 1, 7]) == [2, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001464", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([34, 46, 30]) == [30, 34, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 46, 30]) == [30, 34, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001465", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('edaecaaaab') == 'edacb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edaecaaaab') == 'edacb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001466", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 7, 6, 8, 8], 2) == [[9, 7], [6, 8], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 7, 6, 8, 8], 2) == [[9, 7], [6, 8], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001467", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(36, 59) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(36, 59) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001468", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 8, 'w': 8, 'x': 1}, {'z': 2, 'w': 5, 'y': 9}) == {'y': 17, 'w': 13, 'x': 1, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8, 'w': 8, 'x': 1}, {'z': 2, 'w': 5, 'y': 9}) == {'y': 17, 'w': 13, 'x': 1, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001469", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[9, -6, 8, 0], [-1, 7, -4, -6], [1, 1, 5, 7]], [[-7, -1, -4, 5], [-7, -7, -4, 5], [9, -7, 1, 9]]) == [[2, -7, 4, 5], [-8, 0, -8, -1], [10, -6, 6, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, -6, 8, 0], [-1, 7, -4, -6], [1, 1, 5, 7]], [[-7, -1, -4, 5], [-7, -7, -4, 5], [9, -7, 1, 9]]) == [[2, -7, 4, 5], [-8, 0, -8, -1], [10, -6, 6, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001470", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eecdacadab') == 'ecdab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eecdacadab') == 'ecdab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001471", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(99); s.push(76); s.push(6)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(76); s.push(6)\nassert s.peek() == 6\nassert s.pop() == 6\nassert s.pop() == 76\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001472", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([18, 43, 57, 71], 18) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([18, 43, 57, 71], 18) == 0\nassert binary_search([18, 43, 57, 71], 18) == 0\nassert binary_search([18, 43, 57, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001473", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 1, 'y': 8, 'x': 5}, {'x': 1, 'z': 7}) == {'z': 8, 'y': 8, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1, 'y': 8, 'x': 5}, {'x': 1, 'z': 7}) == {'z': 8, 'y': 8, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001474", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(12, 150) == 6\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(12, 150) == 6\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001475", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(3817) == 7183\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3817) == 7183\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001476", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'avocado', 'cherry', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'avocado', 'cherry', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001477", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 0, 1, 4, 2, 5, 2]) == [2, 0, 1, 4, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 0, 1, 4, 2, 5, 2]) == [2, 0, 1, 4, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001478", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 3, 'y': 7}, {'x': 9, 'y': 3}) == {'z': 3, 'y': 10, 'x': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3, 'y': 7}, {'x': 9, 'y': 3}) == {'z': 3, 'y': 10, 'x': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001479", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 3, 6, 5, 3, 0, 4], 5) == [[1, 3, 6, 5, 3], [0, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 6, 5, 3, 0, 4], 5) == [[1, 3, 6, 5, 3], [0, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001480", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Python', 21) == 'Ktocji'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 21) == 'Ktocji'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001481", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 5, 'e': 7, 'd': 9}, 4) == {'b': 5, 'e': 7, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 5, 'e': 7, 'd': 9}, 4) == {'b': 5, 'e': 7, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001482", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('acxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('acxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001483", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=612; host=901; mode=off') == {'port': '612', 'host': '901', 'mode': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=612; host=901; mode=off') == {'port': '612', 'host': '901', 'mode': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001484", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CDXXIX') == 429\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXIX') == 429\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001485", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ddddeee') == 'de'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddddeee') == 'de'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001486", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([8, -27, 6, -40, 42]) == 42\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([8, -27, 6, -40, 42]) == 42\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001487", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaaaabb') == 'a10b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaabb') == 'a10b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001488", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 1, 'y': 9}, {'z': 8}) == {'z': 9, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1, 'y': 9}, {'z': 8}) == {'z': 9, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001489", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('dbbbb') == 'd1b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dbbbb') == 'd1b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001490", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('ccbaf') == 'fabcc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ccbaf') == 'fabcc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001491", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-33, 32, -29, -8, 3]) == 32\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-33, 32, -29, -8, 3]) == 32\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001492", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(52, 131) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(52, 131) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001493", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbbbbbbbcddbbbbbcccccccc') == 'b9c1d2b5c8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbcddbbbbbcccccccc') == 'b9c1d2b5c8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001494", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([14, 66, 67, 82, 84, 92], 92) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 66, 67, 82, 84, 92], 92) == 5\nassert binary_search([14, 66, 67, 82, 84, 92], 14) == 0\nassert binary_search([14, 66, 67, 82, 84, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001495", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('babbab') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('babbab') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001496", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 5, 1, 5, 3, 2, 1, 1, 2, 5, 3, 0]) == [2, 5, 1, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 5, 1, 5, 3, 2, 1, 1, 2, 5, 3, 0]) == [2, 5, 1, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001497", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([7, 14, 15, 17, 19], [1, 1, 5, 8, 8, 9, 15]) == [1, 1, 5, 7, 8, 8, 9, 14, 15, 15, 17, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7, 14, 15, 17, 19], [1, 1, 5, 8, 8, 9, 15]) == [1, 1, 5, 7, 8, 8, 9, 14, 15, 15, 17, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001498", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'd', 'd', 'c', 'e']) == {'c': 2, 'd': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'd', 'd', 'c', 'e']) == {'c': 2, 'd': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001499", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['bcayzx', 'bcaz', 'bcazx']) == 'bca'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bcayzx', 'bcaz', 'bcazx']) == 'bca'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001500", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(14 + 16) + 13 - 9') == 34\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(14 + 16) + 13 - 9') == 34\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001501", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-1, -6], [2, -7]], [[-8, -9], [8, 6]]) == [[-9, -15], [10, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -6], [2, -7]], [[-8, -9], [8, 6]]) == [[-9, -15], [10, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001502", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 5, 'x': 2, 'y': 9}, {'x': 3, 'z': 5}) == {'w': 5, 'x': 5, 'y': 9, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5, 'x': 2, 'y': 9}, {'x': 3, 'z': 5}) == {'w': 5, 'x': 5, 'y': 9, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001503", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 5, 'e': 6}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 5, 'e': 6}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001504", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[0, 6], [5, 7, 8]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 6], [5, 7, 8]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001505", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabbbabaab', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbbabaab', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001506", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMDLII') == 2552\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDLII') == 2552\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001507", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(32)\nacc.deposit(3)\nacc.withdraw(27)\nacc.withdraw(109)\nassert acc.get_balance() == 35\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(32)\nacc.deposit(3)\nassert acc.get_balance() == 35\nacc.withdraw(27)\nassert acc.get_balance() == 8\nacc.withdraw(109)\nassert acc.get_balance() == 8\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001508", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 19) == 'tuv'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 19) == 'tuv'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001509", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[8], 8]) == [8, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8], 8]) == [8, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001510", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabbaabbaaba', 'ab') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbaabbaaba', 'ab') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001511", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([5, 21, 38, 49, 5, 46]) == [5, 5, 21, 38, 46, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([5, 21, 38, 49, 5, 46]) == [5, 5, 21, 38, 46, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001512", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(193)\nacc.deposit(267)\nacc.withdraw(227)\nacc.withdraw(515)\nassert acc.get_balance() == 460\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(193)\nacc.deposit(267)\nassert acc.get_balance() == 460\nacc.withdraw(227)\nassert acc.get_balance() == 233\nacc.withdraw(515)\nassert acc.get_balance() == 233\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001513", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[8, -4], [5, 1], [1, -7]], [[-6, 2], [-8, 9], [-4, -8]]) == [[2, -2], [-3, 10], [-3, -15]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -4], [5, 1], [1, -7]], [[-6, 2], [-8, 9], [-4, -8]]) == [[2, -2], [-3, 10], [-3, -15]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001514", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([6, 4, 2, -6, -6, -4, -7, -4]) == [6, 10, 12, 6, 0, -4, -11, -15]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([6, 4, 2, -6, -6, -4, -7, -4]) == [6, 10, 12, 6, 0, -4, -11, -15]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001515", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([29, 19, 12, 11, 50, 38]) == [11, 12, 19, 29, 38, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([29, 19, 12, 11, 50, 38]) == [11, 12, 19, 29, 38, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001516", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(899) == 'DCCCXCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(899) == 'DCCCXCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001517", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('6m51s') == 411\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('6m51s') == 411\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001518", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(369) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(369) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001519", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aaabbaaa', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabbaaa', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001520", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([10, 30, 12]) == [10, 12, 30]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([10, 30, 12]) == [10, 12, 30]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001521", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(50, 154, 979) == 713\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(50, 154, 979) == 713\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001522", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 1, 7, 2, 9, 0, 1, 3], 7) == [1, 7, 2, 9, 0, 1, 3, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 1, 7, 2, 9, 0, 1, 3], 7) == [1, 7, 2, 9, 0, 1, 3, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001523", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([28, 15, 10, 50, 40]) == [10, 15, 28, 40, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([28, 15, 10, 50, 40]) == [10, 15, 28, 40, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001524", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(41, 10) == 410\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(41, 10) == 410\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001525", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('hfbgadb b hbfeaec agaacgea') == 'agaacgea'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hfbgadb b hbfeaec agaacgea') == 'agaacgea'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001526", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([2, 4, 9, 10, 15, 20], [1, 2, 5, 10, 14, 14, 20]) == [1, 2, 2, 4, 5, 9, 10, 10, 14, 14, 15, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 4, 9, 10, 15, 20], [1, 2, 5, 10, 14, 14, 20]) == [1, 2, 2, 4, 5, 9, 10, 10, 14, 14, 15, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001527", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([10, 25, 15, 25, 10]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 25, 15, 25, 10]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001528", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 8, 'b': 3, 'c': 4}, 6) == {'d': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 8, 'b': 3, 'c': 4}, 6) == {'d': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001529", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([5, 6, 3, 1, 2, 9, 2, 1, 4], 3) == [2, 1, 4, 5, 6, 3, 1, 2, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 6, 3, 1, 2, 9, 2, 1, 4], 3) == [2, 1, 4, 5, 6, 3, 1, 2, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001530", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(7 + 16 * 18 - 18)') == 277\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(7 + 16 * 18 - 18)') == 277\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001531", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'date', 'date', 'banana', 'banana', 'banana', 'apple']) == {'c': ['coconut'], 'b': ['banana', 'banana', 'banana', 'banana'], 'd': ['date', 'date'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'date', 'date', 'banana', 'banana', 'banana', 'apple']) == {'c': ['coconut'], 'b': ['banana', 'banana', 'banana', 'banana'], 'd': ['date', 'date'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001532", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([6]) == 6\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([6]) == 6\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001533", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(3885) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3885) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001534", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([37, 48, 0, 41, 29]) == [0, 29, 37, 41, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([37, 48, 0, 41, 29]) == [0, 29, 37, 41, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001535", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[5, 5, 4, 9], [0, 4, 3], [3, 3, 1]]) == [5, 5, 4, 9, 0, 4, 3, 3, 3, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 5, 4, 9], [0, 4, 3], [3, 3, 1]]) == [5, 5, 4, 9, 0, 4, 3, 3, 3, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001536", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([41, 10, 3, 16, 49, 49, 23, 49]) == [3, 10, 16, 23, 41, 49, 49, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 10, 3, 16, 49, 49, 23, 49]) == [3, 10, 16, 23, 41, 49, 49, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001537", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('bxxa') == 'axxb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bxxa') == 'axxb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001538", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-50, 29, 31, -31, -11, 28, -1, 31, -19]) == 31\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-50, 29, 31, -31, -11, 28, -1, 31, -19]) == 31\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001539", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-23, -31, -48, 20, -33]) == 20\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-23, -31, -48, 20, -33]) == 20\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001540", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['date', 'cherry', 'avocado', 'date', 'cherry', 'coconut']) == {'d': ['date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'avocado', 'date', 'cherry', 'coconut']) == {'d': ['date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001541", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([18, 6, 39]) == [6, 18, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([18, 6, 39]) == [6, 18, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001542", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(39) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(39) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001543", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(34, 149, 156) == 112\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(34, 149, 156) == 112\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001544", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([1, 7, 0, 5, 7, 2, 7, 8], [1, 3, 4, 6, 4, 7]) == [1, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 7, 0, 5, 7, 2, 7, 8], [1, 3, 4, 6, 4, 7]) == [1, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001545", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-1, -7, 6, 6], [1, -2, 1, -5]], [[3, 1, -3, 7], [-5, -1, 6, -2]]) == [[2, -6, 3, 13], [-4, -3, 7, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -7, 6, 6], [1, -2, 1, -5]], [[3, 1, -3, 7], [-5, -1, 6, -2]]) == [[2, -6, 3, 13], [-4, -3, 7, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001546", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(195) == 'CXCV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(195) == 'CXCV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001547", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-4, 5, -5, -3], [6, 3, -5, 3], [1, -7, -1, -6]], [[-3, -5, -8, 0], [-9, 0, -9, 6], [7, -4, 6, -3]]) == [[-7, 0, -13, -3], [-3, 3, -14, 9], [8, -11, 5, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 5, -5, -3], [6, 3, -5, 3], [1, -7, -1, -6]], [[-3, -5, -8, 0], [-9, 0, -9, 6], [7, -4, 6, -3]]) == [[-7, 0, -13, -3], [-3, 3, -14, 9], [8, -11, 5, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001548", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'x': 4, 'w': 4}, {'x': 5, 'w': 8}) == {'z': 9, 'x': 9, 'w': 12}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'x': 4, 'w': 4}, {'x': 5, 'w': 8}) == {'z': 9, 'x': 9, 'w': 12}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001549", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran! sat, the, cat ran sun the Cat the') == {'ran': 2, 'sat': 1, 'the': 3, 'cat': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! sat, the, cat ran sun the Cat the') == {'ran': 2, 'sat': 1, 'the': 3, 'cat': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001550", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('cdf', 'cdfe') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cdf', 'cdfe') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001551", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([21, 2, 21, 12]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 2, 21, 12]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001552", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([6, 18, 42, 49, 43, 8, 30]) == [6, 8, 18, 30, 42, 43, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([6, 18, 42, 49, 43, 8, 30]) == [6, 8, 18, 30, 42, 43, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001553", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([29, 43, 35, 36]) == [29, 35, 36, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([29, 43, 35, 36]) == [29, 35, 36, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001554", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Python', 23) == 'Mvqelk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 23) == 'Mvqelk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001555", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['', 'xzy']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['', 'xzy']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001556", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'e', 'e', 'd', 'c', 'c', 'd', 'd']) == {'a': 1, 'e': 2, 'd': 3, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'e', 'e', 'd', 'c', 'c', 'd', 'd']) == {'a': 1, 'e': 2, 'd': 3, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001557", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([5], [0, 6, 7, 8, 12]) == [0, 5, 6, 7, 8, 12]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5], [0, 6, 7, 8, 12]) == [0, 5, 6, 7, 8, 12]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001558", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(76) == [2, 2, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(76) == [2, 2, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001559", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[1, 0, -6], [5, 9, -1]], [[2, -8, -9], [0, -3, -1]]) == [[3, -8, -15], [5, 6, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, 0, -6], [5, 9, -1]], [[2, -8, -9], [0, -3, -1]]) == [[3, -8, -15], [5, 6, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001560", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(422)\nacc.deposit(125)\nacc.withdraw(544)\nacc.withdraw(661)\nassert acc.get_balance() == 547\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(422)\nacc.deposit(125)\nassert acc.get_balance() == 547\nacc.withdraw(544)\nassert acc.get_balance() == 3\nacc.withdraw(661)\nassert acc.get_balance() == 3\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001561", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran dog, the the') == {'ran': 1, 'dog': 1, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog, the the') == {'ran': 1, 'dog': 1, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001562", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('20m30s') == 1230\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('20m30s') == 1230\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001563", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[8, 0], [5, 0, 1], [1, 3, 6]]) == [8, 0, 5, 0, 1, 1, 3, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 0], [5, 0, 1], [1, 3, 6]]) == [8, 0, 5, 0, 1, 1, 3, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001564", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=518; mode=off; host=995; path=506') == {'port': '518', 'mode': 'off', 'host': '995', 'path': '506'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=518; mode=off; host=995; path=506') == {'port': '518', 'mode': 'off', 'host': '995', 'path': '506'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001565", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([30, 20, 22, 44, 36, 47, 41, 19]) == [19, 20, 22, 30, 36, 41, 44, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 20, 22, 44, 36, 47, 41, 19]) == [19, 20, 22, 30, 36, 41, 44, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001566", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(158) == 'CLVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(158) == 'CLVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001567", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(187) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(187) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001568", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 3, 1, 3, 3, 0, 5, 3, 0]) == [3, 1, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 1, 3, 3, 0, 5, 3, 0]) == [3, 1, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001569", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-38, 18, 15, 41, 44, -20, -22, -48]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-38, 18, 15, 41, 44, -20, -22, -48]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001570", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([3, 5, 21, 1]) == [1, 3, 5, 21]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([3, 5, 21, 1]) == [1, 3, 5, 21]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001571", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h14m58s') == 18898\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h14m58s') == 18898\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001572", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h31m31s') == 12691\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h31m31s') == 12691\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001573", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('ba]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('ba]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001574", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=496; path=473') == {'host': '496', 'path': '473'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=496; path=473') == {'host': '496', 'path': '473'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001575", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 2, 4, 4, 4]) == [1, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 4, 4, 4]) == [1, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001576", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[7, 6, 7], [8, 7, 5], [3, 2, 6]]) == [[7, 8, 3], [6, 7, 2], [7, 5, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 6, 7], [8, 7, 5], [3, 2, 6]]) == [[7, 8, 3], [6, 7, 2], [7, 5, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001577", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('DLXVIII') == 568\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DLXVIII') == 568\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001578", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ddccbb') == 'dcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddccbb') == 'dcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001579", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3052) == 10\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3052) == 10\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001580", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'b', 'c', 'b', 'c', 'd', 'd', 'e', 'c']) == {'a': 1, 'b': 2, 'c': 3, 'd': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'c', 'b', 'c', 'd', 'd', 'e', 'c']) == {'a': 1, 'b': 2, 'c': 3, 'd': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001581", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(328) == [2, 2, 2, 41]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(328) == [2, 2, 2, 41]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001582", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(428) == 'CDXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(428) == 'CDXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001583", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aaabab', 'bbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabab', 'bbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001584", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('ybfeaf') == 'faefby'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ybfeaf') == 'faefby'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001585", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aaaaaaababab', 'aab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaaaababab', 'aab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001586", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(19, 13, 598) == 513\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 13, 598) == 513\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001587", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 8, 8, 4, 4, 7, 2], [6, 5, 5]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 8, 8, 4, 4, 7, 2], [6, 5, 5]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001588", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(34, 11) == 374\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(34, 11) == 374\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001589", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-6, 2], [3, -2]], [[-9, -3], [8, 8]]) == [[-15, -1], [11, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, 2], [3, -2]], [[-9, -3], [8, 8]]) == [[-15, -1], [11, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001590", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbaabbbb', 'baba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaabbbb', 'baba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001591", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([41, 16, 6, 8, 4]) == [4, 6, 8, 16, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 16, 6, 8, 4]) == [4, 6, 8, 16, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001592", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[7, 5, 3, 5], [2, 3, 7, 1], [8, 4, 9, 0], [8, 7, 1, 7]]) == [[7, 2, 8, 8], [5, 3, 4, 7], [3, 7, 9, 1], [5, 1, 0, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 5, 3, 5], [2, 3, 7, 1], [8, 4, 9, 0], [8, 7, 1, 7]]) == [[7, 2, 8, 8], [5, 3, 4, 7], [3, 7, 9, 1], [5, 1, 0, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001593", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(73); s.push(92); s.push(95)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(73); s.push(92); s.push(95)\nassert s.peek() == 95\nassert s.pop() == 95\nassert s.pop() == 92\nassert s.is_empty() == False\nassert s.pop() == 73\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001594", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2956) == 'MMCMLVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2956) == 'MMCMLVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001595", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(111505) == 333\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(111505) == 333\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001596", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[[5, 5], 4, [2, 6, 9]]]) == [5, 5, 4, 2, 6, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[5, 5], 4, [2, 6, 9]]]) == [5, 5, 4, 2, 6, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001597", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ddddd') == 'd5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddd') == 'd5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001598", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 2, 3, 7, 3, 3, 9, 7], 3) == [3, 9, 7, 2, 2, 3, 7, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 2, 3, 7, 3, 3, 9, 7], 3) == [3, 9, 7, 2, 2, 3, 7, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001599", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[4, 9], [1], 5, 7, 2]) == [4, 9, 1, 5, 7, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 9], [1], 5, 7, 2]) == [4, 9, 1, 5, 7, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001600", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(92, 197) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(92, 197) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001601", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(14); s.push(62); s.push(73)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(14); s.push(62); s.push(73)\nassert s.peek() == 73\nassert s.pop() == 73\nassert s.pop() == 62\nassert s.is_empty() == False\nassert s.pop() == 14\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001602", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=417; host=on; path=on; port=491') == {'user': '417', 'host': 'on', 'path': 'on', 'port': '491'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=417; host=on; path=on; port=491') == {'user': '417', 'host': 'on', 'path': 'on', 'port': '491'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001603", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-9, -6], [-8, -5], [-3, -8]], [[7, 9], [0, -4], [0, -8]]) == [[-2, 3], [-8, -9], [-3, -16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -6], [-8, -5], [-3, -8]], [[7, 9], [0, -4], [0, -8]]) == [[-2, 3], [-8, -9], [-3, -16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001604", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([5, 1, 32, 9, 41, 6, 4, 42]) == [1, 4, 5, 6, 9, 32, 41, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([5, 1, 32, 9, 41, 6, 4, 42]) == [1, 4, 5, 6, 9, 32, 41, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001605", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dabeecb') == 'dabec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dabeecb') == 'dabec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001606", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(189)\nacc.deposit(111)\nacc.withdraw(87)\nacc.withdraw(454)\nassert acc.get_balance() == 300\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(189)\nacc.deposit(111)\nassert acc.get_balance() == 300\nacc.withdraw(87)\nassert acc.get_balance() == 213\nacc.withdraw(454)\nassert acc.get_balance() == 213\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001607", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sun sun. dog ran Dog ran!') == {'sun': 2, 'dog': 2, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun. dog ran Dog ran!') == {'sun': 2, 'dog': 2, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001608", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 9, 17, 19], [1, 5, 11, 17, 20]) == [0, 1, 5, 9, 11, 17, 17, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 9, 17, 19], [1, 5, 11, 17, 20]) == [0, 1, 5, 9, 11, 17, 17, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001609", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([0, 8, 39, 22, 24, 38, 3]) == [0, 3, 8, 22, 24, 38, 39]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 8, 39, 22, 24, 38, 3]) == [0, 3, 8, 22, 24, 38, 39]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001610", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-5, -4, 9], [4, 5, -4], [7, 1, 5]], [[7, 4, 4], [2, -1, -1], [8, 9, 1]]) == [[2, 0, 13], [6, 4, -5], [15, 10, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -4, 9], [4, 5, -4], [7, 1, 5]], [[7, 4, 4], [2, -1, -1], [8, 9, 1]]) == [[2, 0, 13], [6, 4, -5], [15, 10, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001611", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 96, 'd': 44, 'a': 92, 'b': 2, 'c': 79}) == {96: 'f', 44: 'd', 92: 'a', 2: 'b', 79: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 96, 'd': 44, 'a': 92, 'b': 2, 'c': 79}) == {96: 'f', 44: 'd', 92: 'a', 2: 'b', 79: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001612", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('cb') == 'Cb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cb') == 'Cb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001613", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 2}, {'z': 1, 'y': 2}) == {'w': 2, 'z': 1, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2}, {'z': 1, 'y': 2}) == {'w': 2, 'z': 1, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001614", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'banana', 'cherry', 'avocado', 'avocado', 'apple', 'avocado']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana'], 'a': ['avocado', 'avocado', 'apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'banana', 'cherry', 'avocado', 'avocado', 'apple', 'avocado']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana'], 'a': ['avocado', 'avocado', 'apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001615", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([33, 36, 50, 34, 41, 32, 48]) == [32, 33, 34, 36, 41, 48, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([33, 36, 50, 34, 41, 32, 48]) == [32, 33, 34, 36, 41, 48, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001616", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(1399) == 'MCCCXCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1399) == 'MCCCXCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001617", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 8, 3, 2], 2) == [3, 2, 2, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 8, 3, 2], 2) == [3, 2, 2, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001618", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 6, 13], [2, 15, 18]) == [0, 2, 6, 13, 15, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 6, 13], [2, 15, 18]) == [0, 2, 6, 13, 15, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001619", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog the dog ran cat cat') == {'dog': 2, 'the': 1, 'ran': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog the dog ran cat cat') == {'dog': 2, 'the': 1, 'ran': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001620", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('4h31s') == 14431\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h31s') == 14431\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001621", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h14m31s') == 15271\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h14m31s') == 15271\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001622", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([16, 42, 32, 0, 3]) == [0, 3, 16, 32, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([16, 42, 32, 0, 3]) == [0, 3, 16, 32, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001623", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([1, 1, 7, 8, 16], [4, 7, 7, 12]) == [1, 1, 4, 7, 7, 7, 8, 12, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 1, 7, 8, 16], [4, 7, 7, 12]) == [1, 1, 4, 7, 7, 7, 8, 12, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001624", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(3584) == 'MMMDLXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3584) == 'MMMDLXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001625", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(121)\nacc.deposit(124)\nacc.withdraw(12)\nacc.withdraw(301)\nassert acc.get_balance() == 245\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(121)\nacc.deposit(124)\nassert acc.get_balance() == 245\nacc.withdraw(12)\nassert acc.get_balance() == 233\nacc.withdraw(301)\nassert acc.get_balance() == 233\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001626", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(53, 55) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(53, 55) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001627", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('adebdedbbebbbe') == 'adeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adebdedbbebbbe') == 'adeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001628", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 2, 'w': 3}, {'w': 1}) == {'x': 2, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 2, 'w': 3}, {'w': 1}) == {'x': 2, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001629", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(3); s.push(65); s.push(15)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(3); s.push(65); s.push(15)\nassert s.peek() == 15\nassert s.pop() == 15\nassert s.pop() == 65\nassert s.is_empty() == False\nassert s.pop() == 3\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001630", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([18, 19, 20, 4, 20, 29, 10]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 19, 20, 4, 20, 29, 10]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001631", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello', 3) == 'Khoor'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 3) == 'Khoor'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001632", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('1h58m52s') == 7132\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h58m52s') == 7132\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001633", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([0, 14, 7, 2, 18, 25, 8, 23, 4, 42, 21, 39, 41]) == [0, 2, 4, 7, 8, 14, 18, 21, 23, 25, 39, 41, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([0, 14, 7, 2, 18, 25, 8, 23, 4, 42, 21, 39, 41]) == [0, 2, 4, 7, 8, 14, 18, 21, 23, 25, 39, 41, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001634", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0], [13, 14, 19]) == [0, 13, 14, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0], [13, 14, 19]) == [0, 13, 14, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001635", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('ababbaabababab', 'aaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbaabababab', 'aaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001636", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 1, 'w': 6, 'x': 1}, {'y': 3}) == {'y': 4, 'w': 6, 'x': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1, 'w': 6, 'x': 1}, {'y': 3}) == {'y': 4, 'w': 6, 'x': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001637", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([5, -9]) == [5, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([5, -9]) == [5, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001638", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(45, 12) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(45, 12) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001639", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(3889) == 28\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3889) == 28\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001640", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(2, 17) == 34\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(2, 17) == 34\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001641", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(123, 99) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(123, 99) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001642", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('16') == 16\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('16') == 16\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001643", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello Code', 24) == 'Fcjjm Ambc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Code', 24) == 'Fcjjm Ambc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001644", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(37) == [37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(37) == [37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001645", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([15, 17, 18, 18], [0, 5, 6, 12, 17, 19, 20]) == [0, 5, 6, 12, 15, 17, 17, 18, 18, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([15, 17, 18, 18], [0, 5, 6, 12, 17, 19, 20]) == [0, 5, 6, 12, 15, 17, 17, 18, 18, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001646", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'apple', 'banana', 'cherry', 'avocado', 'avocado']) == {'c': ['coconut', 'cherry'], 'b': ['banana', 'banana'], 'a': ['apple', 'avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'apple', 'banana', 'cherry', 'avocado', 'avocado']) == {'c': ['coconut', 'cherry'], 'b': ['banana', 'banana'], 'a': ['apple', 'avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001647", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 20) == 'uvw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 20) == 'uvw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001648", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ccdddddddd') == 'c2d8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccdddddddd') == 'c2d8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001649", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([2, 4, 2, 1], 2) == [2, 1, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 4, 2, 1], 2) == [2, 1, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001650", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('eehcbfad hfebfc b') == 'eehcbfad'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('eehcbfad hfebfc b') == 'eehcbfad'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001651", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Code', 20) == 'Wixy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 20) == 'Wixy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001652", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(2849) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2849) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001653", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([9, [5, 1, 3, 6], 8]) == [9, 5, 1, 3, 6, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [5, 1, 3, 6], 8]) == [9, 5, 1, 3, 6, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001654", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(108) == [2, 2, 3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(108) == [2, 2, 3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001655", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(29222) == 170\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(29222) == 170\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001656", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aaacbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaacbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001657", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(914) == 'CMXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(914) == 'CMXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001658", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('XI') == 11\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XI') == 11\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001659", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 1, 'z': 1}, {'z': 6}) == {'y': 1, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1, 'z': 1}, {'z': 6}) == {'y': 1, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001660", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([36, 30, 1, 10, 41, 25, 37]) == [1, 10, 25, 30, 36, 37, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([36, 30, 1, 10, 41, 25, 37]) == [1, 10, 25, 30, 36, 37, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001661", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-14, 10]) == -4\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, 10]) == -4\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001662", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(4243) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4243) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001663", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sun. dog cat the! the the ran, ran Sat dog') == {'sun': 1, 'dog': 2, 'cat': 1, 'the': 3, 'ran': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun. dog cat the! the the ran, ran Sat dog') == {'sun': 1, 'dog': 2, 'cat': 1, 'the': 3, 'ran': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001664", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('bbbbbaaaaaaadddddddaaaaaaaccccc') == 'b5a7d7a7c5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbaaaaaaadddddddaaaaaaaccccc') == 'b5a7d7a7c5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001665", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(447) == 'CDXLVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(447) == 'CDXLVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001666", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('be cbc edaec') == 'Be Cbc Edaec'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('be cbc edaec') == 'Be Cbc Edaec'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001667", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([2, 10, 11], [1, 4, 15, 17, 18, 19, 20]) == [1, 2, 4, 10, 11, 15, 17, 18, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 10, 11], [1, 4, 15, 17, 18, 19, 20]) == [1, 2, 4, 10, 11, 15, 17, 18, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001668", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 5, 5, 4, 5, 0, 0]) == [4, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 5, 4, 5, 0, 0]) == [4, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001669", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([17, 61, 80], 17) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 61, 80], 17) == 0\nassert binary_search([17, 61, 80], 17) == 0\nassert binary_search([17, 61, 80], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001670", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ebdebecb') == 'ebdc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebdebecb') == 'ebdc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001671", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[1, 5, 1, 0], [5, 7, 3, 4], [8, 5], [9, 6, 3, 6], 6]) == [1, 5, 1, 0, 5, 7, 3, 4, 8, 5, 9, 6, 3, 6, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 5, 1, 0], [5, 7, 3, 4], [8, 5], [9, 6, 3, 6], 6]) == [1, 5, 1, 0, 5, 7, 3, 4, 8, 5, 9, 6, 3, 6, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001672", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([5, 9, 2], 3) == [5, 9, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 9, 2], 3) == [5, 9, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001673", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[2, 4, 6], [6, 0, 3], [8, 3, 9]]) == [[2, 6, 8], [4, 0, 3], [6, 3, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 4, 6], [6, 0, 3], [8, 3, 9]]) == [[2, 6, 8], [4, 0, 3], [6, 3, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001674", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(461)\nacc.deposit(178)\nacc.withdraw(195)\nacc.withdraw(672)\nassert acc.get_balance() == 639\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(461)\nacc.deposit(178)\nassert acc.get_balance() == 639\nacc.withdraw(195)\nassert acc.get_balance() == 444\nacc.withdraw(672)\nassert acc.get_balance() == 444\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001675", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 2, 26, 4]) == 4\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 2, 26, 4]) == 4\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001676", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([1, [1, 9, [4, 2, 5]]]) == [1, 1, 9, 4, 2, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1, [1, 9, [4, 2, 5]]]) == [1, 1, 9, 4, 2, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001677", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 7, 'z': 9, 'y': 4}, {'z': 1}) == {'x': 7, 'z': 10, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7, 'z': 9, 'y': 4}, {'z': 1}) == {'x': 7, 'z': 10, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001678", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 1, 8, 6, 8, 9, 7], 4) == [[8, 1, 8, 6], [8, 9, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 8, 6, 8, 9, 7], 4) == [[8, 1, 8, 6], [8, 9, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001679", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('bcd,e,\",b,\"') == ['bcd', 'e', ',b,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bcd,e,\",b,\"') == ['bcd', 'e', ',b,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001680", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 16) == 'qrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 16) == 'qrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001681", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 4, 1, 3, 4, 0, 2, 5, 3]) == [0, 4, 1, 3, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 1, 3, 4, 0, 2, 5, 3]) == [0, 4, 1, 3, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001682", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-31, 4, -20, 7, 6, 11, -38]) == 11\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-31, 4, -20, 7, 6, 11, -38]) == 11\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001683", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['xyx', '']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['xyx', '']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001684", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([14, 13, 21, 34]) == [13, 14, 21, 34]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 13, 21, 34]) == [13, 14, 21, 34]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001685", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(942) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(942) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001686", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('ffffadc gcadgh g caadc') == 'ffffadc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ffffadc gcadgh g caadc') == 'ffffadc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001687", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('bbcde dec ec') == 'Bbcde Dec Ec'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bbcde dec ec') == 'Bbcde Dec Ec'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001688", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-9, 4], [-2, 4], [9, -8]], [[0, 6], [3, 0], [-1, -1]]) == [[-9, 10], [1, 4], [8, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 4], [-2, 4], [9, -8]], [[0, 6], [3, 0], [-1, -1]]) == [[-9, 10], [1, 4], [8, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001689", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aabbbaaaacccc') == 'a2b3a4c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aabbbaaaacccc') == 'a2b3a4c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001690", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 0, 4, 2, 1]) == [2, 0, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 0, 4, 2, 1]) == [2, 0, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001691", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([5, 7, 5, 7, 3, 1, 9, 2, 4, 6, 6], 3) == [[5, 7, 5], [7, 3, 1], [9, 2, 4], [6, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 7, 5, 7, 3, 1, 9, 2, 4, 6, 6], 3) == [[5, 7, 5], [7, 3, 1], [9, 2, 4], [6, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001692", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[1, 2], [4, 5], [9], [6, 8, 9, 5], [7, 3, 4]]) == [1, 2, 4, 5, 9, 6, 8, 9, 5, 7, 3, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 2], [4, 5], [9], [6, 8, 9, 5], [7, 3, 4]]) == [1, 2, 4, 5, 9, 6, 8, 9, 5, 7, 3, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001693", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello Hello', 23) == 'Ebiil Ebiil'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Hello', 23) == 'Ebiil Ebiil'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001694", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-40, -31, -4, -7, -19, 25, 16]) == 25\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-40, -31, -4, -7, -19, 25, 16]) == 25\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001695", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(18, 17) == 306\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(18, 17) == 306\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001696", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, 7, [7], [7, 0, 9, 6]]) == [8, 7, 7, 7, 0, 9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, 7, [7], [7, 0, 9, 6]]) == [8, 7, 7, 7, 0, 9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001697", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(81) == [3, 3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(81) == [3, 3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001698", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(2 * 1) + 20 - 13') == 9\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(2 * 1) + 20 - 13') == 9\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001699", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('6m47s') == 407\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('6m47s') == 407\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001700", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([49, 50, 5, 41]) == [5, 41, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([49, 50, 5, 41]) == [5, 41, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001701", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(77); s.push(95); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(77); s.push(95); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 95\nassert s.is_empty() == False\nassert s.pop() == 77\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001702", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(8441) == 91\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8441) == 91\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001703", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([21, 40, 37, 3, 15]) == [3, 15, 21, 37, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 40, 37, 3, 15]) == [3, 15, 21, 37, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001704", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('cbabba', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbabba', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001705", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(8, 3) == 512\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 3) == 512\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001706", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 19, 'e': 92, 'b': 38, 'a': 21, 'd': 35}) == {19: 'f', 92: 'e', 38: 'b', 21: 'a', 35: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 19, 'e': 92, 'b': 38, 'a': 21, 'd': 35}) == {19: 'f', 92: 'e', 38: 'b', 21: 'a', 35: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001707", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([1, 4, -7, 6, 6, -4, 9]) == [1, 5, -2, 4, 10, 6, 15]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, 4, -7, 6, 6, -4, 9]) == [1, 5, -2, 4, 10, 6, 15]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001708", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 3) == 'abc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001709", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('2h14m7s') == 8047\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h14m7s') == 8047\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001710", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(124)\nacc.deposit(268)\nacc.withdraw(177)\nacc.withdraw(533)\nassert acc.get_balance() == 392\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(124)\nacc.deposit(268)\nassert acc.get_balance() == 392\nacc.withdraw(177)\nassert acc.get_balance() == 215\nacc.withdraw(533)\nassert acc.get_balance() == 215\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001711", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([20, 25, 43, 9, 9, 34, 32, 35, 42, 18, 39, 47, 7]) == [7, 9, 9, 18, 20, 25, 32, 34, 35, 39, 42, 43, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([20, 25, 43, 9, 9, 34, 32, 35, 42, 18, 39, 47, 7]) == [7, 9, 9, 18, 20, 25, 32, 34, 35, 39, 42, 43, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001712", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(89); s.push(71); s.push(86)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(89); s.push(71); s.push(86)\nassert s.peek() == 86\nassert s.pop() == 86\nassert s.pop() == 71\nassert s.is_empty() == False\nassert s.pop() == 89\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001713", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('abbbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('abbbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001714", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCIX') == 209\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCIX') == 209\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001715", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(58); s.push(10); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(58); s.push(10); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 10\nassert s.is_empty() == False\nassert s.pop() == 58\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001716", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(960) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(960) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001717", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(171) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(171) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001718", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(1, 6) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 6) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001719", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'berry', 'banana']) == {'c': ['cherry'], 'b': ['berry', 'berry', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'berry', 'banana']) == {'c': ['cherry'], 'b': ['berry', 'berry', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001720", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[6, 9, 4], [2, 4, 4, 9], [6, 3, 2], 5, [5, 8]]) == [6, 9, 4, 2, 4, 4, 9, 6, 3, 2, 5, 5, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 9, 4], [2, 4, 4, 9], [6, 3, 2], 5, [5, 8]]) == [6, 9, 4, 2, 4, 4, 9, 6, 3, 2, 5, 5, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001721", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([16, 3, 27, 0, 3, 29, 16, 29]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 3, 27, 0, 3, 29, 16, 29]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001722", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('dhafchdf cbaf eafgaca hcfdfffg') == 'dhafchdf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dhafchdf cbaf eafgaca hcfdfffg') == 'dhafchdf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001723", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(9, 172, 337) == 158\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(9, 172, 337) == 158\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001724", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([34, 2, 6, 13, 28, 47, 21, 15, 18, 37]) == [2, 6, 13, 15, 18, 21, 28, 34, 37, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([34, 2, 6, 13, 28, 47, 21, 15, 18, 37]) == [2, 6, 13, 15, 18, 21, 28, 34, 37, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001725", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(4855) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4855) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001726", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(11) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(11) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001727", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(5186) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5186) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001728", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[0, 4, 1, 7], [9, 2], 6, 5, [8, 7]]) == [0, 4, 1, 7, 9, 2, 6, 5, 8, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 4, 1, 7], [9, 2], 6, 5, [8, 7]]) == [0, 4, 1, 7, 9, 2, 6, 5, 8, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001729", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(55, 20) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(55, 20) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001730", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([18], [13]) == [13, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([18], [13]) == [13, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001731", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=off; host=on; port=101; user=470') == {'mode': 'off', 'host': 'on', 'port': '101', 'user': '470'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=off; host=on; port=101; user=470') == {'mode': 'off', 'host': 'on', 'port': '101', 'user': '470'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001732", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 4, 3, 4, 3]) == [1, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 3, 4, 3]) == [1, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001733", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([2, 45, 41, 9, 40, 19, 23]) == [2, 9, 19, 23, 40, 41, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 45, 41, 9, 40, 19, 23]) == [2, 9, 19, 23, 40, 41, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001734", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([2, 28, 2, 11, 28, 28]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 28, 2, 11, 28, 28]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001735", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[5, -6, 5], [-2, -1, 7]], [[4, 2, -6], [3, 4, 9]]) == [[9, -4, -1], [1, 3, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, -6, 5], [-2, -1, 7]], [[4, 2, -6], [3, 4, 9]]) == [[9, -4, -1], [1, 3, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001736", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('dcngrvqbaec') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('dcngrvqbaec') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001737", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'b': 2, 'c': 5, 'e': 6, 'd': 8}, 5) == {'e': 6, 'd': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 2, 'c': 5, 'e': 6, 'd': 8}, 5) == {'e': 6, 'd': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001738", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=auto; user=on; port=767; mode=730') == {'path': 'auto', 'user': 'on', 'port': '767', 'mode': '730'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=auto; user=on; port=767; mode=730') == {'path': 'auto', 'user': 'on', 'port': '767', 'mode': '730'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001739", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 4, 1, 0, 1, 1, 3, 1]) == [4, 1, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 1, 0, 1, 1, 3, 1]) == [4, 1, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001740", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'c': 4, 'd': 0, 'a': 7}, 4) == {'a': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 4, 'd': 0, 'a': 7}, 4) == {'a': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001741", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([0, 5, 7, 7], 5) == [[0, 5, 7, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 5, 7, 7], 5) == [[0, 5, 7, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001742", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([12, 11, 13, 11]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 11, 13, 11]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001743", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([20, 11, 38, 10]) == [10, 11, 20, 38]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 11, 38, 10]) == [10, 11, 20, 38]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001744", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(5) == 'V'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(5) == 'V'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001745", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('bxaz') == 'zaxb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bxaz') == 'zaxb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001746", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([0, 6, 3, 6, 8, 9, 9, 5, 8], 1) == [8, 0, 6, 3, 6, 8, 9, 9, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 6, 3, 6, 8, 9, 9, 5, 8], 1) == [8, 0, 6, 3, 6, 8, 9, 9, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001747", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('cebcfc', 'cebcfca') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cebcfc', 'cebcfca') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001748", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([5, 0, 7, 3], [9, 4, 0, 7, 9, 4, 6, 3]) == [0, 7, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 0, 7, 3], [9, 4, 0, 7, 9, 4, 6, 3]) == [0, 7, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001749", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([8, 4, 45]) == [4, 8, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([8, 4, 45]) == [4, 8, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001750", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat! sun the! dog sat') == {'sat': 2, 'sun': 1, 'the': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat! sun the! dog sat') == {'sat': 2, 'sun': 1, 'the': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001751", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([28, 48, 31, 0, 37, 14, 34]) == [0, 14, 28, 31, 34, 37, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([28, 48, 31, 0, 37, 14, 34]) == [0, 14, 28, 31, 34, 37, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001752", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([5, 7, 7, 9, 6, 6], 2) == [[5, 7], [7, 9], [6, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 7, 7, 9, 6, 6], 2) == [[5, 7], [7, 9], [6, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001753", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CDVIII') == 408\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDVIII') == 408\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001754", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['a', 'e', 'c', 'b', 'a', 'e', 'c', 'd', 'b', 'd']) == {'a': 2, 'e': 2, 'c': 2, 'b': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'e', 'c', 'b', 'a', 'e', 'c', 'd', 'b', 'd']) == {'a': 2, 'e': 2, 'c': 2, 'b': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001755", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('dccebbebadade') == 'dceba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dccebbebadade') == 'dceba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001756", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(112) == 20\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(112) == 20\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001757", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(2, 7) == 128\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 7) == 128\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001758", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'date', 'coconut', 'cherry', 'date', 'cherry', 'apple']) == {'b': ['berry'], 'd': ['date', 'date'], 'c': ['coconut', 'cherry', 'cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'coconut', 'cherry', 'date', 'cherry', 'apple']) == {'b': ['berry'], 'd': ['date', 'date'], 'c': ['coconut', 'cherry', 'cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001759", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[2, -7, -2], [-7, -3, 4]], [[1, 2, 0], [-3, 4, -1]]) == [[3, -5, -2], [-10, 1, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -7, -2], [-7, -3, 4]], [[1, 2, 0], [-3, 4, -1]]) == [[3, -5, -2], [-10, 1, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001760", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([8]) == [8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([8]) == [8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001761", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ebeceebe') == 'ebc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebeceebe') == 'ebc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001762", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([0, 4, 8, 3, 5, 1, 8], 7) == [0, 4, 8, 3, 5, 1, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 4, 8, 3, 5, 1, 8], 7) == [0, 4, 8, 3, 5, 1, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001763", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([3, 0, 1, 9], 5) == [[3, 0, 1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 0, 1, 9], 5) == [[3, 0, 1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001764", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-14, -1]) == -15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, -1]) == -15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001765", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'banana', 'coconut', 'apple', 'apple']) == {'a': ['apple', 'apple', 'apple'], 'b': ['banana'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'banana', 'coconut', 'apple', 'apple']) == {'a': ['apple', 'apple', 'apple'], 'b': ['banana'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001766", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-9, 3, 9, 1]) == [-9, -6, 3, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-9, 3, 9, 1]) == [-9, -6, 3, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001767", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('babbbaaa', 'bbba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbbaaa', 'bbba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001768", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('zxxzaf') == 'fazxxz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zxxzaf') == 'fazxxz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001769", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 23) == 'xyz'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 23) == 'xyz'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001770", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(766) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(766) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001771", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Python Python', 14) == 'Dmhvcb Dmhvcb'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Python', 14) == 'Dmhvcb Dmhvcb'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001772", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(5, 3) == 15\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 3) == 15\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001773", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(196)\nacc.deposit(38)\nacc.withdraw(81)\nacc.withdraw(324)\nassert acc.get_balance() == 234\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(196)\nacc.deposit(38)\nassert acc.get_balance() == 234\nacc.withdraw(81)\nassert acc.get_balance() == 153\nacc.withdraw(324)\nassert acc.get_balance() == 153\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001774", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(490) == 'CDXC'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(490) == 'CDXC'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001775", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('40m') == 2400\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('40m') == 2400\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001776", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Sat Sat cat Ran dog sat') == {'sat': 3, 'cat': 1, 'ran': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat Sat cat Ran dog sat') == {'sat': 3, 'cat': 1, 'ran': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001777", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 7, 7, 7, 9, 8, 2, 3], [3, 3, 6, 9, 3, 6, 3, 6]) == [9, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 7, 7, 9, 8, 2, 3], [3, 3, 6, 9, 3, 6, 3, 6]) == [9, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001778", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'apple']) == {'c': ['coconut'], 'b': ['banana'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'apple']) == {'c': ['coconut'], 'b': ['banana'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001779", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'e', 'c', 'e']) == {'e': 3, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'c', 'e']) == {'e': 3, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001780", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 4, 7, 4], [0, 3, 4, 7, 5, 7]) == [4, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 4, 7, 4], [0, 3, 4, 7, 5, 7]) == [4, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001781", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h19m8s') == 4748\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h19m8s') == 4748\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001782", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([25, 26, 46, 40]) == [25, 26, 40, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([25, 26, 46, 40]) == [25, 26, 40, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001783", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(78); s.push(15); s.push(0)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(78); s.push(15); s.push(0)\nassert s.peek() == 0\nassert s.pop() == 0\nassert s.pop() == 15\nassert s.is_empty() == False\nassert s.pop() == 78\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001784", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([1, 6, 1, 1, 5, 1, 8], [5, 0, 5, 3]) == [5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 6, 1, 1, 5, 1, 8], [5, 0, 5, 3]) == [5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001785", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(29, 45) == 1305\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(29, 45) == 1305\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001786", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([0, 48, 17, 42]) == [0, 17, 42, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 48, 17, 42]) == [0, 17, 42, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001787", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(16, 31) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(16, 31) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001788", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'e', 'e', 'a', 'c']) == {'a': 2, 'e': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'e', 'e', 'a', 'c']) == {'a': 2, 'e': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001789", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([3, 7, 8, 8, 0, 8, 8, 3], 4) == [0, 8, 8, 3, 3, 7, 8, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 7, 8, 8, 0, 8, 8, 3], 4) == [0, 8, 8, 3, 3, 7, 8, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001790", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('Sat sat cat cat ran dog') == {'sat': 2, 'cat': 2, 'ran': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat sat cat cat ran dog') == {'sat': 2, 'cat': 2, 'ran': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001791", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([0, [2, 7, 1]]) == [0, 2, 7, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [2, 7, 1]]) == [0, 2, 7, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001792", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(45) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(45) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001793", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(2); s.push(2); s.push(93)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(2); s.push(2); s.push(93)\nassert s.peek() == 93\nassert s.pop() == 93\nassert s.pop() == 2\nassert s.is_empty() == False\nassert s.pop() == 2\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001794", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(40) == 8\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(40) == 8\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001795", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('bbbbbbbb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbbbbbbb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001796", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(42); s.push(29); s.push(69)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(42); s.push(29); s.push(69)\nassert s.peek() == 69\nassert s.pop() == 69\nassert s.pop() == 29\nassert s.is_empty() == False\nassert s.pop() == 42\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001797", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(98) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(98) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001798", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(161) == 98\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(161) == 98\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001799", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 2, 5, 2, 2, 5, 3]) == [2, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 5, 2, 2, 5, 3]) == [2, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001800", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-4, -8, -5, 8]) == -9\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-4, -8, -5, 8]) == -9\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001801", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('bahgbbcb ebgf bghghe hhh cecc') == 'bahgbbcb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bahgbbcb ebgf bghghe hhh cecc') == 'bahgbbcb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001802", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(7, 166, 202) == 131\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(7, 166, 202) == 131\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001803", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(80); s.push(84); s.push(40)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(80); s.push(84); s.push(40)\nassert s.peek() == 40\nassert s.pop() == 40\nassert s.pop() == 84\nassert s.is_empty() == False\nassert s.pop() == 80\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001804", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1738) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1738) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001805", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([28, 28, 16, 7, 28]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 28, 16, 7, 28]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001806", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([18, 26, 13, 7, 43]) == [7, 13, 18, 26, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 26, 13, 7, 43]) == [7, 13, 18, 26, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001807", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-19, 17, -2]) == -4\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-19, 17, -2]) == -4\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001808", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(8436) == 91\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8436) == 91\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001809", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 3, 5, 0, 5, 3, 1, 0]) == [2, 3, 5, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 5, 0, 5, 3, 1, 0]) == [2, 3, 5, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001810", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[0, 3], 9]) == [0, 3, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[0, 3], 9]) == [0, 3, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001811", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'd', 'a', 'e', 'a', 'a', 'b', 'e']) == {'d': 2, 'a': 3, 'e': 2, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'a', 'e', 'a', 'a', 'b', 'e']) == {'d': 2, 'a': 3, 'e': 2, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001812", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dddcabcc') == 'dcab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dddcabcc') == 'dcab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001813", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 2, 'e': 12, 'a': 94, 'd': 99}) == {2: 'b', 12: 'e', 94: 'a', 99: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 2, 'e': 12, 'a': 94, 'd': 99}) == {2: 'b', 12: 'e', 94: 'a', 99: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001814", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gebe hfcefh') == 'hfcefh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gebe hfcefh') == 'hfcefh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001815", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('{[]{}}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{[]{}}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001816", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([12, -30]) == 12\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([12, -30]) == 12\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001817", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 0, 9, 7, 4, 9, 4, 6, 8, 6, 5, 5], 3) == [[4, 0, 9], [7, 4, 9], [4, 6, 8], [6, 5, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 0, 9, 7, 4, 9, 4, 6, 8, 6, 5, 5], 3) == [[4, 0, 9], [7, 4, 9], [4, 6, 8], [6, 5, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001818", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=643; mode=728; user=off; path=on') == {'host': '643', 'mode': '728', 'user': 'off', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=643; mode=728; user=off; path=on') == {'host': '643', 'mode': '728', 'user': 'off', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001819", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([15, 32, 2, 19]) == [2, 15, 19, 32]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([15, 32, 2, 19]) == [2, 15, 19, 32]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001820", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[4, -9], [-3, 2], [-6, 3]], [[-9, -7], [-6, -7], [1, 5]]) == [[-5, -16], [-9, -5], [-5, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, -9], [-3, 2], [-6, 3]], [[-9, -7], [-6, -7], [1, 5]]) == [[-5, -16], [-9, -5], [-5, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001821", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(988391) == 994\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(988391) == 994\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001822", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[2, 7], [1, 9]]) == [[2, 1], [7, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 7], [1, 9]]) == [[2, 1], [7, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001823", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([13, 25, 15, 13, 24, 43, 22, 46, 24]) == [13, 13, 15, 22, 24, 24, 25, 43, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([13, 25, 15, 13, 24, 43, 22, 46, 24]) == [13, 13, 15, 22, 24, 24, 25, 43, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001824", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-1, -4, 4, 5, -6, -8]) == [-1, -5, -1, 4, -2, -10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-1, -4, 4, 5, -6, -8]) == [-1, -5, -1, 4, -2, -10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001825", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(44)\nacc.deposit(292)\nacc.withdraw(313)\nacc.withdraw(458)\nassert acc.get_balance() == 336\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(44)\nacc.deposit(292)\nassert acc.get_balance() == 336\nacc.withdraw(313)\nassert acc.get_balance() == 23\nacc.withdraw(458)\nassert acc.get_balance() == 23\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001826", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5, 3, 3], 6, [5, 4], [8], [8, 3, 2]]) == [5, 3, 3, 6, 5, 4, 8, 8, 3, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 3, 3], 6, [5, 4], [8], [8, 3, 2]]) == [5, 3, 3, 6, 5, 4, 8, 8, 3, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001827", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 1, 'w': 5, 'x': 5}, {'w': 5, 'y': 8, 'x': 3}) == {'z': 1, 'w': 10, 'x': 8, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1, 'w': 5, 'x': 5}, {'w': 5, 'y': 8, 'x': 3}) == {'z': 1, 'w': 10, 'x': 8, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001828", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(458164) == 676\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(458164) == 676\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001829", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ccabab') == 'cab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ccabab') == 'cab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001830", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('ecdc adcd bd dbbdbe') == 'Ecdc Adcd Bd Dbbdbe'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ecdc adcd bd dbbdbe') == 'Ecdc Adcd Bd Dbbdbe'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001831", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('cccccccccccccccccccbbb') == 'c19b3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccccccccccccccccbbb') == 'c19b3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001832", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([6, 9, 0, 3, 9, 2], [7, 9, 6]) == [6, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 0, 3, 9, 2], [7, 9, 6]) == [6, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001833", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['date', 'coconut', 'date', 'avocado']) == {'d': ['date', 'date'], 'c': ['coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'coconut', 'date', 'avocado']) == {'d': ['date', 'date'], 'c': ['coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001834", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['abxxy', 'abzyy', 'abyy']) == 'ab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abxxy', 'abzyy', 'abyy']) == 'ab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001835", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(15, 12) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(15, 12) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001836", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('babddeeedcd') == 'badec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('babddeeedcd') == 'badec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001837", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(15, 57) == 285\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(15, 57) == 285\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001838", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('ezhumzuaipkdtv') == 5\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ezhumzuaipkdtv') == 5\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001839", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(29, 169) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(29, 169) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001840", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('a abd acdd aadd') == 'A Abd Acdd Aadd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('a abd acdd aadd') == 'A Abd Acdd Aadd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001841", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('cccedad') == 'ceda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cccedad') == 'ceda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001842", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('bceae', 'aeecb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bceae', 'aeecb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001843", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(127, 95) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(127, 95) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001844", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 9, 7, 4, 1, 7], [9, 3, 9, 0, 5, 9]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 9, 7, 4, 1, 7], [9, 3, 9, 0, 5, 9]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001845", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([37, 27, 36]) == [27, 36, 37]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([37, 27, 36]) == [27, 36, 37]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001846", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat, ran The dog sat ran') == {'cat': 1, 'ran': 2, 'the': 1, 'dog': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat, ran The dog sat ran') == {'cat': 1, 'ran': 2, 'the': 1, 'dog': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001847", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(13, 54, 792) == 577\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(13, 54, 792) == 577\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001848", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaadddda') == 'a4d4a1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaadddda') == 'a4d4a1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001849", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat the Dog sun. ran Sat') == {'sat': 2, 'the': 1, 'dog': 1, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat the Dog sun. ran Sat') == {'sat': 2, 'the': 1, 'dog': 1, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001850", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([49, 38, 23, 17, 15, 23, 27, 39]) == [15, 17, 23, 23, 27, 38, 39, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([49, 38, 23, 17, 15, 23, 27, 39]) == [15, 17, 23, 23, 27, 38, 39, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001851", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'a', 'c', 'd']) == {'e': 1, 'a': 1, 'c': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'c', 'd']) == {'e': 1, 'a': 1, 'c': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001852", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('({}{})') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('({}{})') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001853", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(157, 64) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(157, 64) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001854", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(252823) == 502\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(252823) == 502\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001855", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[7, 9, 7, 7], [8, 9, 9], 9, 9, 3]) == [7, 9, 7, 7, 8, 9, 9, 9, 9, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 9, 7, 7], [8, 9, 9], 9, 9, 3]) == [7, 9, 7, 7, 8, 9, 9, 9, 9, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001856", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('cazzzzdxy') == 'yxdzzzzac'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cazzzzdxy') == 'yxdzzzzac'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001857", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['b', 'e', 'a', 'd', 'b', 'b']) == {'b': 3, 'e': 1, 'a': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'e', 'a', 'd', 'b', 'b']) == {'b': 3, 'e': 1, 'a': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001858", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 9, 0, 1, 5], 9) == [9, 0, 1, 5, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 9, 0, 1, 5], 9) == [9, 0, 1, 5, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001859", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 4, 5], [0, 3, 3], [4, 5, 1]], [[0, 5], [1, 1], [1, 3]]) == [[9, 24], [6, 12], [6, 28]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4, 5], [0, 3, 3], [4, 5, 1]], [[0, 5], [1, 1], [1, 3]]) == [[9, 24], [6, 12], [6, 28]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001860", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('LXXVII') == 77\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXXVII') == 77\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001861", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['d', 'e', 'b', 'a', 'd']) == {'d': 2, 'e': 1, 'b': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'b', 'a', 'd']) == {'d': 2, 'e': 1, 'b': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001862", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[7, 8, 8], 4]) == [7, 8, 8, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 8, 8], 4]) == [7, 8, 8, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001863", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([6, 9, [3, 0, 9]]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([6, 9, [3, 0, 9]]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001864", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([35, 22, 45, 40]) == [22, 35, 40, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 22, 45, 40]) == [22, 35, 40, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001865", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('user=on; port=448; mode=339; path=auto') == {'user': 'on', 'port': '448', 'mode': '339', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; port=448; mode=339; path=auto') == {'user': 'on', 'port': '448', 'mode': '339', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001866", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(63) == [3, 3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(63) == [3, 3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001867", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('fbabdec', 'aefbcdb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fbabdec', 'aefbcdb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001868", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('ee beacbb') == 'beacbb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ee beacbb') == 'beacbb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001869", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=off; path=637; mode=auto') == {'port': 'off', 'path': '637', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; path=637; mode=auto') == {'port': 'off', 'path': '637', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001870", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[9], [0]]]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[9], [0]]]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001871", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[[3, 9]]]) == [3, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[3, 9]]]) == [3, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001872", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(121) == 95\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(121) == 95\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001873", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 5, 2, 1, 5, 3, 5, 4]) == [1, 5, 2, 3, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 2, 1, 5, 3, 5, 4]) == [1, 5, 2, 3, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001874", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(8785) == 28\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8785) == 28\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001875", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cdecc', 'cdecca') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cdecc', 'cdecca') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001876", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([50, 11, 26, 19, 6]) == [6, 11, 19, 26, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([50, 11, 26, 19, 6]) == [6, 11, 19, 26, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001877", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'banana', 'berry', 'berry', 'apple']) == {'d': ['date'], 'b': ['banana', 'berry', 'berry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'banana', 'berry', 'berry', 'apple']) == {'d': ['date'], 'b': ['banana', 'berry', 'berry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001878", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'date', 'berry', 'berry', 'coconut', 'cherry']) == {'d': ['date', 'date'], 'b': ['berry', 'berry'], 'c': ['coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'date', 'berry', 'berry', 'coconut', 'cherry']) == {'d': ['date', 'date'], 'b': ['berry', 'berry'], 'c': ['coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001879", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([1, 42, 11, 17, 17, 34]) == [1, 11, 17, 17, 34, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 42, 11, 17, 17, 34]) == [1, 11, 17, 17, 34, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001880", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sun Ran sat cat') == {'sun': 1, 'ran': 1, 'sat': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun Ran sat cat') == {'sun': 1, 'ran': 1, 'sat': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001881", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'e': 8, 'a': 7}, 7) == {'e': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 8, 'a': 7}, 7) == {'e': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001882", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 3, 4, 1, 1]) == [4, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 3, 4, 1, 1]) == [4, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001883", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 7, 0, 9, 2], [2, 5, 8, 4, 1, 3, 4]) == [2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 0, 9, 2], [2, 5, 8, 4, 1, 3, 4]) == [2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001884", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('ecbef', 'cebfe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ecbef', 'cebfe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001885", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([11, 43, 37]) == [11, 37, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 43, 37]) == [11, 37, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001886", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'w': 3, 'x': 6}, {'z': 5}) == {'y': 6, 'w': 3, 'x': 6, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'w': 3, 'x': 6}, {'z': 5}) == {'y': 6, 'w': 3, 'x': 6, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001887", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[2, 1], [4, 5], [3, 3]], [[5, 5], [1, 0]]) == [[11, 10], [25, 20], [18, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 1], [4, 5], [3, 3]], [[5, 5], [1, 0]]) == [[11, 10], [25, 20], [18, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001888", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(213)\nacc.deposit(36)\nacc.withdraw(89)\nacc.withdraw(388)\nassert acc.get_balance() == 249\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(213)\nacc.deposit(36)\nassert acc.get_balance() == 249\nacc.withdraw(89)\nassert acc.get_balance() == 160\nacc.withdraw(388)\nassert acc.get_balance() == 160\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001889", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-28, -46, 23, -19, -20, -45, 17, 6, 33]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-28, -46, 23, -19, -20, -45, 17, 6, 33]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001890", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ceecacda') == 'cead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceecacda') == 'cead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001891", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'c': 39, 'b': 85, 'a': 80, 'd': 21}) == {39: 'c', 85: 'b', 80: 'a', 21: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 39, 'b': 85, 'a': 80, 'd': 21}) == {39: 'c', 85: 'b', 80: 'a', 21: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001892", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(3064) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3064) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001893", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 4, 5, 0, 2, 4]) == [2, 4, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 5, 0, 2, 4]) == [2, 4, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001894", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 8, 'c': 10, 'a': 5, 'e': 5}, 4) == {'d': 8, 'c': 10, 'a': 5, 'e': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 8, 'c': 10, 'a': 5, 'e': 5}, 4) == {'d': 8, 'c': 10, 'a': 5, 'e': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001895", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('World World', 11) == 'Hzcwo Hzcwo'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World World', 11) == 'Hzcwo Hzcwo'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001896", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(126) == [2, 3, 3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(126) == [2, 3, 3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001897", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(6712) == 81\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6712) == 81\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001898", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 10) == 'klm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 10) == 'klm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001899", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 0, 0, 1, 4, 5], [8, 8, 3, 1]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 0, 0, 1, 4, 5], [8, 8, 3, 1]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001900", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code', 3) == 'Frgh'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 3) == 'Frgh'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001901", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(1904) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1904) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001902", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('dabad', 'dabadb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dabad', 'dabadb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001903", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 1, 1, 2, 5, 0, 1, 0, 0]) == [5, 1, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 1, 2, 5, 0, 1, 0, 0]) == [5, 1, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001904", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran sat, sun ran the Cat cat') == {'ran': 2, 'sat': 1, 'sun': 1, 'the': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat, sun ran the Cat cat') == {'ran': 2, 'sat': 1, 'sun': 1, 'the': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001905", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(352)\nacc.deposit(155)\nacc.withdraw(328)\nacc.withdraw(588)\nassert acc.get_balance() == 507\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(352)\nacc.deposit(155)\nassert acc.get_balance() == 507\nacc.withdraw(328)\nassert acc.get_balance() == 179\nacc.withdraw(588)\nassert acc.get_balance() == 179\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001906", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(40); s.push(4); s.push(84)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(40); s.push(4); s.push(84)\nassert s.peek() == 84\nassert s.pop() == 84\nassert s.pop() == 4\nassert s.is_empty() == False\nassert s.pop() == 40\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001907", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(159, 196) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(159, 196) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001908", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(8, 16) == 16\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(8, 16) == 16\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001909", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([23, 44, 16]) == [16, 23, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([23, 44, 16]) == [16, 23, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001910", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(43); s.push(80); s.push(13)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(43); s.push(80); s.push(13)\nassert s.peek() == 13\nassert s.pop() == 13\nassert s.pop() == 80\nassert s.is_empty() == False\nassert s.pop() == 43\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001911", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(784) == 19\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(784) == 19\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001912", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('19 + 10 + 12') == 41\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19 + 10 + 12') == 41\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001913", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 34, 'b': 29, 'f': 69, 'a': 58}) == {34: 'e', 29: 'b', 69: 'f', 58: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 34, 'b': 29, 'f': 69, 'a': 58}) == {34: 'e', 29: 'b', 69: 'f', 58: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001914", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([37, 49, 28, 50, 11]) == [11, 28, 37, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([37, 49, 28, 50, 11]) == [11, 28, 37, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001915", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([5, 8]) == [5, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([5, 8]) == [5, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001916", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(407) == True\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(407) == True\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001917", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1669) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1669) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001918", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('World Hello', 24) == 'Umpjb Fcjjm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Hello', 24) == 'Umpjb Fcjjm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001919", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('bbcccy') == 'ycccbb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bbcccy') == 'ycccbb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001920", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([8, 6, 9, 6, 2, 3, 2], [8, 0, 6, 6, 9, 7]) == [8, 6, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 6, 9, 6, 2, 3, 2], [8, 0, 6, 6, 9, 7]) == [8, 6, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001921", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(890) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(890) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001922", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([7, 32, 55, 60, 67, 69, 76, 80, 81, 91], 32) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 32, 55, 60, 67, 69, 76, 80, 81, 91], 32) == 1\nassert binary_search([7, 32, 55, 60, 67, 69, 76, 80, 81, 91], 7) == 0\nassert binary_search([7, 32, 55, 60, 67, 69, 76, 80, 81, 91], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001923", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([29, 23, 17, 17, 21, 24, 21]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 23, 17, 17, 21, 24, 21]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001924", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([2, 4, 9, 5], 4) == [[2, 4, 9, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 4, 9, 5], 4) == [[2, 4, 9, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001925", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([26, 35, 5, 34, 2, 13, 15, 5, 23, 20, 20, 22]) == [2, 5, 5, 13, 15, 20, 20, 22, 23, 26, 34, 35]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([26, 35, 5, 34, 2, 13, 15, 5, 23, 20, 20, 22]) == [2, 5, 5, 13, 15, 20, 20, 22, 23, 26, 34, 35]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001926", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(99) == 25\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(99) == 25\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001927", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(9, 3) == 729\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 3) == 729\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001928", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0], 7, [2, 9, 9], 3]) == [0, 7, 2, 9, 9, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], 7, [2, 9, 9], 3]) == [0, 7, 2, 9, 9, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001929", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 2, 1, 1, 5, 5, 1]) == [5, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 1, 1, 5, 5, 1]) == [5, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001930", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([21, 25, 32, 6, 29, 39, 28, 7, 27, 12, 29, 22]) == [6, 7, 12, 21, 22, 25, 27, 28, 29, 29, 32, 39]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([21, 25, 32, 6, 29, 39, 28, 7, 27, 12, 29, 22]) == [6, 7, 12, 21, 22, 25, 27, 28, 29, 29, 32, 39]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001931", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(496)\nacc.deposit(284)\nacc.withdraw(478)\nacc.withdraw(895)\nassert acc.get_balance() == 780\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(496)\nacc.deposit(284)\nassert acc.get_balance() == 780\nacc.withdraw(478)\nassert acc.get_balance() == 302\nacc.withdraw(895)\nassert acc.get_balance() == 302\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001932", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('17,24') == ['17', '24']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('17,24') == ['17', '24']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001933", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(36, 58) == 1044\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(36, 58) == 1044\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001934", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([6, 49, 10, 47, 15, 41, 36, 46, 19]) == [6, 10, 15, 19, 36, 41, 46, 47, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([6, 49, 10, 47, 15, 41, 36, 46, 19]) == [6, 10, 15, 19, 36, 41, 46, 47, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001935", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCCXLIX') == 349\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXLIX') == 349\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001936", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(4, 24) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 24) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001937", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(134) == 'CXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(134) == 'CXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001938", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat, the! cat! the sat The') == {'sat': 2, 'the': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat, the! cat! the sat The') == {'sat': 2, 'the': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001939", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(58) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(58) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001940", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[6, 1, 3], 6, 2, [5, 8, 6], [1, 4]]) == [6, 1, 3, 6, 2, 5, 8, 6, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 1, 3], 6, 2, [5, 8, 6], [1, 4]]) == [6, 1, 3, 6, 2, 5, 8, 6, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001941", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(6639) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6639) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001942", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(144) == 23\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(144) == 23\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001943", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('de') == 'De'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('de') == 'De'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001944", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('ceeab', 'ceeaba') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ceeab', 'ceeaba') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001945", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CDLXXVII') == 477\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXXVII') == 477\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001946", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('dc,\"b,\"') == ['dc', 'b,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dc,\"b,\"') == ['dc', 'b,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001947", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(264) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(264) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001948", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('abc', 19) == 'tuv'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 19) == 'tuv'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001949", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h24m29s') == 15869\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h24m29s') == 15869\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001950", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(2165) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2165) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001951", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the, dog! cat, cat! sat. ran') == {'the': 1, 'dog': 1, 'cat': 2, 'sat': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the, dog! cat, cat! sat. ran') == {'the': 1, 'dog': 1, 'cat': 2, 'sat': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001952", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([9, -1, 2, -9, 1]) == [9, 8, 10, 1, 2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, -1, 2, -9, 1]) == [9, 8, 10, 1, 2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001953", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-7, -8], [3, -9], [-7, -2]], [[8, 0], [6, -1], [-8, 3]]) == [[1, -8], [9, -10], [-15, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, -8], [3, -9], [-7, -2]], [[8, 0], [6, -1], [-8, 3]]) == [[1, -8], [9, -10], [-15, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001954", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['avocado', 'apple', 'banana', 'apple', 'coconut']) == {'a': ['avocado', 'apple', 'apple'], 'b': ['banana'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'apple', 'banana', 'apple', 'coconut']) == {'a': ['avocado', 'apple', 'apple'], 'b': ['banana'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001955", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([26, 26, 25, 4, 8, 48, 28, 11]) == [4, 8, 11, 25, 26, 26, 28, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 26, 25, 4, 8, 48, 28, 11]) == [4, 8, 11, 25, 26, 26, 28, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001956", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 0, 3, 2, 1, 0, 2, 0, 5]) == [2, 0, 3, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 0, 3, 2, 1, 0, 2, 0, 5]) == [2, 0, 3, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001957", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cbacb', 'bcca') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbacb', 'bcca') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_001958", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-7, 5]) == [-7, -2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, 5]) == [-7, -2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001959", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-20, 7, -8, 5]) == -16\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, 7, -8, 5]) == -16\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001960", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([1, [8], 9, 4]) == [1, 8, 9, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [8], 9, 4]) == [1, 8, 9, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001961", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(962) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(962) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001962", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 5, 7, 4, 3, 2, 9, 3, 1], 1) == [1, 2, 5, 7, 4, 3, 2, 9, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 5, 7, 4, 3, 2, 9, 3, 1], 1) == [1, 2, 5, 7, 4, 3, 2, 9, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001963", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(47)\nacc.deposit(56)\nacc.withdraw(67)\nacc.withdraw(257)\nassert acc.get_balance() == 103\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(47)\nacc.deposit(56)\nassert acc.get_balance() == 103\nacc.withdraw(67)\nassert acc.get_balance() == 36\nacc.withdraw(257)\nassert acc.get_balance() == 36\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001964", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-15, 0, 0, -13, 10, 17]) == -1\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-15, 0, 0, -13, 10, 17]) == -1\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001965", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-7, 7, 5, -1, -4, -6, 0, -6]) == [-7, 0, 5, 4, 0, -6, -6, -12]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, 7, 5, -1, -4, -6, 0, -6]) == [-7, 0, 5, 4, 0, -6, -6, -12]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001966", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbaaaaaaaaacccccccccccccccbbbb') == 'b2a9c15b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbaaaaaaaaacccccccccccccccbbbb') == 'b2a9c15b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001967", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['c', 'd', 'e', 'e']) == {'c': 1, 'd': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'd', 'e', 'e']) == {'c': 1, 'd': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001968", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(434) == 'CDXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(434) == 'CDXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001969", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('de') == 'De'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('de') == 'De'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001970", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(28); s.push(18); s.push(99)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(28); s.push(18); s.push(99)\nassert s.peek() == 99\nassert s.pop() == 99\nassert s.pop() == 18\nassert s.is_empty() == False\nassert s.pop() == 28\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001971", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babaabaaa', 'abba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babaabaaa', 'abba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_001972", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'c': 5, 'e': 1, 'd': 6}, 3) == {'c': 5, 'd': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 5, 'e': 1, 'd': 6}, 3) == {'c': 5, 'd': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001973", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(24) == 10\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(24) == 10\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001974", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([42, 18, 32, 4, 9, 15, 35, 27]) == [4, 9, 15, 18, 27, 32, 35, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 18, 32, 4, 9, 15, 35, 27]) == [4, 9, 15, 18, 27, 32, 35, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001975", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'avocado', 'berry', 'apple', 'coconut', 'avocado']) == {'c': ['coconut', 'coconut'], 'a': ['avocado', 'apple', 'avocado'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'avocado', 'berry', 'apple', 'coconut', 'avocado']) == {'c': ['coconut', 'coconut'], 'a': ['avocado', 'apple', 'avocado'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001976", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(43) == [43]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(43) == [43]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001977", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(105) == 'CV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(105) == 'CV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001978", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(189)\nacc.deposit(91)\nacc.withdraw(254)\nacc.withdraw(435)\nassert acc.get_balance() == 280\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(189)\nacc.deposit(91)\nassert acc.get_balance() == 280\nacc.withdraw(254)\nassert acc.get_balance() == 26\nacc.withdraw(435)\nassert acc.get_balance() == 26\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001979", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbbbbbbbddddddbbbbbbaaa') == 'b9d6b6a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbddddddbbbbbbaaa') == 'b9d6b6a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001980", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 8, 'y': 5}, {'x': 3, 'y': 2}) == {'w': 8, 'y': 7, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 8, 'y': 5}, {'x': 3, 'y': 2}) == {'w': 8, 'y': 7, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001981", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'date', 'cherry', 'date']) == {'b': ['banana'], 'd': ['date', 'date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'date', 'cherry', 'date']) == {'b': ['banana'], 'd': ['date', 'date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001982", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 4, 0, 2, 5, 3]) == [4, 0, 2, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 0, 2, 5, 3]) == [4, 0, 2, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001983", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[2], 8, 8]) == [2, 8, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2], 8, 8]) == [2, 8, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001984", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-5, -5, 1], [-7, -7, 4], [9, -2, -9]], [[-7, -6, -1], [-9, 2, 8], [-5, -5, 7]]) == [[-12, -11, 0], [-16, -5, 12], [4, -7, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -5, 1], [-7, -7, 4], [9, -2, -9]], [[-7, -6, -1], [-9, 2, 8], [-5, -5, 7]]) == [[-12, -11, 0], [-16, -5, 12], [4, -7, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001985", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=946; host=301; user=383') == {'port': '946', 'host': '301', 'user': '383'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=946; host=301; user=383') == {'port': '946', 'host': '301', 'user': '383'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001986", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 2], [0, 5], [0, 2]], [[4, 4], [5, 1]]) == [[14, 6], [25, 5], [10, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2], [0, 5], [0, 2]], [[4, 4], [5, 1]]) == [[14, 6], [25, 5], [10, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001987", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 2, 1, 3]) == [3, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 2, 1, 3]) == [3, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001988", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(147)\nacc.deposit(105)\nacc.withdraw(105)\nacc.withdraw(253)\nassert acc.get_balance() == 252\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(147)\nacc.deposit(105)\nassert acc.get_balance() == 252\nacc.withdraw(105)\nassert acc.get_balance() == 147\nacc.withdraw(253)\nassert acc.get_balance() == 147\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001989", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(250) == 109\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(250) == 109\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001990", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[7, 2, 1], [2, 3, 4]]) == [[7, 2], [2, 3], [1, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 2, 1], [2, 3, 4]]) == [[7, 2], [2, 3], [1, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001991", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 4, 3, 5, 1]) == [2, 4, 3, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 3, 5, 1]) == [2, 4, 3, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001992", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(140)\nacc.deposit(264)\nacc.withdraw(149)\nacc.withdraw(426)\nassert acc.get_balance() == 404\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(140)\nacc.deposit(264)\nassert acc.get_balance() == 404\nacc.withdraw(149)\nassert acc.get_balance() == 255\nacc.withdraw(426)\nassert acc.get_balance() == 255\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_001993", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(40) == [2, 2, 2, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(40) == [2, 2, 2, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_001994", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([10, 14, 30, 32, 41, 47, 57], 32) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 14, 30, 32, 41, 47, 57], 32) == 3\nassert binary_search([10, 14, 30, 32, 41, 47, 57], 10) == 0\nassert binary_search([10, 14, 30, 32, 41, 47, 57], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001995", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bacaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bacaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001996", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('}}{(){[b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}}{(){[b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001997", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(123281) == 351\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(123281) == 351\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_001998", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=547; path=574; mode=on; port=845') == {'user': '547', 'path': '574', 'mode': 'on', 'port': '845'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=547; path=574; mode=on; port=845') == {'user': '547', 'path': '574', 'mode': 'on', 'port': '845'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_001999", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 9, 5, 9], [2, 0, 7, 9, 8, 5, 0]) == [9, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 9, 5, 9], [2, 0, 7, 9, 8, 5, 0]) == [9, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002000", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(149) == 941\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(149) == 941\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002001", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('ab dea ddaa ee') == 'Ab Dea Ddaa Ee'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ab dea ddaa ee') == 'Ab Dea Ddaa Ee'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002002", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('adcbeeacdccec') == 'adcbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adcbeeacdccec') == 'adcbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002003", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1085) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1085) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002004", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, -8, 8], [-1, -4, -2], [4, 4, 6]], [[-7, 8, -2], [-8, 2, 2], [-9, -2, 9]]) == [[-1, 0, 6], [-9, -2, 0], [-5, 2, 15]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -8, 8], [-1, -4, -2], [4, 4, 6]], [[-7, 8, -2], [-8, 2, 2], [-9, -2, 9]]) == [[-1, 0, 6], [-9, -2, 0], [-5, 2, 15]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002005", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 9}, {'w': 4, 'y': 8}) == {'y': 17, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9}, {'w': 4, 'y': 8}) == {'y': 17, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002006", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([37, 17, 12, 14, 14, 42]) == [12, 14, 14, 17, 37, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([37, 17, 12, 14, 14, 42]) == [12, 14, 14, 17, 37, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002007", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(120) == [2, 2, 2, 3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(120) == [2, 2, 2, 3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002008", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(306) == [2, 3, 3, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(306) == [2, 3, 3, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002009", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 3, 4, 0, 2, 4]) == [0, 3, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 3, 4, 0, 2, 4]) == [0, 3, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002010", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 4}, {'x': 1, 'y': 2}) == {'x': 5, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4}, {'x': 1, 'y': 2}) == {'x': 5, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002011", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([7, 16, 20, 16, 21, 21]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 16, 20, 16, 21, 21]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002012", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'date', 'cherry', 'apple']) == {'c': ['coconut', 'cherry'], 'b': ['berry'], 'd': ['date'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'date', 'cherry', 'apple']) == {'c': ['coconut', 'cherry'], 'b': ['berry'], 'd': ['date'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002013", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('caaccccaac') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caaccccaac') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002014", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-49, -36, -34, -12, 46, -28, -48]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-49, -36, -34, -12, 46, -28, -48]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002015", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 6) == 'def'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 6) == 'def'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002016", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 32, 'a': 20, 'b': 79, 'e': 88}) == {32: 'f', 20: 'a', 79: 'b', 88: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 32, 'a': 20, 'b': 79, 'e': 88}) == {32: 'f', 20: 'a', 79: 'b', 88: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002017", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('cat sat sat sat! dog. dog, sun') == {'cat': 1, 'sat': 3, 'dog': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sat sat sat! dog. dog, sun') == {'cat': 1, 'sat': 3, 'dog': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002018", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 3, 3, 4, 1, 5]) == [1, 3, 4, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 3, 4, 1, 5]) == [1, 3, 4, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002019", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baabbababbaab', 'aa') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabbababbaab', 'aa') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002020", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([9, 9]) == 18\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9, 9]) == 18\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002021", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(161) == 'CLXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(161) == 'CLXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002022", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([5, 5]) == 10\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([5, 5]) == 10\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002023", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 6, 'w': 8, 'y': 4}, {'y': 2}) == {'x': 6, 'w': 8, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 6, 'w': 8, 'y': 4}, {'y': 2}) == {'x': 6, 'w': 8, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002024", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 1, 4, 1, 2, 2, 3], 2) == [[6, 1], [4, 1], [2, 2], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 1, 4, 1, 2, 2, 3], 2) == [[6, 1], [4, 1], [2, 2], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002025", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([48, 20, 24, 33, 10, 44, 36, 42, 40, 37]) == [10, 20, 24, 33, 36, 37, 40, 42, 44, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([48, 20, 24, 33, 10, 44, 36, 42, 40, 37]) == [10, 20, 24, 33, 36, 37, 40, 42, 44, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002026", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CLI') == 151\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLI') == 151\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002027", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(5385) == 5835\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5385) == 5835\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002028", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'coconut']) == {'c': ['coconut', 'coconut'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'coconut']) == {'c': ['coconut', 'coconut'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002029", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('a,caeb,63,11') == ['a', 'caeb', '63', '11']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('a,caeb,63,11') == ['a', 'caeb', '63', '11']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002030", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('31m31s') == 1891\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('31m31s') == 1891\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002031", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([10, 7, 16]) == [7, 10, 16]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 7, 16]) == [7, 10, 16]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002032", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([37, 75, 76], 174) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([37, 75, 76], 174) == -1\nassert binary_search([37, 75, 76], 37) == 0\nassert binary_search([37, 75, 76], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002033", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([19, 19, 9, 9, 10]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([19, 19, 9, 9, 10]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002034", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([1, [8, 6, 6, 6], 4, [7, 7, 3, 5]]) == [1, 8, 6, 6, 6, 4, 7, 7, 3, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [8, 6, 6, 6], 4, [7, 7, 3, 5]]) == [1, 8, 6, 6, 6, 4, 7, 7, 3, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002035", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([3, 3]) == [3, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, 3]) == [3, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002036", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 10, 'e': 21, 'b': 81, 'c': 94}) == {10: 'f', 21: 'e', 81: 'b', 94: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 10, 'e': 21, 'b': 81, 'c': 94}) == {10: 'f', 21: 'e', 81: 'b', 94: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002037", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(41) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(41) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002038", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([7, 43, 42, 31, 9, 49, 40, 40]) == [7, 9, 31, 40, 40, 42, 43, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 43, 42, 31, 9, 49, 40, 40]) == [7, 9, 31, 40, 40, 42, 43, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002039", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(2236) == 47\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2236) == 47\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002040", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([20, 5, 39, 21, 31]) == [5, 20, 21, 31, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 5, 39, 21, 31]) == [5, 20, 21, 31, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002041", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([19, 19, 15, 28, 3, 3]) == [3, 3, 15, 19, 19, 28]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([19, 19, 15, 28, 3, 3]) == [3, 3, 15, 19, 19, 28]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002042", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 3], [0, 2], [0, 1]], [[3, 0], [1, 1]]) == [[6, 3], [2, 2], [1, 1]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 3], [0, 2], [0, 1]], [[3, 0], [1, 1]]) == [[6, 3], [2, 2], [1, 1]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002043", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([25, 11, 11, 17, 8, 25, 15, 26, 26]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 11, 11, 17, 8, 25, 15, 26, 26]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002044", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bdababde') == 'bdae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bdababde') == 'bdae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002045", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 7, 2, 5], 5) == [[4, 7, 2, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 7, 2, 5], 5) == [[4, 7, 2, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002046", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 3, 3, 0, 2, 2]) == [5, 3, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 3, 3, 0, 2, 2]) == [5, 3, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002047", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(243) == [3, 3, 3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(243) == [3, 3, 3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002048", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 4, 6, 8, 11, 12, 20], [0, 6, 13, 13, 20]) == [0, 1, 4, 6, 6, 8, 11, 12, 13, 13, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 4, 6, 8, 11, 12, 20], [0, 6, 13, 13, 20]) == [0, 1, 4, 6, 6, 8, 11, 12, 13, 13, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002049", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([7, -10]) == -3\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([7, -10]) == -3\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002050", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 4, 5, 3, 1, 0, 5, 4]) == [2, 4, 5, 3, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 5, 3, 1, 0, 5, 4]) == [2, 4, 5, 3, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002051", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('abc', 10) == 'klm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 10) == 'klm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002052", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([5, 16, 10, 29, 29, 0]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 16, 10, 29, 29, 0]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002053", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 70, 'b': 49}) == {70: 'e', 49: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 70, 'b': 49}) == {70: 'e', 49: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002054", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([44, 13, 21, 29, 38]) == [13, 21, 29, 38, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 13, 21, 29, 38]) == [13, 21, 29, 38, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002055", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('bbbbbcccaaabbbbbb') == 'b5c3a3b6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbcccaaabbbbbb') == 'b5c3a3b6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002056", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([11, 1, 46, 29, 36]) == [1, 11, 29, 36, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([11, 1, 46, 29, 36]) == [1, 11, 29, 36, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002057", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([0, 29, 12, 0, 3, 3, 19]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 29, 12, 0, 3, 3, 19]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002058", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([9, 8, 6, [2, 6, 7], [6, 9, 5, 8]]) == [9, 8, 6, 2, 6, 7, 6, 9, 5, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 8, 6, [2, 6, 7], [6, 9, 5, 8]]) == [9, 8, 6, 2, 6, 7, 6, 9, 5, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002059", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([16, 24, 16, 20]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 24, 16, 20]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002060", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('dbf') == 'fbd'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('dbf') == 'fbd'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002061", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([4, [0, 5, 8]]) == [4, 0, 5, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [0, 5, 8]]) == [4, 0, 5, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002062", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Hello World', 1) == 'Ifmmp Xpsme'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello World', 1) == 'Ifmmp Xpsme'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002063", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('ccaccacc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccaccacc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002064", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aaaaaabaaaba', 'bbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaaabaaaba', 'bbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002065", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('ba)}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('ba)}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002066", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('ggbhgb ceea aaggefc fahhacfg') == 'fahhacfg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ggbhgb ceea aaggefc fahhacfg') == 'fahhacfg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002067", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(188) == [2, 2, 47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(188) == [2, 2, 47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002068", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'b', 'd', 'd', 'c', 'b', 'c', 'b']) == {'a': 1, 'b': 3, 'd': 2, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'd', 'd', 'c', 'b', 'c', 'b']) == {'a': 1, 'b': 3, 'd': 2, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002069", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 3, 6, 3], 3) == [3, 6, 3, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 3, 6, 3], 3) == [3, 6, 3, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002070", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'w': 7, 'y': 8}, {'w': 1}) == {'z': 2, 'w': 8, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'w': 7, 'y': 8}, {'w': 1}) == {'z': 2, 'w': 8, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002071", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'c': 0, 'e': 4, 'd': 0, 'b': 5}, 4) == {'b': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 0, 'e': 4, 'd': 0, 'b': 5}, 4) == {'b': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002072", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('eecbe cbe db bcacb') == 'Eecbe Cbe Db Bcacb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eecbe cbe db bcacb') == 'Eecbe Cbe Db Bcacb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002073", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('LV') == 55\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LV') == 55\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002074", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'apple', 'apple', 'avocado', 'coconut', 'avocado', 'cherry']) == {'c': ['cherry', 'coconut', 'cherry'], 'a': ['avocado', 'apple', 'apple', 'avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'apple', 'apple', 'avocado', 'coconut', 'avocado', 'cherry']) == {'c': ['cherry', 'coconut', 'cherry'], 'a': ['avocado', 'apple', 'apple', 'avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002075", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(2687) == 51\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2687) == 51\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002076", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([27, 46, 28, 5, 7]) == [5, 7, 27, 28, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 46, 28, 5, 7]) == [5, 7, 27, 28, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002077", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(2, 11) == 22\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(2, 11) == 22\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002078", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([9, 25, 14, 7, 5, 21]) == [5, 7, 9, 14, 21, 25]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 25, 14, 7, 5, 21]) == [5, 7, 9, 14, 21, 25]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002079", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(5, 50) == 50\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 50) == 50\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002080", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(4, 8) == 65536\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 8) == 65536\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002081", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(900) == 9\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(900) == 9\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002082", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'y': 4}) == {'z': 7, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'y': 4}) == {'z': 7, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002083", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(28) == 18\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(28) == 18\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002084", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['a', 'ax', 'azxz']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['a', 'ax', 'azxz']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002085", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 4, 4, 0, 3]) == [0, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 4, 0, 3]) == [0, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002086", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(303) == 42\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(303) == 42\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002087", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(203)\nacc.deposit(158)\nacc.withdraw(268)\nacc.withdraw(540)\nassert acc.get_balance() == 361\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(203)\nacc.deposit(158)\nassert acc.get_balance() == 361\nacc.withdraw(268)\nassert acc.get_balance() == 93\nacc.withdraw(540)\nassert acc.get_balance() == 93\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002088", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('abbba ebbebb ac debbae') == 'Abbba Ebbebb Ac Debbae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abbba ebbebb ac debbae') == 'Abbba Ebbebb Ac Debbae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002089", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(78); s.push(43); s.push(67)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(78); s.push(43); s.push(67)\nassert s.peek() == 67\nassert s.pop() == 67\nassert s.pop() == 43\nassert s.is_empty() == False\nassert s.pop() == 78\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002090", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 4, 2, 5]) == [4, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 2, 5]) == [4, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002091", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 22) == 'tuv'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 22) == 'tuv'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002092", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ddddadddaaa') == 'd4a1d3a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddadddaaa') == 'd4a1d3a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002093", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([2, [[9, 1], [2, 9, 2], 5], [3, 0]]) == [2, 9, 1, 2, 9, 2, 5, 3, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([2, [[9, 1], [2, 9, 2], 5], [3, 0]]) == [2, 9, 1, 2, 9, 2, 5, 3, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002094", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[6, 0], [3], [9, 5, 8]]) == [6, 0, 3, 9, 5, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 0], [3], [9, 5, 8]]) == [6, 0, 3, 9, 5, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002095", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[7, 6, 4], [4, 2, 7], [1, 0, 9]]) == [[7, 4, 1], [6, 2, 0], [4, 7, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 6, 4], [4, 2, 7], [1, 0, 9]]) == [[7, 4, 1], [6, 2, 0], [4, 7, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002096", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2634) == 'MMDCXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2634) == 'MMDCXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002097", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-9, 8], [3, -2], [-1, 7]], [[7, 0], [0, -8], [-8, -9]]) == [[-2, 8], [3, -10], [-9, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 8], [3, -2], [-1, 7]], [[7, 0], [0, -8], [-8, -9]]) == [[-2, 8], [3, -10], [-9, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002098", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(242)\nacc.deposit(17)\nacc.withdraw(20)\nacc.withdraw(383)\nassert acc.get_balance() == 259\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(242)\nacc.deposit(17)\nassert acc.get_balance() == 259\nacc.withdraw(20)\nassert acc.get_balance() == 239\nacc.withdraw(383)\nassert acc.get_balance() == 239\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002099", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(37, 72, 811) == 797\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(37, 72, 811) == 797\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002100", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('adeeb') == 'Adeeb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('adeeb') == 'Adeeb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002101", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(75) == [3, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(75) == [3, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002102", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=auto; port=on') == {'user': 'auto', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; port=on') == {'user': 'auto', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002103", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['acbzx', 'acb']) == 'acb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acbzx', 'acb']) == 'acb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002104", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[7, 5, 2], [1, 9]]) == [7, 5, 2, 1, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 5, 2], [1, 9]]) == [7, 5, 2, 1, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002105", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('acaa,\"a,\",aa,b,83') == ['acaa', 'a,', 'aa', 'b', '83']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('acaa,\"a,\",aa,b,83') == ['acaa', 'a,', 'aa', 'b', '83']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002106", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'avocado', 'berry', 'cherry']) == {'b': ['berry', 'berry'], 'c': ['coconut', 'cherry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'avocado', 'berry', 'cherry']) == {'b': ['berry', 'berry'], 'c': ['coconut', 'cherry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002107", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=651; user=234; port=auto; path=on') == {'mode': '651', 'user': '234', 'port': 'auto', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=651; user=234; port=auto; path=on') == {'mode': '651', 'user': '234', 'port': 'auto', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002108", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('czccxa') == 'axcczc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('czccxa') == 'axcczc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002109", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello Hello', 18) == 'Zwddg Zwddg'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Hello', 18) == 'Zwddg Zwddg'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002110", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0, 4, 0, 6], 2, 3, 0]) == [0, 4, 0, 6, 2, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 4, 0, 6], 2, 3, 0]) == [0, 4, 0, 6, 2, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002111", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 84, 'a': 54, 'd': 1, 'c': 80}) == {84: 'f', 54: 'a', 1: 'd', 80: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 84, 'a': 54, 'd': 1, 'c': 80}) == {84: 'f', 54: 'a', 1: 'd', 80: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002112", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([3, 54, 57, 75, 76, 82], 117) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 54, 57, 75, 76, 82], 117) == -1\nassert binary_search([3, 54, 57, 75, 76, 82], 3) == 0\nassert binary_search([3, 54, 57, 75, 76, 82], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002113", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(4, 6) == 4096\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 6) == 4096\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002114", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aaabaaaaa', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabaaaaa', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002115", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('fkunitbz') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('fkunitbz') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002116", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the the, the! Sat the sat,') == {'the': 4, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the, the! Sat the sat,') == {'the': 4, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002117", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([28, 24, 42, 19, 3, 30, 4, 42]) == [3, 4, 19, 24, 28, 30, 42, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([28, 24, 42, 19, 3, 30, 4, 42]) == [3, 4, 19, 24, 28, 30, 42, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002118", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 6, 4, 9, 9, 7, 0, 0], 5) == [[6, 6, 4, 9, 9], [7, 0, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 6, 4, 9, 9, 7, 0, 0], 5) == [[6, 6, 4, 9, 9], [7, 0, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002119", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 2, 'b': 0, 'a': 7}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 2, 'b': 0, 'a': 7}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002120", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1824) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1824) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002121", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 4) == 'bcd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 4) == 'bcd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002122", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 7, 4, 3, 6, 8], 2) == [[8, 7], [4, 3], [6, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 7, 4, 3, 6, 8], 2) == [[8, 7], [4, 3], [6, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002123", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(708268) == 841\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(708268) == 841\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002124", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=auto; mode=on; port=904; user=866') == {'host': 'auto', 'mode': 'on', 'port': '904', 'user': '866'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; mode=on; port=904; user=866') == {'host': 'auto', 'mode': 'on', 'port': '904', 'user': '866'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002125", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'apple', 'banana', 'banana']) == {'c': ['coconut'], 'b': ['banana', 'banana', 'banana'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'apple', 'banana', 'banana']) == {'c': ['coconut'], 'b': ['banana', 'banana', 'banana'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002126", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('exbcf') == 'fcbxe'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('exbcf') == 'fcbxe'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002127", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[1, 4, 8, 3], [2, 1, 2, 6], [4, 3, 7], [5, 9, 4, 9], [5, 4, 2, 2]]) == [1, 4, 8, 3, 2, 1, 2, 6, 4, 3, 7, 5, 9, 4, 9, 5, 4, 2, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 4, 8, 3], [2, 1, 2, 6], [4, 3, 7], [5, 9, 4, 9], [5, 4, 2, 2]]) == [1, 4, 8, 3, 2, 1, 2, 6, 4, 3, 7, 5, 9, 4, 9, 5, 4, 2, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002128", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(34, 54) == 918\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(34, 54) == 918\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002129", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('15,caa,\",a,\",ecd,ea') == ['15', 'caa', ',a,', 'ecd', 'ea']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('15,caa,\",a,\",ecd,ea') == ['15', 'caa', ',a,', 'ecd', 'ea']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002130", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('ccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002131", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(16); s.push(91); s.push(90)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(16); s.push(91); s.push(90)\nassert s.peek() == 90\nassert s.pop() == 90\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 16\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002132", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(47, 56) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(47, 56) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002133", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([44, 72, 84, 87], 103) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([44, 72, 84, 87], 103) == -1\nassert binary_search([44, 72, 84, 87], 44) == 0\nassert binary_search([44, 72, 84, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002134", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('decbadbadecac') == 'decba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('decbadbadecac') == 'decba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002135", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[([][])]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[([][])]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002136", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([7, 17, 28, 49, 50, 31, 39, 0, 4, 9]) == [0, 4, 7, 9, 17, 28, 31, 39, 49, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([7, 17, 28, 49, 50, 31, 39, 0, 4, 9]) == [0, 4, 7, 9, 17, 28, 31, 39, 49, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002137", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(78) == [2, 3, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(78) == [2, 3, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002138", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('54m55s') == 3295\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('54m55s') == 3295\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002139", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([50, 42, 40, 5]) == [5, 40, 42, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([50, 42, 40, 5]) == [5, 40, 42, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002140", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[2, 3], [2, 1]], [[5, 1, 1], [1, 0, 2]]) == [[13, 2, 8], [11, 2, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 3], [2, 1]], [[5, 1, 1], [1, 0, 2]]) == [[13, 2, 8], [11, 2, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002141", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([7, 45, 14, 47, 28, 1]) == [1, 7, 14, 28, 45, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 45, 14, 47, 28, 1]) == [1, 7, 14, 28, 45, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002142", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbbacbabba', 'aaab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbacbabba', 'aaab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002143", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 4, 1, 0, 5, 2]) == [2, 4, 1, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 1, 0, 5, 2]) == [2, 4, 1, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002144", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([23, 30, 23, 37, 44, 41]) == [23, 23, 30, 37, 41, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 30, 23, 37, 44, 41]) == [23, 23, 30, 37, 41, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002145", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(5699) == 29\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5699) == 29\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002146", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('eee', 'eeeb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('eee', 'eeeb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002147", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDLXVI') == 466\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXVI') == 466\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002148", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'apple', 'banana', 'berry']) == {'a': ['apple', 'apple'], 'b': ['banana', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'apple', 'banana', 'berry']) == {'a': ['apple', 'apple'], 'b': ['banana', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002149", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'z': 6}, {'x': 1, 'y': 5, 'w': 9}) == {'w': 15, 'z': 6, 'x': 1, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'z': 6}, {'x': 1, 'y': 5, 'w': 9}) == {'w': 15, 'z': 6, 'x': 1, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002150", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 2, 3, 1, 2, 5, 5, 3, 0, 1, 0]) == [5, 2, 3, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 3, 1, 2, 5, 5, 3, 0, 1, 0]) == [5, 2, 3, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002151", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 68, 'e': 50}) == {68: 'b', 50: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 68, 'e': 50}) == {68: 'b', 50: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002152", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([20, 26, 31, 74, 81, 98], 193) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([20, 26, 31, 74, 81, 98], 193) == -1\nassert binary_search([20, 26, 31, 74, 81, 98], 20) == 0\nassert binary_search([20, 26, 31, 74, 81, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002153", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('dec fhaadgh dfdfhef fhhbgfbd ag') == 'fhhbgfbd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dec fhaadgh dfdfhef fhhbgfbd ag') == 'fhhbgfbd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002154", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(274) == 91\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(274) == 91\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002155", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(310) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(310) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002156", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('cbbeeb dbacda da') == 'Cbbeeb Dbacda Da'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cbbeeb dbacda da') == 'Cbbeeb Dbacda Da'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002157", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[])]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[])]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002158", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(18) == 20\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(18) == 20\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002159", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1606) == 'MDCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1606) == 'MDCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002160", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([6, 4, 0, 9], [9, 4, 9, 7, 8, 3, 5]) == [4, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 4, 0, 9], [9, 4, 9, 7, 8, 3, 5]) == [4, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002161", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat. The ran! cat sun sun. dog,') == {'sat': 1, 'the': 1, 'ran': 1, 'cat': 1, 'sun': 2, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat. The ran! cat sun sun. dog,') == {'sat': 1, 'the': 1, 'ran': 1, 'cat': 1, 'sun': 2, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002162", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-1, 9, -1], [3, 8, 0]], [[6, 2, 1], [-1, 4, 2]]) == [[5, 11, 0], [2, 12, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, 9, -1], [3, 8, 0]], [[6, 2, 1], [-1, 4, 2]]) == [[5, 11, 0], [2, 12, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002163", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(2665) == 'MMDCLXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2665) == 'MMDCLXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002164", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dddaaacccccccccccbbbb') == 'd3a3c11b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddaaacccccccccccbbbb') == 'd3a3c11b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002165", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([14, -11, -10, -9]) == -16\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([14, -11, -10, -9]) == -16\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002166", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 3, 3, 1, 3, 2, 2, 7, 3, 3, 0, 8, 5, 7], 4) == [[2, 3, 3, 1], [3, 2, 2, 7], [3, 3, 0, 8], [5, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 3, 3, 1, 3, 2, 2, 7, 3, 3, 0, 8, 5, 7], 4) == [[2, 3, 3, 1], [3, 2, 2, 7], [3, 3, 0, 8], [5, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002167", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([4, [6, 8, 0], 1, 0, 5]) == [4, 6, 8, 0, 1, 0, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [6, 8, 0], 1, 0, 5]) == [4, 6, 8, 0, 1, 0, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002168", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([9, 20, 44, 33, 4, 7]) == [4, 7, 9, 20, 33, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([9, 20, 44, 33, 4, 7]) == [4, 7, 9, 20, 33, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002169", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 5, 4, 5, 6, 9, 3, 1, 4], 9) == [0, 5, 4, 5, 6, 9, 3, 1, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 5, 4, 5, 6, 9, 3, 1, 4], 9) == [0, 5, 4, 5, 6, 9, 3, 1, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002170", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(168, 172) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(168, 172) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002171", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'date', 'coconut', 'avocado']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'coconut'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'date', 'coconut', 'avocado']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'coconut'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002172", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([13, 1, 8, 3, 13, 20, 8]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 1, 8, 3, 13, 20, 8]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002173", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 2, 4, 15], [11, 14, 15]) == [0, 2, 4, 11, 14, 15, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 2, 4, 15], [11, 14, 15]) == [0, 2, 4, 11, 14, 15, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002174", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('()[]{}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()[]{}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002175", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(2 * 4 * 13)') == 104\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(2 * 4 * 13)') == 104\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002176", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bdead', 'dadeb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bdead', 'dadeb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002177", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('sdqhlcdclzbvf') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('sdqhlcdclzbvf') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002178", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(905) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(905) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002179", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('fbfc', 'fbfcf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fbfc', 'fbfcf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002180", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(53) == [53]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(53) == [53]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002181", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bcacxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcacxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002182", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbbbbba', 'baba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbbbba', 'baba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002183", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[2, 3, 8, 8], [2, 3, 9, 0], [8, 8, 3, 1]]) == [[2, 2, 8], [3, 3, 8], [8, 9, 3], [8, 0, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 3, 8, 8], [2, 3, 9, 0], [8, 8, 3, 1]]) == [[2, 2, 8], [3, 3, 8], [8, 9, 3], [8, 0, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002184", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([14, 9, 42, 20]) == [9, 14, 20, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([14, 9, 42, 20]) == [9, 14, 20, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002185", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 2, 5, 2]) == [0, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 5, 2]) == [0, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002186", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([26, 0, 2]) == [0, 2, 26]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 0, 2]) == [0, 2, 26]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002187", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(20 + (4 * 15))') == 80\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(20 + (4 * 15))') == 80\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002188", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([20, 0, 0, 27]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 0, 0, 27]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002189", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ywcpmqbsosp') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ywcpmqbsosp') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002190", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(457970) == 676\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(457970) == 676\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002191", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(28, 7) == 7\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 7) == 7\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002192", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(996227) == 998\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(996227) == 998\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002193", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(63); s.push(37); s.push(39)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(63); s.push(37); s.push(39)\nassert s.peek() == 39\nassert s.pop() == 39\nassert s.pop() == 37\nassert s.is_empty() == False\nassert s.pop() == 63\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002194", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('kmluwoegz') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('kmluwoegz') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002195", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-47, 30, 25, 33, 0, -22, -35]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-47, 30, 25, 33, 0, -22, -35]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002196", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-4, -4, -6, 16, 15]) == 17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-4, -4, -6, 16, 15]) == 17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002197", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3359) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3359) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002198", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 4], [2, 2]], [[0, 0], [1, 0]]) == [[4, 0], [2, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4], [2, 2]], [[0, 0], [1, 0]]) == [[4, 0], [2, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002199", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bcabxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcabxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002200", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([2, 6, 5, 1, 1, 9, 4, 9, 7, 4, 9, 3, 4], 2) == [[2, 6], [5, 1], [1, 9], [4, 9], [7, 4], [9, 3], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 6, 5, 1, 1, 9, 4, 9, 7, 4, 9, 3, 4], 2) == [[2, 6], [5, 1], [1, 9], [4, 9], [7, 4], [9, 3], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002201", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=608; mode=375; port=244') == {'host': '608', 'mode': '375', 'port': '244'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=608; mode=375; port=244') == {'host': '608', 'mode': '375', 'port': '244'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002202", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-4, -4, -6, 0], [-5, -7, 2, -3]], [[0, 2, -7, 1], [-6, 5, -7, -4]]) == [[-4, -2, -13, 1], [-11, -2, -5, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -4, -6, 0], [-5, -7, 2, -3]], [[0, 2, -7, 1], [-6, 5, -7, -4]]) == [[-4, -2, -13, 1], [-11, -2, -5, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002203", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[4, 7], [5, 5], [7, 6], [4, 9]]) == [[4, 5, 7, 4], [7, 5, 6, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 7], [5, 5], [7, 6], [4, 9]]) == [[4, 5, 7, 4], [7, 5, 6, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002204", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(36); s.push(6); s.push(48)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(36); s.push(6); s.push(48)\nassert s.peek() == 48\nassert s.pop() == 48\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 36\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002205", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(42) == 8\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(42) == 8\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002206", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(73); s.push(99); s.push(30)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(73); s.push(99); s.push(30)\nassert s.peek() == 30\nassert s.pop() == 30\nassert s.pop() == 99\nassert s.is_empty() == False\nassert s.pop() == 73\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002207", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([48, 45, 44, 21, 41, 9, 33, 4, 38, 42, 34, 15, 43, 32]) == [4, 9, 15, 21, 32, 33, 34, 38, 41, 42, 43, 44, 45, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([48, 45, 44, 21, 41, 9, 33, 4, 38, 42, 34, 15, 43, 32]) == [4, 9, 15, 21, 32, 33, 34, 38, 41, 42, 43, 44, 45, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002208", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([41, 8, 42]) == [8, 41, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 8, 42]) == [8, 41, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002209", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(976) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(976) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002210", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('4h33m32s') == 16412\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h33m32s') == 16412\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002211", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([0, 4, 8, 46, 54, 66, 84], 104) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 4, 8, 46, 54, 66, 84], 104) == -1\nassert binary_search([0, 4, 8, 46, 54, 66, 84], 0) == 0\nassert binary_search([0, 4, 8, 46, 54, 66, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002212", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Hello World', 2) == 'Jgnnq Yqtnf'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello World', 2) == 'Jgnnq Yqtnf'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002213", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 8) == 'fgh'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 8) == 'fgh'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002214", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 8, 'x': 1}, {'x': 7}) == {'y': 8, 'x': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8, 'x': 1}, {'x': 7}) == {'y': 8, 'x': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002215", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([1, -32]) == 1\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([1, -32]) == 1\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002216", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('suqucpdo') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('suqucpdo') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002217", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 7, 9], [6, 10, 15, 20]) == [0, 6, 7, 9, 10, 15, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 7, 9], [6, 10, 15, 20]) == [0, 6, 7, 9, 10, 15, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002218", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('c bbe') == 'C Bbe'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('c bbe') == 'C Bbe'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002219", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[2]]) == [2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2]]) == [2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002220", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran! the! ran sat Cat cat') == {'ran': 2, 'the': 1, 'sat': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! the! ran sat Cat cat') == {'ran': 2, 'the': 1, 'sat': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002221", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([6, 8, 17, 17], [13]) == [6, 8, 13, 17, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([6, 8, 17, 17], [13]) == [6, 8, 13, 17, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002222", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9237) == 96\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9237) == 96\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002223", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMCMXL') == 2940\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCMXL') == 2940\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002224", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-37, 39, -25, 23, -39]) == 39\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-37, 39, -25, 23, -39]) == 39\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002225", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bbccdebbb') == 'bcde'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbccdebbb') == 'bcde'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002226", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[5, 2, -3, 9], [-9, -2, -9, 3], [1, 4, -1, -6]], [[-9, -3, 3, -4], [9, -5, -8, -4], [6, 1, 5, 1]]) == [[-4, -1, 0, 5], [0, -7, -17, -1], [7, 5, 4, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 2, -3, 9], [-9, -2, -9, 3], [1, 4, -1, -6]], [[-9, -3, 3, -4], [9, -5, -8, -4], [6, 1, 5, 1]]) == [[-4, -1, 0, 5], [0, -7, -17, -1], [7, 5, 4, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002227", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(998) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(998) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002228", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(19 + 8) + (6 - 4)') == 29\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(19 + 8) + (6 - 4)') == 29\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002229", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('baceeb ag edgb e') == 'baceeb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('baceeb ag edgb e') == 'baceeb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002230", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran! The cat, cat') == {'ran': 1, 'the': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! The cat, cat') == {'ran': 1, 'the': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002231", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3626) == 'MMMDCXXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3626) == 'MMMDCXXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002232", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aaabbb', 'bb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabbb', 'bb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002233", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(9, 7) == 4782969\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 7) == 4782969\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002234", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(10, 19) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(10, 19) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002235", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3m47s') == 227\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3m47s') == 227\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002236", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=903; host=off') == {'port': '903', 'host': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=903; host=off') == {'port': '903', 'host': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002237", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(22) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(22) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002238", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('cbacbacbcaab', 'cba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbacbacbcaab', 'cba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002239", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens(')){}]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')){}]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002240", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 1, 'w': 6}, {'z': 6, 'x': 2, 'w': 5}) == {'z': 7, 'w': 11, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1, 'w': 6}, {'z': 6, 'x': 2, 'w': 5}) == {'z': 7, 'w': 11, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002241", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-5, -8, 1, 4, -9]) == [-5, -13, -12, -8, -17]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-5, -8, 1, 4, -9]) == [-5, -13, -12, -8, -17]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002242", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 5], [2, 2]], [[1, 3], [0, 3]]) == [[1, 18], [2, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5], [2, 2]], [[1, 3], [0, 3]]) == [[1, 18], [2, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002243", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('3 + (17 + 10)') == 30\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('3 + (17 + 10)') == 30\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002244", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 2, 4, 5]) == [5, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 4, 5]) == [5, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002245", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCLV') == 255\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLV') == 255\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002246", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[6, -4], [-8, -9], [8, -3]], [[5, -5], [-9, 9], [-1, 5]]) == [[11, -9], [-17, 0], [7, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -4], [-8, -9], [8, -3]], [[5, -5], [-9, 9], [-1, 5]]) == [[11, -9], [-17, 0], [7, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002247", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'cherry', 'apple', 'apple', 'cherry', 'date']) == {'c': ['cherry', 'cherry', 'cherry'], 'b': ['berry'], 'a': ['apple', 'apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'cherry', 'apple', 'apple', 'cherry', 'date']) == {'c': ['cherry', 'cherry', 'cherry'], 'b': ['berry'], 'a': ['apple', 'apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002248", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([24, 37, 20, 20]) == [20, 20, 24, 37]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([24, 37, 20, 20]) == [20, 20, 24, 37]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002249", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('daaaeb') == 'daeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daaaeb') == 'daeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002250", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[6, 4, 9], [8, 0, 2], [2, 2, 5], [8, 2, 2]]) == [[6, 8, 2, 8], [4, 0, 2, 2], [9, 2, 5, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 4, 9], [8, 0, 2], [2, 2, 5], [8, 2, 2]]) == [[6, 8, 2, 8], [4, 0, 2, 2], [9, 2, 5, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002251", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(9986) == 32\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9986) == 32\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002252", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 6, 1, 7, 6, 4], [5, 5, 4, 9, 6]) == [6, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 6, 1, 7, 6, 4], [5, 5, 4, 9, 6]) == [6, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002253", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 0, 5, 4, 4, 2, 4]) == [4, 0, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 0, 5, 4, 4, 2, 4]) == [4, 0, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002254", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[6, 3, 3], [3]]]) == 15\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[6, 3, 3], [3]]]) == 15\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002255", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(419) == 'CDXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(419) == 'CDXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002256", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(19, 131, 965) == 424\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 131, 965) == 424\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002257", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 8, 1, 1], [7, 6, 5, 4, 9]) == [5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 8, 1, 1], [7, 6, 5, 4, 9]) == [5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002258", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(430) == 102\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(430) == 102\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002259", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(318)\nacc.deposit(165)\nacc.withdraw(110)\nacc.withdraw(670)\nassert acc.get_balance() == 483\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(318)\nacc.deposit(165)\nassert acc.get_balance() == 483\nacc.withdraw(110)\nassert acc.get_balance() == 373\nacc.withdraw(670)\nassert acc.get_balance() == 373\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002260", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([9, [7, 9, 8], [0, 5, 5, 2], [5, 3, 7, 9], [4, 6, 6, 1]]) == [9, 7, 9, 8, 0, 5, 5, 2, 5, 3, 7, 9, 4, 6, 6, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [7, 9, 8], [0, 5, 5, 2], [5, 3, 7, 9], [4, 6, 6, 1]]) == [9, 7, 9, 8, 0, 5, 5, 2, 5, 3, 7, 9, 4, 6, 6, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002261", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[))(])[)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[))(])[)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002262", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([5]) == [5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([5]) == [5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002263", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(105) == [3, 5, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(105) == [3, 5, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002264", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('hdha fbebbba c bb aebeh fgc') == 'fbebbba'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hdha fbebbba c bb aebeh fgc') == 'fbebbba'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002265", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(20, 34, 331) == 21\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(20, 34, 331) == 21\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002266", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([47, 30, 22, 42, 11, 35]) == [11, 22, 30, 35, 42, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([47, 30, 22, 42, 11, 35]) == [11, 22, 30, 35, 42, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002267", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-9, 20, -4, 4]) == 11\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-9, 20, -4, 4]) == 11\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002268", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[4, 3], [-6, -6], [-7, -8], [0, 3]], [[6, -1], [5, -1], [-9, -2], [-4, 5]]) == [[10, 2], [-1, -7], [-16, -10], [-4, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, 3], [-6, -6], [-7, -8], [0, 3]], [[6, -1], [5, -1], [-9, -2], [-4, 5]]) == [[10, 2], [-1, -7], [-16, -10], [-4, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002269", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([20, -18]) == 2\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([20, -18]) == 2\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002270", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bcac') == 'bca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcac') == 'bca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002271", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(98); s.push(22); s.push(5)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(98); s.push(22); s.push(5)\nassert s.peek() == 5\nassert s.pop() == 5\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 98\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002272", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['aayxz', 'aa']) == 'aa'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['aayxz', 'aa']) == 'aa'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002273", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[4, 4], [0, 2]], [[2, 0, 2], [5, 5, 2]]) == [[28, 20, 16], [10, 10, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 4], [0, 2]], [[2, 0, 2], [5, 5, 2]]) == [[28, 20, 16], [10, 10, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002274", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([0, 10, 0, 10, 25]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 10, 0, 10, 25]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002275", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(2692) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2692) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002276", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(15); s.push(13); s.push(37)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(15); s.push(13); s.push(37)\nassert s.peek() == 37\nassert s.pop() == 37\nassert s.pop() == 13\nassert s.is_empty() == False\nassert s.pop() == 15\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002277", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=on; host=on; user=416; port=270') == {'mode': 'on', 'host': 'on', 'user': '416', 'port': '270'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; host=on; user=416; port=270') == {'mode': 'on', 'host': 'on', 'user': '416', 'port': '270'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002278", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('eaae', 'eeaa') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('eaae', 'eeaa') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002279", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([26, 13, 49, 29, 49, 29, 46, 36]) == [13, 26, 29, 29, 36, 46, 49, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([26, 13, 49, 29, 49, 29, 46, 36]) == [13, 26, 29, 29, 36, 46, 49, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002280", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MDCLXXXVII') == 1687\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDCLXXXVII') == 1687\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002281", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('eceb,de,\"aa,bb\"') == ['eceb', 'de', 'aa,bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('eceb,de,\"aa,bb\"') == ['eceb', 'de', 'aa,bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002282", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('ifnufhhxsdv') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ifnufhhxsdv') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002283", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(11, 104, 979) == 484\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(11, 104, 979) == 484\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002284", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(84) == 9\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(84) == 9\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002285", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ecdba') == 'ecdba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecdba') == 'ecdba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002286", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([28, 23, 0, 2, 5]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 23, 0, 2, 5]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002287", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('cbcaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbcaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002288", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[8, -1, 9], [7, -3, -6]], [[6, -9, 1], [8, 5, 3]]) == [[14, -10, 10], [15, 2, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -1, 9], [7, -3, -6]], [[6, -9, 1], [8, 5, 3]]) == [[14, -10, 10], [15, 2, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002289", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([40, 26, 26, 5, 34, 12, 24]) == [5, 12, 24, 26, 26, 34, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 26, 26, 5, 34, 12, 24]) == [5, 12, 24, 26, 26, 34, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002290", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('aee dace cebaea') == 'Aee Dace Cebaea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aee dace cebaea') == 'Aee Dace Cebaea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002291", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code Hello', 3) == 'Frgh Khoor'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Hello', 3) == 'Frgh Khoor'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002292", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, -4, 7, -6], [4, -2, -5, -1]], [[8, -5, 3, 6], [0, 9, 6, 9]]) == [[14, -9, 10, 0], [4, 7, 1, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -4, 7, -6], [4, -2, -5, -1]], [[8, -5, 3, 6], [0, 9, 6, 9]]) == [[14, -9, 10, 0], [4, 7, 1, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002293", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(418)\nacc.deposit(200)\nacc.withdraw(363)\nacc.withdraw(634)\nassert acc.get_balance() == 618\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(418)\nacc.deposit(200)\nassert acc.get_balance() == 618\nacc.withdraw(363)\nassert acc.get_balance() == 255\nacc.withdraw(634)\nassert acc.get_balance() == 255\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002294", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([10, 43, 17]) == [10, 17, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 43, 17]) == [10, 17, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_002295", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 2, 'b': 14, 'e': 81, 'f': 22}) == {2: 'c', 14: 'b', 81: 'e', 22: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 2, 'b': 14, 'e': 81, 'f': 22}) == {2: 'c', 14: 'b', 81: 'e', 22: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002296", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-43, 22, -19, -27, -30, 15, -29]) == 22\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-43, 22, -19, -27, -30, 15, -29]) == 22\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002297", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(4997) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4997) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002298", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(52, 26) == 26\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(52, 26) == 26\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002299", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(25) == 23\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(25) == 23\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002300", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(2); s.push(90); s.push(53)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(2); s.push(90); s.push(53)\nassert s.peek() == 53\nassert s.pop() == 53\nassert s.pop() == 90\nassert s.is_empty() == False\nassert s.pop() == 2\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002301", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([2, 43, 6, 46, 13, 34, 11]) == [2, 6, 11, 13, 34, 43, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([2, 43, 6, 46, 13, 34, 11]) == [2, 6, 11, 13, 34, 43, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002302", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'w': 6, 'y': 8}, {'w': 5}) == {'x': 9, 'w': 11, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'w': 6, 'y': 8}, {'w': 5}) == {'x': 9, 'w': 11, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002303", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['xy', '', 'x']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['xy', '', 'x']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002304", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[3, 4], [[2, 9], 4]]) == [3, 4, 2, 9, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[3, 4], [[2, 9], 4]]) == [3, 4, 2, 9, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002305", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'banana', 'berry', 'berry', 'cherry', 'berry', 'cherry']) == {'b': ['banana', 'banana', 'berry', 'berry', 'berry'], 'c': ['cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'banana', 'berry', 'berry', 'cherry', 'berry', 'cherry']) == {'b': ['banana', 'banana', 'berry', 'berry', 'berry'], 'c': ['cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002306", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(3838) == 22\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3838) == 22\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002307", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(5396) == 73\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5396) == 73\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002308", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(7, 31, 47) == 16\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(7, 31, 47) == 16\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002309", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bbaaaabb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbaaaabb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002310", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 8, 4, 8, 5, 7, 9, 9], 1) == [9, 8, 8, 4, 8, 5, 7, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 8, 4, 8, 5, 7, 9, 9], 1) == [9, 8, 8, 4, 8, 5, 7, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002311", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['acb', 'acb', 'acb', 'acb']) == 'acb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acb', 'acb', 'acb', 'acb']) == 'acb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002312", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([7, 9, 3, 2], [0, 3, 2]) == [3, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 9, 3, 2], [0, 3, 2]) == [3, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002313", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(58); s.push(57); s.push(82)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(58); s.push(57); s.push(82)\nassert s.peek() == 82\nassert s.pop() == 82\nassert s.pop() == 57\nassert s.is_empty() == False\nassert s.pop() == 58\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002314", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 5, 'w': 8, 'x': 5}, {'w': 1}) == {'y': 5, 'w': 9, 'x': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5, 'w': 8, 'x': 5}, {'w': 1}) == {'y': 5, 'w': 9, 'x': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002315", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 7, 'c': 0}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 7, 'c': 0}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002316", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-18, -3, 0, 0, 5]) == -16\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-18, -3, 0, 0, 5]) == -16\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002317", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([8, 31, 89], 171) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 31, 89], 171) == -1\nassert binary_search([8, 31, 89], 8) == 0\nassert binary_search([8, 31, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002318", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cebceabb') == 'ceba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cebceabb') == 'ceba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002319", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(6, 170, 29) == 7\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(6, 170, 29) == 7\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002320", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=on; host=867; port=735') == {'mode': 'on', 'host': '867', 'port': '735'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; host=867; port=735') == {'mode': 'on', 'host': '867', 'port': '735'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002321", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"b,,b\",\",b,\",1') == ['b,,b', ',b,', '1']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"b,,b\",\",b,\",1') == ['b,,b', ',b,', '1']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002322", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'date', 'banana', 'date', 'coconut', 'berry']) == {'a': ['avocado'], 'd': ['date', 'date'], 'b': ['banana', 'berry'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'banana', 'date', 'coconut', 'berry']) == {'a': ['avocado'], 'd': ['date', 'date'], 'b': ['banana', 'berry'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002323", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 57, 'c': 73}) == {57: 'f', 73: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 57, 'c': 73}) == {57: 'f', 73: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002324", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('caeaa') == 'cae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caeaa') == 'cae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002325", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cbeac') == 'cbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbeac') == 'cbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002326", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbbbbbbbbbdddddddbbbb') == 'b12d7b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbbbbdddddddbbbb') == 'b12d7b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002327", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([10, 42, 31, 40, 37, 9, 40]) == [9, 10, 31, 37, 40, 40, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 42, 31, 40, 37, 9, 40]) == [9, 10, 31, 37, 40, 40, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002328", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-16, 2, 13, 20, -16]) == 3\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-16, 2, 13, 20, -16]) == 3\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002329", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'d': 1, 'e': 7, 'b': 9, 'c': 1}, 6) == {'e': 7, 'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 1, 'e': 7, 'b': 9, 'c': 1}, 6) == {'e': 7, 'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002330", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[{)(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{)(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002331", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[4, 7, 6, 4], [8, 1], 8]) == [4, 7, 6, 4, 8, 1, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 7, 6, 4], [8, 1], 8]) == [4, 7, 6, 4, 8, 1, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002332", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([0, 35, 39, 34, 38, 30, 29, 31, 19, 15, 20, 43]) == [0, 15, 19, 20, 29, 30, 31, 34, 35, 38, 39, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([0, 35, 39, 34, 38, 30, 29, 31, 19, 15, 20, 43]) == [0, 15, 19, 20, 29, 30, 31, 34, 35, 38, 39, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002333", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(886587) == 941\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(886587) == 941\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002334", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(8563) == 92\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8563) == 92\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002335", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1040) == 401\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1040) == 401\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002336", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(5955) == 5595\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5955) == 5595\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002337", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(24) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(24) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002338", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[2, -7], [-1, -2], [-2, 6]], [[-4, 6], [9, 2], [7, 5]]) == [[-2, -1], [8, 0], [5, 11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -7], [-1, -2], [-2, 6]], [[-4, 6], [9, 2], [7, 5]]) == [[-2, -1], [8, 0], [5, 11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002339", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 0, 3, 0, 0], 2) == [0, 0, 0, 0, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 0, 3, 0, 0], 2) == [0, 0, 0, 0, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002340", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('faa') == 'aaf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('faa') == 'aaf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002341", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(16, 8) == 16\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 8) == 16\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002342", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([46, 0, 42, 34, 8]) == [0, 8, 34, 42, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 0, 42, 34, 8]) == [0, 8, 34, 42, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002343", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('bzdzezc') == 'czezdzb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bzdzezc') == 'czezdzb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002344", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([42, 35, 13, 12]) == [12, 13, 35, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 35, 13, 12]) == [12, 13, 35, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002345", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(19) == 91\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(19) == 91\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002346", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(13 * (12 + 14))') == 338\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(13 * (12 + 14))') == 338\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002347", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[3, 1, 1], [8, 9, 7], [8, 7, 1]]) == [[3, 8, 8], [1, 9, 7], [1, 7, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 1, 1], [8, 9, 7], [8, 7, 1]]) == [[3, 8, 8], [1, 9, 7], [1, 7, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002348", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 1, 4], [2, 2, 5]], [[2, 0, 3], [2, 5, 0], [4, 2, 2]]) == [[20, 13, 11], [28, 20, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 4], [2, 2, 5]], [[2, 0, 3], [2, 5, 0], [4, 2, 2]]) == [[20, 13, 11], [28, 20, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002349", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 92, 'd': 48, 'b': 86, 'a': 59}) == {92: 'e', 48: 'd', 86: 'b', 59: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 92, 'd': 48, 'b': 86, 'a': 59}) == {92: 'e', 48: 'd', 86: 'b', 59: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002350", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'apple', 'coconut']) == {'b': ['berry'], 'a': ['apple'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'apple', 'coconut']) == {'b': ['berry'], 'a': ['apple'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002351", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([50, 3, 15, 7, 25, 39, 11, 41, 2]) == [2, 3, 7, 11, 15, 25, 39, 41, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([50, 3, 15, 7, 25, 39, 11, 41, 2]) == [2, 3, 7, 11, 15, 25, 39, 41, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002352", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('4h59m7s') == 17947\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h59m7s') == 17947\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002353", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aaabbaaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaabbaaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002354", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[8, 3, 9, 9], [1, 2, 9, 0], [1, 9, 3, 7]]) == [[8, 1, 1], [3, 2, 9], [9, 9, 3], [9, 0, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 3, 9, 9], [1, 2, 9, 0], [1, 9, 3, 7]]) == [[8, 1, 1], [3, 2, 9], [9, 9, 3], [9, 0, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002355", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(1921) == 1291\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1921) == 1291\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002356", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(3) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(3) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002357", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 5, 3, 2, 3, 8], 5) == [[6, 5, 3, 2, 3], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 5, 3, 2, 3, 8], 5) == [[6, 5, 3, 2, 3], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002358", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([16, 50, 11, 2, 1, 45, 13, 13]) == [1, 2, 11, 13, 13, 16, 45, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([16, 50, 11, 2, 1, 45, 13, 13]) == [1, 2, 11, 13, 13, 16, 45, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002359", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(802) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(802) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002360", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['apple', 'berry', 'banana', 'avocado', 'date', 'date', 'apple']) == {'a': ['apple', 'avocado', 'apple'], 'b': ['berry', 'banana'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'berry', 'banana', 'avocado', 'date', 'date', 'apple']) == {'a': ['apple', 'avocado', 'apple'], 'b': ['berry', 'banana'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002361", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 7, 'y': 5}, {'x': 3, 'y': 8, 'z': 5}) == {'x': 10, 'y': 13, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7, 'y': 5}, {'x': 3, 'y': 8, 'z': 5}) == {'x': 10, 'y': 13, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002362", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(8361) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8361) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002363", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(16, 2) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(16, 2) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002364", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(737) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(737) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002365", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(529) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(529) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002366", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([43, 62, 69], 133) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([43, 62, 69], 133) == -1\nassert binary_search([43, 62, 69], 43) == 0\nassert binary_search([43, 62, 69], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002367", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(24)\nacc.deposit(69)\nacc.withdraw(55)\nacc.withdraw(147)\nassert acc.get_balance() == 93\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(24)\nacc.deposit(69)\nassert acc.get_balance() == 93\nacc.withdraw(55)\nassert acc.get_balance() == 38\nacc.withdraw(147)\nassert acc.get_balance() == 38\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002368", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([44, 0, 2, 22, 2, 9, 24, 17, 46]) == [0, 2, 2, 9, 17, 22, 24, 44, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([44, 0, 2, 22, 2, 9, 24, 17, 46]) == [0, 2, 2, 9, 17, 22, 24, 44, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002369", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bcbcbc', 'caac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcbcbc', 'caac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002370", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 2, 4], [2, 4, 1]], [[1, 0, 4], [2, 3, 4], [4, 5, 5]]) == [[21, 26, 32], [14, 17, 29]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2, 4], [2, 4, 1]], [[1, 0, 4], [2, 3, 4], [4, 5, 5]]) == [[21, 26, 32], [14, 17, 29]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002371", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran. sat sun cat dog cat dog!') == {'ran': 1, 'sat': 1, 'sun': 1, 'cat': 2, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran. sat sun cat dog cat dog!') == {'ran': 1, 'sat': 1, 'sun': 1, 'cat': 2, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002372", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(7 * 19) - (12 + 8)') == 113\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(7 * 19) - (12 + 8)') == 113\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002373", "instruction": "Implement fib_recursive(n): naive recursive Fibonacci.\n\nExample:\nassert fib_recursive(18) == 2584\n\nImplement exactly this signature: `def fib_recursive(n)`. The tests call it directly.", "tests": "assert fib_recursive(18) == 2584\nassert fib_recursive(0) == 0\nassert fib_recursive(10) == 55", "family": "fib_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002374", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(11); s.push(46); s.push(96)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(11); s.push(46); s.push(96)\nassert s.peek() == 96\nassert s.pop() == 96\nassert s.pop() == 46\nassert s.is_empty() == False\nassert s.pop() == 11\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002375", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bababbbaaab', 'aab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bababbbaaab', 'aab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002376", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 0, 0, 3, 3, 8, 0, 1], 2) == [[2, 0], [0, 3], [3, 8], [0, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 0, 0, 3, 3, 8, 0, 1], 2) == [[2, 0], [0, 3], [3, 8], [0, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002377", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([1, 18, 2, 14, 25, 25, 13]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 18, 2, 14, 25, 25, 13]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002378", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(301) == 103\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(301) == 103\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002379", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=678; user=662; mode=off; port=805') == {'path': '678', 'user': '662', 'mode': 'off', 'port': '805'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=678; user=662; mode=off; port=805') == {'path': '678', 'user': '662', 'mode': 'off', 'port': '805'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002380", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[3, 1], [4, -1], [8, 3]], [[8, 0], [3, 5], [-3, -2]]) == [[11, 1], [7, 4], [5, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, 1], [4, -1], [8, 3]], [[8, 0], [3, 5], [-3, -2]]) == [[11, 1], [7, 4], [5, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002381", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(380) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(380) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002382", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(256) == [2, 2, 2, 2, 2, 2, 2, 2]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(256) == [2, 2, 2, 2, 2, 2, 2, 2]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002383", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([50, 16]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, 16]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002384", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([9, 3, 7], [3, 9, 2, 9, 3]) == [9, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 3, 7], [3, 9, 2, 9, 3]) == [9, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002385", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Dog sun the the, the sun. dog Sun the sun') == {'dog': 2, 'sun': 4, 'the': 4}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog sun the the, the sun. dog Sun the sun') == {'dog': 2, 'sun': 4, 'the': 4}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002386", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([4, 2, [1, 6]]) == [4, 2, 1, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([4, 2, [1, 6]]) == [4, 2, 1, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002387", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-13, 6, -7]) == -14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-13, 6, -7]) == -14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002388", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"ab,\",\",a,,\"') == ['ab,', ',a,,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"ab,\",\",a,,\"') == ['ab,', ',a,,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002389", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(588) == 'DLXXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(588) == 'DLXXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002390", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([6, 9, 7, 3, 2, 8, 4, 4, 6, 0], 2) == [[6, 9], [7, 3], [2, 8], [4, 4], [6, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 7, 3, 2, 8, 4, 4, 6, 0], 2) == [[6, 9], [7, 3], [2, 8], [4, 4], [6, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002391", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['axy', 'axzx']) == 'ax'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['axy', 'axzx']) == 'ax'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002392", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h36m58s') == 13018\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h36m58s') == 13018\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002393", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[3, 0], [0, 1], [1, 0]], [[2, 0], [2, 2]]) == [[6, 0], [2, 2], [2, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 0], [0, 1], [1, 0]], [[2, 0], [2, 2]]) == [[6, 0], [2, 2], [2, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002394", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('caa', 'caaa') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('caa', 'caaa') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002395", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=498; mode=off; user=auto; port=auto') == {'host': '498', 'mode': 'off', 'user': 'auto', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=498; mode=off; user=auto; port=auto') == {'host': '498', 'mode': 'off', 'user': 'auto', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002396", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-9, -6, 2], [-7, 4, -4], [-6, -4, -7]], [[-9, -2, 4], [3, 6, -6], [8, 1, -7]]) == [[-18, -8, 6], [-4, 10, -10], [2, -3, -14]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -6, 2], [-7, 4, -4], [-6, -4, -7]], [[-9, -2, 4], [3, 6, -6], [8, 1, -7]]) == [[-18, -8, 6], [-4, 10, -10], [2, -3, -14]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002397", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'y': 3, 'x': 1}, {'x': 1}) == {'z': 4, 'y': 3, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'y': 3, 'x': 1}, {'x': 1}) == {'z': 4, 'y': 3, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002398", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(17, 6) == 102\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 6) == 102\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002399", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([18, 2, 18, -3, -12]) == 23\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([18, 2, 18, -3, -12]) == 23\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002400", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(71)\nacc.deposit(88)\nacc.withdraw(124)\nacc.withdraw(278)\nassert acc.get_balance() == 159\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(71)\nacc.deposit(88)\nassert acc.get_balance() == 159\nacc.withdraw(124)\nassert acc.get_balance() == 35\nacc.withdraw(278)\nassert acc.get_balance() == 35\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002401", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(36) == [2, 2, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(36) == [2, 2, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002402", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 2, 0], [4, 0, 9, 3, 0, 0, 7, 2]) == [2, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 2, 0], [4, 0, 9, 3, 0, 0, 7, 2]) == [2, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002403", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('ddaaacccccccccdddd') == 'd2a3c9d4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddaaacccccccccdddd') == 'd2a3c9d4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002404", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-50, -22, -49, 25]) == 25\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-50, -22, -49, 25]) == 25\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002405", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([9, -12, -16, -32, -9, 12, 14]) == 14\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([9, -12, -16, -32, -9, 12, 14]) == 14\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002406", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('yxazedzfdz') == 'zdfzdezaxy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('yxazedzfdz') == 'zdfzdezaxy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002407", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'e': 8, 'c': 0}, 3) == {'e': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 8, 'c': 0}, 3) == {'e': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002408", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([38, 31, 44]) == [31, 38, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([38, 31, 44]) == [31, 38, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002409", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(123)\nacc.deposit(278)\nacc.withdraw(366)\nacc.withdraw(453)\nassert acc.get_balance() == 401\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(123)\nacc.deposit(278)\nassert acc.get_balance() == 401\nacc.withdraw(366)\nassert acc.get_balance() == 35\nacc.withdraw(453)\nassert acc.get_balance() == 35\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002410", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(401) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(401) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002411", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h16m55s') == 11815\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h16m55s') == 11815\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002412", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 14, 29, 37, 42], 42) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 14, 29, 37, 42], 42) == 4\nassert binary_search([5, 14, 29, 37, 42], 5) == 0\nassert binary_search([5, 14, 29, 37, 42], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002413", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('acaaaaaaaaaddddd') == 'a1c1a9d5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('acaaaaaaaaaddddd') == 'a1c1a9d5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002414", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 3], [3, 0]], [[4, 5, 3], [3, 5, 4]]) == [[9, 15, 12], [12, 15, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3], [3, 0]], [[4, 5, 3], [3, 5, 4]]) == [[9, 15, 12], [12, 15, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002415", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ed abddc ac bde') == 'Ed Abddc Ac Bde'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ed abddc ac bde') == 'Ed Abddc Ac Bde'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002416", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Cat sat The Sun cat ran sat') == {'cat': 2, 'sat': 2, 'the': 1, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat sat The Sun cat ran sat') == {'cat': 2, 'sat': 2, 'the': 1, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002417", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('aba))b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('aba))b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002418", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([0, [5, 5, 8], [9, 6, 7]]) == [0, 5, 5, 8, 9, 6, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [5, 5, 8], [9, 6, 7]]) == [0, 5, 5, 8, 9, 6, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002419", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-6, 9, 5, 9, 5, 3, -2]) == [-6, 3, 8, 17, 22, 25, 23]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-6, 9, 5, 9, 5, 3, -2]) == [-6, 3, 8, 17, 22, 25, 23]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002420", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(15 + 17 - 8 + 10)') == 34\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(15 + 17 - 8 + 10)') == 34\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002421", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(15) == 17\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(15) == 17\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002422", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MXXI') == 1021\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MXXI') == 1021\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002423", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('fybzxbczyy') == 'yyzcbxzbyf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fybzxbczyy') == 'yyzcbxzbyf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002424", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(66) == [2, 3, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(66) == [2, 3, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002425", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(8 - 5 + 10)') == 13\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(8 - 5 + 10)') == 13\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002426", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(29, 44) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(29, 44) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002427", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'e': 8, 'b': 2, 'c': 5}, 4) == {'e': 8, 'c': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 8, 'b': 2, 'c': 5}, 4) == {'e': 8, 'c': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002428", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([8, 31, 1, 9, 6, 6, 20]) == [1, 6, 6, 8, 9, 20, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([8, 31, 1, 9, 6, 6, 20]) == [1, 6, 6, 8, 9, 20, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002429", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[2], [4], 6]) == [2, 4, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2], [4], 6]) == [2, 4, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002430", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(490624) == 700\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(490624) == 700\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002431", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([2, 3, 6], [4, 2, 2, 6]) == [2, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 3, 6], [4, 2, 2, 6]) == [2, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002432", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(60) == [2, 2, 3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(60) == [2, 2, 3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002433", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(175, 42) == 7\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(175, 42) == 7\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002434", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(107) == [107]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(107) == [107]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002435", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([5, 4]) == [5, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 4]) == [5, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002436", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([48, 49, 49, 44]) == [44, 48, 49, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 49, 49, 44]) == [44, 48, 49, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002437", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('caccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002438", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([3, 4, 23, 42, 51, 56, 68], 23) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 4, 23, 42, 51, 56, 68], 23) == 2\nassert binary_search([3, 4, 23, 42, 51, 56, 68], 3) == 0\nassert binary_search([3, 4, 23, 42, 51, 56, 68], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002439", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(82) == 'LXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(82) == 'LXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002440", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([4, 5, [7, 3], [1], 6]) == [4, 5, 7, 3, 1, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, 5, [7, 3], [1], 6]) == [4, 5, 7, 3, 1, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002441", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([10, 10, 45, 25, 34, 29, 24, 24, 46]) == [10, 10, 24, 24, 25, 29, 34, 45, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 10, 45, 25, 34, 29, 24, 24, 46]) == [10, 10, 24, 24, 25, 29, 34, 45, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002442", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('b baddc') == 'B Baddc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('b baddc') == 'B Baddc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002443", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 7, 'e': 7, 'c': 3}, 3) == {'a': 7, 'e': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 7, 'e': 7, 'c': 3}, 3) == {'a': 7, 'e': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002444", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=auto; path=on') == {'host': 'auto', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; path=on') == {'host': 'auto', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002445", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(21, 4) == 84\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 4) == 84\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002446", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 3}, {'y': 8, 'w': 7, 'z': 5}) == {'x': 3, 'y': 8, 'w': 7, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3}, {'y': 8, 'w': 7, 'z': 5}) == {'x': 3, 'y': 8, 'w': 7, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002447", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'w': 1}, {'w': 3, 'x': 6}) == {'z': 2, 'w': 4, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'w': 1}, {'w': 3, 'x': 6}) == {'z': 2, 'w': 4, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002448", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-42, -33, -24, -5, 46, -19]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-42, -33, -24, -5, 46, -19]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002449", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(887) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(887) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002450", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([17, 30, 49, 44, 48, 38, 31, 31, 1, 36, 41]) == [1, 17, 30, 31, 31, 36, 38, 41, 44, 48, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([17, 30, 49, 44, 48, 38, 31, 31, 1, 36, 41]) == [1, 17, 30, 31, 31, 36, 38, 41, 44, 48, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002451", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(486) == 97\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(486) == 97\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002452", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(42, 39) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(42, 39) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002453", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(992) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(992) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002454", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([20, 28, 11, 3, 12, 20]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 28, 11, 3, 12, 20]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002455", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([1, [[6, 7, 6]], [6]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([1, [[6, 7, 6]], [6]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002456", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([8, 1, 4, 8, 4], [4, 5, 4, 7, 7, 2, 4, 1]) == [1, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 1, 4, 8, 4], [4, 5, 4, 7, 7, 2, 4, 1]) == [1, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002457", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('eed baadeb eab') == 'Eed Baadeb Eab'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eed baadeb eab') == 'Eed Baadeb Eab'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002458", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(6, 5) == 7776\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(6, 5) == 7776\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002459", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('aaaa,65,16') == ['aaaa', '65', '16']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aaaa,65,16') == ['aaaa', '65', '16']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002460", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 7, 8, 5, 1, 5, 4], 2) == [[4, 7], [8, 5], [1, 5], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 7, 8, 5, 1, 5, 4], 2) == [[4, 7], [8, 5], [1, 5], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002461", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(57); s.push(54); s.push(33)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(57); s.push(54); s.push(33)\nassert s.peek() == 33\nassert s.pop() == 33\nassert s.pop() == 54\nassert s.is_empty() == False\nassert s.pop() == 57\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002462", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-17, 24, 32]) == 32\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-17, 24, 32]) == 32\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002463", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([9, 8, 21, 19, 21, 27, 26]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 8, 21, 19, 21, 27, 26]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002464", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(164, 165) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(164, 165) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002465", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 1, 4, 0, 1, 2, 5, 5]) == [0, 1, 4, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 1, 4, 0, 1, 2, 5, 5]) == [0, 1, 4, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002466", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 4, 1, 0, 9, 0, 9], [9, 9, 7, 7, 5]) == [7, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 4, 1, 0, 9, 0, 9], [9, 9, 7, 7, 5]) == [7, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002467", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'x': 8, 'y': 4}, {'y': 4}) == {'w': 7, 'x': 8, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'x': 8, 'y': 4}, {'y': 4}) == {'w': 7, 'x': 8, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002468", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([45, 1, 0, 45, 4, 17]) == [0, 1, 4, 17, 45, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([45, 1, 0, 45, 4, 17]) == [0, 1, 4, 17, 45, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002469", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(7448) == 86\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7448) == 86\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002470", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([13, 38, 26, 21, 8, 33, 17, 27, 37, 45, 27, 4]) == [4, 8, 13, 17, 21, 26, 27, 27, 33, 37, 38, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([13, 38, 26, 21, 8, 33, 17, 27, 37, 45, 27, 4]) == [4, 8, 13, 17, 21, 26, 27, 27, 33, 37, 38, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002471", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dbcaeadbba') == 'dbcae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbcaeadbba') == 'dbcae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002472", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(2649) == 'MMDCXLIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2649) == 'MMDCXLIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002473", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 19, 'f': 4}) == {19: 'd', 4: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 19, 'f': 4}) == {19: 'd', 4: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002474", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('()[]{{}}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()[]{{}}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002475", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(6001) == 1006\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6001) == 1006\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002476", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('cce eacddd gc b faaee bbead') == 'eacddd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('cce eacddd gc b faaee bbead') == 'eacddd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002477", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCCLXII') == 362\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXII') == 362\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002478", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([1, 5, 42, 10, 20, 34, 11, 49]) == [1, 5, 10, 11, 20, 34, 42, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([1, 5, 42, 10, 20, 34, 11, 49]) == [1, 5, 10, 11, 20, 34, 42, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002479", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 6], [8, 6]]) == [[7, 8], [6, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 6], [8, 6]]) == [[7, 8], [6, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002480", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 9}, {'y': 3}) == {'w': 9, 'y': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9}, {'y': 3}) == {'w': 9, 'y': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002481", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[5, 6, 6, 3], [0, 6, 7, 9], [7, 1, 9, 3]]) == [[5, 0, 7], [6, 6, 1], [6, 7, 9], [3, 9, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 6, 6, 3], [0, 6, 7, 9], [7, 1, 9, 3]]) == [[5, 0, 7], [6, 6, 1], [6, 7, 9], [3, 9, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002482", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('cabca', 'cabcaf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cabca', 'cabcaf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002483", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'coconut', 'apple', 'berry']) == {'b': ['berry', 'berry'], 'c': ['cherry', 'coconut'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'coconut', 'apple', 'berry']) == {'b': ['berry', 'berry'], 'c': ['cherry', 'coconut'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002484", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 96, 'c': 61, 'd': 85, 'b': 30, 'a': 44}) == {96: 'e', 61: 'c', 85: 'd', 30: 'b', 44: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 96, 'c': 61, 'd': 85, 'b': 30, 'a': 44}) == {96: 'e', 61: 'c', 85: 'd', 30: 'b', 44: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002485", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=328; mode=auto') == {'user': '328', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=328; mode=auto') == {'user': '328', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002486", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('1h4m35s') == 3875\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h4m35s') == 3875\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002487", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([25, 51, 76, 96], 96) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([25, 51, 76, 96], 96) == 3\nassert binary_search([25, 51, 76, 96], 25) == 0\nassert binary_search([25, 51, 76, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002488", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(99); s.push(96); s.push(77)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(96); s.push(77)\nassert s.peek() == 77\nassert s.pop() == 77\nassert s.pop() == 96\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002489", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('1 * 6 + 15') == 21\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1 * 6 + 15') == 21\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002490", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([8, 7, 4, 7, 22, 25]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 7, 4, 7, 22, 25]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002491", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[1, 7, 7], 9]) == [1, 7, 7, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1, 7, 7], 9]) == [1, 7, 7, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002492", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(272)\nacc.deposit(79)\nacc.withdraw(236)\nacc.withdraw(515)\nassert acc.get_balance() == 351\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(272)\nacc.deposit(79)\nassert acc.get_balance() == 351\nacc.withdraw(236)\nassert acc.get_balance() == 115\nacc.withdraw(515)\nassert acc.get_balance() == 115\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002493", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('16') == 16\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('16') == 16\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002494", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('XC') == 90\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XC') == 90\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002495", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(58, 2) == 58\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(58, 2) == 58\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002496", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Ran cat cat dog dog!') == {'ran': 1, 'cat': 2, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran cat cat dog dog!') == {'ran': 1, 'cat': 2, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002497", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([17, 64, 94], 17) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 64, 94], 17) == 0\nassert binary_search([17, 64, 94], 17) == 0\nassert binary_search([17, 64, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002498", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[5, 6], [5, 4]]) == [[5, 5], [6, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 6], [5, 4]]) == [[5, 5], [6, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002499", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('}]{]}](]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}]{]}](]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002500", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(4, 114, 387) == 145\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(4, 114, 387) == 145\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002501", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Code Code', 22) == 'Ykza Ykza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Code', 22) == 'Ykza Ykza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002502", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-4, -6, -8], [5, 7, -5], [8, -4, 5], [2, 9, 6]], [[5, -3, -4], [0, -2, -1], [-2, -4, 5], [-5, 7, -9]]) == [[1, -9, -12], [5, 5, -6], [6, -8, 10], [-3, 16, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -6, -8], [5, 7, -5], [8, -4, 5], [2, 9, 6]], [[5, -3, -4], [0, -2, -1], [-2, -4, 5], [-5, 7, -9]]) == [[1, -9, -12], [5, 5, -6], [6, -8, 10], [-3, 16, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002503", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(225) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(225) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002504", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 2, 'z': 2, 'x': 7}, {'x': 3}) == {'w': 2, 'z': 2, 'x': 10}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2, 'z': 2, 'x': 7}, {'x': 3}) == {'w': 2, 'z': 2, 'x': 10}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002505", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abbccaa', 'cc') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbccaa', 'cc') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002506", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([5, 7, 1, 8, 3, 9, 8, 4, 3, 2], 14) == [8, 4, 3, 2, 5, 7, 1, 8, 3, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 7, 1, 8, 3, 9, 8, 4, 3, 2], 14) == [8, 4, 3, 2, 5, 7, 1, 8, 3, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002507", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(307679) == 554\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(307679) == 554\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002508", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 9, 0, 3, 1], 8) == [0, 3, 1, 4, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 9, 0, 3, 1], 8) == [0, 3, 1, 4, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002509", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(49); s.push(92); s.push(88)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(49); s.push(92); s.push(88)\nassert s.peek() == 88\nassert s.pop() == 88\nassert s.pop() == 92\nassert s.is_empty() == False\nassert s.pop() == 49\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002510", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(71); s.push(49); s.push(10)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(71); s.push(49); s.push(10)\nassert s.peek() == 10\nassert s.pop() == 10\nassert s.pop() == 49\nassert s.is_empty() == False\nassert s.pop() == 71\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002511", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'banana', 'date']) == {'a': ['apple'], 'b': ['banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'banana', 'date']) == {'a': ['apple'], 'b': ['banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002512", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 4, 4, 4, 1], [8, 2, 7, 7, 3]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 4, 4, 4, 1], [8, 2, 7, 7, 3]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002513", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[6, [8, 7, 0]], [9, 2, [7, 1, 2]]]) == [6, 8, 7, 0, 9, 2, 7, 1, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[6, [8, 7, 0]], [9, 2, [7, 1, 2]]]) == [6, 8, 7, 0, 9, 2, 7, 1, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002514", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'cherry', 'cherry', 'apple']) == {'d': ['date'], 'c': ['cherry', 'cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'cherry', 'apple']) == {'d': ['date'], 'c': ['cherry', 'cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002515", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(27); s.push(12); s.push(90)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(27); s.push(12); s.push(90)\nassert s.peek() == 90\nassert s.pop() == 90\nassert s.pop() == 12\nassert s.is_empty() == False\nassert s.pop() == 27\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002516", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'a', 'c', 'c', 'd', 'd', 'e', 'd', 'a']) == {'e': 2, 'a': 2, 'c': 2, 'd': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'c', 'c', 'd', 'd', 'e', 'd', 'a']) == {'e': 2, 'a': 2, 'c': 2, 'd': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002517", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'c', 'd', 'c', 'b']) == {'d': 2, 'c': 2, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'c', 'd', 'c', 'b']) == {'d': 2, 'c': 2, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002518", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(8306) == 6038\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8306) == 6038\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002519", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[1, 7], [-7, -4]], [[4, -5], [-6, 1]]) == [[5, 2], [-13, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, 7], [-7, -4]], [[4, -5], [-6, 1]]) == [[5, 2], [-13, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002520", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(50, 199) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(50, 199) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002521", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 17, 'd': 2, 'a': 81, 'b': 72}) == {17: 'c', 2: 'd', 81: 'a', 72: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 17, 'd': 2, 'a': 81, 'b': 72}) == {17: 'c', 2: 'd', 81: 'a', 72: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002522", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([4, -18]) == -14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([4, -18]) == -14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002523", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'coconut', 'date', 'date']) == {'a': ['avocado'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'coconut', 'date', 'date']) == {'a': ['avocado'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002524", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'berry', 'avocado', 'coconut', 'cherry', 'cherry']) == {'b': ['banana', 'berry'], 'a': ['avocado'], 'c': ['coconut', 'cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'berry', 'avocado', 'coconut', 'cherry', 'cherry']) == {'b': ['banana', 'berry'], 'a': ['avocado'], 'c': ['coconut', 'cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002525", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([4, [0, 4], [6, 2, 8, 4], 8]) == [4, 0, 4, 6, 2, 8, 4, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [0, 4], [6, 2, 8, 4], 8]) == [4, 0, 4, 6, 2, 8, 4, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002526", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('accaacca') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('accaacca') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002527", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(78) == 35\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(78) == 35\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002528", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(5594) == 23\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5594) == 23\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002529", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'e', 'e', 'a', 'a', 'c', 'a']) == {'d': 1, 'e': 2, 'a': 3, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'e', 'a', 'a', 'c', 'a']) == {'d': 1, 'e': 2, 'a': 3, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002530", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the. ran! Dog the dog') == {'the': 2, 'ran': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the. ran! Dog the dog') == {'the': 2, 'ran': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002531", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 0], [0, 2], [4, 2]], [[3, 0, 4], [0, 1, 1]]) == [[15, 0, 20], [0, 2, 2], [12, 2, 18]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 0], [0, 2], [4, 2]], [[3, 0, 4], [0, 1, 1]]) == [[15, 0, 20], [0, 2, 2], [12, 2, 18]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002532", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 36, 'c': 64}) == {36: 'e', 64: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 36, 'c': 64}) == {36: 'e', 64: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002533", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 5}, {'x': 7}) == {'y': 5, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5}, {'x': 7}) == {'y': 5, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002534", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('daab') == 'dab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daab') == 'dab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002535", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(165) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(165) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002536", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'berry', 'banana', 'date', 'banana', 'apple', 'apple', 'banana']) == {'a': ['avocado', 'apple', 'apple'], 'b': ['berry', 'banana', 'banana', 'banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'berry', 'banana', 'date', 'banana', 'apple', 'apple', 'banana']) == {'a': ['avocado', 'apple', 'apple'], 'b': ['berry', 'banana', 'banana', 'banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002537", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 6, 8, 4, 8, 0, 1, 7, 3], 7) == [8, 4, 8, 0, 1, 7, 3, 2, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 6, 8, 4, 8, 0, 1, 7, 3], 7) == [8, 4, 8, 0, 1, 7, 3, 2, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002538", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(23, 20) == 460\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 20) == 460\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002539", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(483) == 'CDLXXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(483) == 'CDLXXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002540", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(48, 55) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 55) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002541", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(843) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(843) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002542", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(1893) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1893) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002543", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 35, 'd': 70, 'a': 2, 'b': 26, 'c': 30}) == {35: 'f', 70: 'd', 2: 'a', 26: 'b', 30: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 35, 'd': 70, 'a': 2, 'b': 26, 'c': 30}) == {35: 'f', 70: 'd', 2: 'a', 26: 'b', 30: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002544", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([3, 21, 22, 18, 22, 28]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 21, 22, 18, 22, 28]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002545", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 5, 'e': 7}, 6) == {'e': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 5, 'e': 7}, 6) == {'e': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002546", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([23, 29, 12]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 29, 12]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002547", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[8, 5, 5], [5, 9, 8], [4, 6, 0], [0, 1, 4]]) == [[8, 5, 4, 0], [5, 9, 6, 1], [5, 8, 0, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 5, 5], [5, 9, 8], [4, 6, 0], [0, 1, 4]]) == [[8, 5, 4, 0], [5, 9, 6, 1], [5, 8, 0, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002548", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[](){}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[](){}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002549", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(32, 44) == 352\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(32, 44) == 352\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002550", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([2, 49, 7, 16, 39, 24, 42]) == [2, 7, 16, 24, 39, 42, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 49, 7, 16, 39, 24, 42]) == [2, 7, 16, 24, 39, 42, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002551", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('abcacae') == 'abce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abcacae') == 'abce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002552", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 5, 0, 1, 4, 4]) == [3, 5, 0, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 0, 1, 4, 4]) == [3, 5, 0, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002553", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[4], [8, 8, 5], [8, 8, 9]]]) == 50\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[4], [8, 8, 5], [8, 8, 9]]]) == 50\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002554", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('afd') == 'dfa'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('afd') == 'dfa'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002555", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 38, 'c': 31, 'e': 19, 'f': 89}) == {38: 'b', 31: 'c', 19: 'e', 89: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 38, 'c': 31, 'e': 19, 'f': 89}) == {38: 'b', 31: 'c', 19: 'e', 89: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002556", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('4h50m57s') == 17457\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h50m57s') == 17457\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002557", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(21, 33) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(21, 33) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002558", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(325) == [5, 5, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(325) == [5, 5, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002559", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(59, 18) == 1062\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(59, 18) == 1062\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002560", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=714; mode=auto; host=427') == {'path': '714', 'mode': 'auto', 'host': '427'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=714; mode=auto; host=427') == {'path': '714', 'mode': 'auto', 'host': '427'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002561", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([42, 43, 50, 76], 113) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([42, 43, 50, 76], 113) == -1\nassert binary_search([42, 43, 50, 76], 42) == 0\nassert binary_search([42, 43, 50, 76], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002562", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[8, 8, 6], [5, 9, 6], [1, 6, 0]]) == [[8, 5, 1], [8, 9, 6], [6, 6, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 8, 6], [5, 9, 6], [1, 6, 0]]) == [[8, 5, 1], [8, 9, 6], [6, 6, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002563", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(454) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(454) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002564", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(16 + 18)') == 34\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(16 + 18)') == 34\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002565", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('user=auto; path=409; mode=auto') == {'user': 'auto', 'path': '409', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; path=409; mode=auto') == {'user': 'auto', 'path': '409', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002566", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(24, 12) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 12) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002567", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-6, -20, -3, -20, 13]) == -36\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, -20, -3, -20, 13]) == -36\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002568", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[5, 5], [2, 2]], [[5, 4], [2, 2]]) == [[35, 30], [14, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 5], [2, 2]], [[5, 4], [2, 2]]) == [[35, 30], [14, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002569", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('World Hello', 10) == 'Gybvn Rovvy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Hello', 10) == 'Gybvn Rovvy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002570", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[5, 1, 2, 7], [6], 7, 9]) == [5, 1, 2, 7, 6, 7, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 1, 2, 7], [6], 7, 9]) == [5, 1, 2, 7, 6, 7, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002571", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(75) == 'LXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(75) == 'LXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002572", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('host=495; port=688; mode=on') == {'host': '495', 'port': '688', 'mode': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=495; port=688; mode=on') == {'host': '495', 'port': '688', 'mode': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002573", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[8, 7, 7], [0, 0, 0], [0, 6, 6]]) == [[8, 0, 0], [7, 0, 6], [7, 0, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 7, 7], [0, 0, 0], [0, 6, 6]]) == [[8, 0, 0], [7, 0, 6], [7, 0, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002574", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('5 + 17 - 2') == 20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('5 + 17 - 2') == 20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002575", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('cbacxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbacxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002576", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('bcbabc', 'bcbbca') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bcbabc', 'bcbbca') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002577", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(31, 39) == 1209\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(31, 39) == 1209\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002578", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([44, 12, 48, 14, 47, 7]) == [7, 12, 14, 44, 47, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 12, 48, 14, 47, 7]) == [7, 12, 14, 44, 47, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002579", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Ran sun sat cat ran ran sun. cat Dog The') == {'ran': 3, 'sun': 2, 'sat': 1, 'cat': 2, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran sun sat cat ran ran sun. cat Dog The') == {'ran': 3, 'sun': 2, 'sat': 1, 'cat': 2, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002580", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(1171) == 1711\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1171) == 1711\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002581", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('fycbx') == 'xbcyf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fycbx') == 'xbcyf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002582", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMCDXCV') == 2495\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCDXCV') == 2495\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002583", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 34, 'c': 10}) == {34: 'd', 10: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 34, 'c': 10}) == {34: 'd', 10: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002584", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(19, 125, 370) == 109\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 125, 370) == 109\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002585", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=781; mode=163; path=721') == {'host': '781', 'mode': '163', 'path': '721'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=781; mode=163; path=721') == {'host': '781', 'mode': '163', 'path': '721'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002586", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 1, 4], [3, 1, 3]], [[0, 2], [4, 4], [3, 5]]) == [[16, 28], [13, 25]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 1, 4], [3, 1, 3]], [[0, 2], [4, 4], [3, 5]]) == [[16, 28], [13, 25]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002587", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('DCLXXV') == 675\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DCLXXV') == 675\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002588", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([2, 28, 12, 28]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 28, 12, 28]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002589", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-10, -15, 2, 18, 14]) == 9\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-10, -15, 2, 18, 14]) == 9\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002590", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[0, 1, 0], [0, 0, 1]], [[5, 2, 5], [3, 4, 3], [1, 3, 4]]) == [[3, 4, 3], [1, 3, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 1, 0], [0, 0, 1]], [[5, 2, 5], [3, 4, 3], [1, 3, 4]]) == [[3, 4, 3], [1, 3, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002591", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([3, 2, 6, 1, 7, 1, 4], 9) == [1, 4, 3, 2, 6, 1, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 2, 6, 1, 7, 1, 4], 9) == [1, 4, 3, 2, 6, 1, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002592", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ceddca') == 'ceda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceddca') == 'ceda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002593", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'e', 'd', 'd', 'e']) == {'a': 1, 'e': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'e', 'd', 'd', 'e']) == {'a': 1, 'e': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002594", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(588) == 'DLXXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(588) == 'DLXXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002595", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CXXIII') == 123\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXIII') == 123\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002596", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([8, 5, -9, 20]) == 24\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([8, 5, -9, 20]) == 24\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002597", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=103; host=442; mode=293; path=384') == {'port': '103', 'host': '442', 'mode': '293', 'path': '384'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=103; host=442; mode=293; path=384') == {'port': '103', 'host': '442', 'mode': '293', 'path': '384'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002598", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 19) == 'qrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 19) == 'qrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002599", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat sun sun. ran, dog sat Dog') == {'sat': 2, 'sun': 2, 'ran': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun sun. ran, dog sat Dog') == {'sat': 2, 'sun': 2, 'ran': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002600", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([31, 23, 7, 35, 9]) == [7, 9, 23, 31, 35]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([31, 23, 7, 35, 9]) == [7, 9, 23, 31, 35]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002601", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-21, 14, 21, 40, -50, -22, -32, 42]) == 42\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-21, 14, 21, 40, -50, -22, -32, 42]) == 42\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002602", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('afeac', 'aecfa') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('afeac', 'aecfa') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002603", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-17, 1, 17, -4, -19, -20]) == -42\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-17, 1, 17, -4, -19, -20]) == -42\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002604", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 9, 0, 7, 8, 8, 3, 9, 3, 1], 1) == [1, 8, 9, 0, 7, 8, 8, 3, 9, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 9, 0, 7, 8, 8, 3, 9, 3, 1], 1) == [1, 8, 9, 0, 7, 8, 8, 3, 9, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002605", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 30, 'e': 85, 'f': 79, 'a': 78}) == {30: 'c', 85: 'e', 79: 'f', 78: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 30, 'e': 85, 'f': 79, 'a': 78}) == {30: 'c', 85: 'e', 79: 'f', 78: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002606", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(46) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(46) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002607", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran ran Sat dog cat') == {'ran': 2, 'sat': 1, 'dog': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran ran Sat dog cat') == {'ran': 2, 'sat': 1, 'dog': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002608", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 5, 3], [1, 0, 8]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 5, 3], [1, 0, 8]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002609", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([44, 13, 21, 1]) == [1, 13, 21, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 13, 21, 1]) == [1, 13, 21, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002610", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('22m28s') == 1348\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('22m28s') == 1348\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002611", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('6,aeba') == ['6', 'aeba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('6,aeba') == ['6', 'aeba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002612", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 3, 2, 3, 1, 5], [6, 8, 6, 7, 3, 5, 8, 1]) == [5, 3, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 3, 2, 3, 1, 5], [6, 8, 6, 7, 3, 5, 8, 1]) == [5, 3, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002613", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(63); s.push(85); s.push(12)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(63); s.push(85); s.push(12)\nassert s.peek() == 12\nassert s.pop() == 12\nassert s.pop() == 85\nassert s.is_empty() == False\nassert s.pop() == 63\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002614", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 4], [1, 1], [5, 2]], [[3, 4, 1], [0, 0, 0]]) == [[12, 16, 4], [3, 4, 1], [15, 20, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 4], [1, 1], [5, 2]], [[3, 4, 1], [0, 0, 0]]) == [[12, 16, 4], [3, 4, 1], [15, 20, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002615", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(4792) == 22\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4792) == 22\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002616", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('bhbe egeca ghcccac ehaehd fffa gh') == 'ghcccac'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bhbe egeca ghcccac ehaehd fffa gh') == 'ghcccac'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002617", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[[1, 3, 5]], [[2, 1]]]) == [1, 3, 5, 2, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[1, 3, 5]], [[2, 1]]]) == [1, 3, 5, 2, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002618", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(849) == 'DCCCXLIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(849) == 'DCCCXLIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002619", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabaabb', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabb', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002620", "instruction": "Write a recursive Python function fib_recursive(n) returning the nth Fibonacci number (fib(0)=0, fib(1)=1).\n\nExample:\nassert fib_recursive(15) == 610\n\nImplement exactly this signature: `def fib_recursive(n)`. The tests call it directly.", "tests": "assert fib_recursive(15) == 610\nassert fib_recursive(0) == 0\nassert fib_recursive(10) == 55", "family": "fib_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002621", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([24, 12, 35]) == [12, 24, 35]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 12, 35]) == [12, 24, 35]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002622", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([7, 3, 2, 2, 6, 4, 5], 3) == [[7, 3, 2], [2, 6, 4], [5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 3, 2, 2, 6, 4, 5], 3) == [[7, 3, 2], [2, 6, 4], [5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002623", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabaabaaaaabbab', 'abba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabaaaaabbab', 'abba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002624", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 5, 'c': 85, 'a': 9, 'd': 32, 'f': 27}) == {5: 'b', 85: 'c', 9: 'a', 32: 'd', 27: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 5, 'c': 85, 'a': 9, 'd': 32, 'f': 27}) == {5: 'b', 85: 'c', 9: 'a', 32: 'd', 27: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002625", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[3, -2, 8], [-2, 5, 9]], [[3, 1, 8], [-1, -5, -2]]) == [[6, -1, 16], [-3, 0, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -2, 8], [-2, 5, 9]], [[3, 1, 8], [-1, -5, -2]]) == [[6, -1, 16], [-3, 0, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002626", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[1, 1], [6, 1]]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[1, 1], [6, 1]]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002627", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([3, 4, 8, 15, 19, 19], [4, 7, 10, 12, 16]) == [3, 4, 4, 7, 8, 10, 12, 15, 16, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 4, 8, 15, 19, 19], [4, 7, 10, 12, 16]) == [3, 4, 4, 7, 8, 10, 12, 15, 16, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002628", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('((12 - 2) * 3 + 1)') == 31\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((12 - 2) * 3 + 1)') == 31\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002629", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'apple', 'coconut', 'avocado', 'avocado', 'cherry', 'apple', 'date']) == {'a': ['apple', 'apple', 'avocado', 'avocado', 'apple'], 'c': ['coconut', 'cherry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'apple', 'coconut', 'avocado', 'avocado', 'cherry', 'apple', 'date']) == {'a': ['apple', 'apple', 'avocado', 'avocado', 'apple'], 'c': ['coconut', 'cherry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002630", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(143, 66) == 11\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(143, 66) == 11\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002631", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([45, 41, 40]) == [40, 41, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([45, 41, 40]) == [40, 41, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002632", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([42, 11, 37, 7, 43]) == [7, 11, 37, 42, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([42, 11, 37, 7, 43]) == [7, 11, 37, 42, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002633", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([6, -8, -9, -6]) == [6, -2, -11, -17]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([6, -8, -9, -6]) == [6, -2, -11, -17]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002634", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 6, 'b': 23, 'e': 45}) == {6: 'd', 23: 'b', 45: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 6, 'b': 23, 'e': 45}) == {6: 'd', 23: 'b', 45: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002635", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(1322) == 8\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1322) == 8\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002636", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(382) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(382) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002637", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('5h8m8s') == 18488\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h8m8s') == 18488\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002638", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([27, -43, -12, 19, 39, -28, -3, -28, -48]) == 39\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([27, -43, -12, 19, 39, -28, -3, -28, -48]) == 39\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002639", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 21) == 'stu'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 21) == 'stu'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002640", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([4, -2, -5, -3]) == [4, 2, -3, -6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([4, -2, -5, -3]) == [4, 2, -3, -6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002641", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(49, 194, 844) == 81\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(49, 194, 844) == 81\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002642", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[0], [4, 1], 5]) == [0, 4, 1, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], [4, 1], 5]) == [0, 4, 1, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002643", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 4, 'c': 6}, 5) == {'c': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 4, 'c': 6}, 5) == {'c': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002644", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('acaebbabec') == 'aceb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acaebbabec') == 'aceb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002645", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-3, 10, 49, 22, 47, -28, 30]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-3, 10, 49, 22, 47, -28, 30]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002646", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(388)\nacc.deposit(211)\nacc.withdraw(541)\nacc.withdraw(733)\nassert acc.get_balance() == 599\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(388)\nacc.deposit(211)\nassert acc.get_balance() == 599\nacc.withdraw(541)\nassert acc.get_balance() == 58\nacc.withdraw(733)\nassert acc.get_balance() == 58\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002647", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[0, 8, 4], [8, 0, 9], [8, 2, 4]]) == [[0, 8, 8], [8, 0, 2], [4, 9, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 8, 4], [8, 0, 9], [8, 2, 4]]) == [[0, 8, 8], [8, 0, 2], [4, 9, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002648", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([4, 15, 4, 15, 28, 4]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 15, 4, 15, 28, 4]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002649", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(100) == [2, 2, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(100) == [2, 2, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002650", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(111) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(111) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002651", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['banana', 'berry', 'cherry', 'apple', 'banana']) == {'b': ['banana', 'berry', 'banana'], 'c': ['cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'berry', 'cherry', 'apple', 'banana']) == {'b': ['banana', 'berry', 'banana'], 'c': ['cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002652", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(3, 32) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(3, 32) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002653", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(104, 181) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(104, 181) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002654", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('baaababbbb', 'aa') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaababbbb', 'aa') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002655", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([20, 7, 5]) == [5, 7, 20]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 7, 5]) == [5, 7, 20]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002656", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([30, 23, 17, 23, 16, 43, 0, 2, 23, 49, 13, 9, 17, 9]) == [0, 2, 9, 9, 13, 16, 17, 17, 23, 23, 23, 30, 43, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([30, 23, 17, 23, 16, 43, 0, 2, 23, 49, 13, 9, 17, 9]) == [0, 2, 9, 9, 13, 16, 17, 17, 23, 23, 23, 30, 43, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002657", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-11, -26, 36, 41]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-11, -26, 36, 41]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002658", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dbea') == 'Dbea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dbea') == 'Dbea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002659", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([9, 9, 44, 2, 26, 14, 5]) == [2, 5, 9, 9, 14, 26, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([9, 9, 44, 2, 26, 14, 5]) == [2, 5, 9, 9, 14, 26, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002660", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 1, 'a': 7}, 2) == {'a': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 1, 'a': 7}, 2) == {'a': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002661", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(35, 43) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 43) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002662", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['ca', 'cayzy']) == 'ca'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ca', 'cayzy']) == 'ca'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002663", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('rcuhmxau') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('rcuhmxau') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002664", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbbbbbbbbbaaabba', 'aaba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbbbbbbaaabba', 'aaba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002665", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('15 - 6 * 14') == -69\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('15 - 6 * 14') == -69\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002666", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 5, 4, 1, 6, 6, 0, 3], 1) == [3, 8, 5, 4, 1, 6, 6, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 4, 1, 6, 6, 0, 3], 1) == [3, 8, 5, 4, 1, 6, 6, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002667", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(5732) == 2375\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5732) == 2375\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002668", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'avocado', 'berry', 'date', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'avocado', 'berry', 'date', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002669", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([35, 6, 26, 25, 14, 28, 47, 23, 14, 44, 20]) == [6, 14, 14, 20, 23, 25, 26, 28, 35, 44, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([35, 6, 26, 25, 14, 28, 47, 23, 14, 44, 20]) == [6, 14, 14, 20, 23, 25, 26, 28, 35, 44, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002670", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(8989) == 9898\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8989) == 9898\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002671", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 3, 1, 9, 0, 3, 2], 5) == [1, 9, 0, 3, 2, 3, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 3, 1, 9, 0, 3, 2], 5) == [1, 9, 0, 3, 2, 3, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002672", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(460) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(460) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002673", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 9}, {'x': 9, 'w': 9}) == {'z': 9, 'x': 9, 'w': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9}, {'x': 9, 'w': 9}) == {'z': 9, 'x': 9, 'w': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002674", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'avocado', 'avocado']) == {'b': ['berry'], 'c': ['cherry'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'avocado', 'avocado']) == {'b': ['berry'], 'c': ['cherry'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002675", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat Sat sun. cat ran, cat cat') == {'cat': 4, 'sat': 1, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat Sat sun. cat ran, cat cat') == {'cat': 4, 'sat': 1, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002676", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([2, 6, 21, 37, 43, 77], 21) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 6, 21, 37, 43, 77], 21) == 2\nassert binary_search([2, 6, 21, 37, 43, 77], 2) == 0\nassert binary_search([2, 6, 21, 37, 43, 77], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002677", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 29, 67, 68], 29) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 29, 67, 68], 29) == 1\nassert binary_search([5, 29, 67, 68], 5) == 0\nassert binary_search([5, 29, 67, 68], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002678", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([1, 3, 3, 4, 3], 3) == [[1, 3, 3], [4, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 3, 4, 3], 3) == [[1, 3, 3], [4, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002679", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 46, 'd': 28, 'a': 73}) == {46: 'b', 28: 'd', 73: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 46, 'd': 28, 'a': 73}) == {46: 'b', 28: 'd', 73: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002680", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([18, 22, 7, 10, 48, 27, 22, 2, 48, 6, 40, 38, 36]) == [2, 6, 7, 10, 18, 22, 22, 27, 36, 38, 40, 48, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 22, 7, 10, 48, 27, 22, 2, 48, 6, 40, 38, 36]) == [2, 6, 7, 10, 18, 22, 22, 27, 36, 38, 40, 48, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002681", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 9, 22, 0, 22, 0]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 9, 22, 0, 22, 0]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002682", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('ca,64') == ['ca', '64']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ca,64') == ['ca', '64']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002683", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'x': 9}, {'y': 9, 'z': 3, 'w': 2}) == {'w': 9, 'x': 9, 'y': 9, 'z': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'x': 9}, {'y': 9, 'z': 3, 'w': 2}) == {'w': 9, 'x': 9, 'y': 9, 'z': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002684", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Hello Code', 24) == 'Fcjjm Ambc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Code', 24) == 'Fcjjm Ambc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002685", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=520; mode=959; port=557') == {'host': '520', 'mode': '959', 'port': '557'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=520; mode=959; port=557') == {'host': '520', 'mode': '959', 'port': '557'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002686", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(19) == 20\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(19) == 20\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002687", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['date', 'coconut', 'coconut', 'avocado', 'banana', 'apple', 'coconut']) == {'d': ['date'], 'c': ['coconut', 'coconut', 'coconut'], 'a': ['avocado', 'apple'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'coconut', 'coconut', 'avocado', 'banana', 'apple', 'coconut']) == {'d': ['date'], 'c': ['coconut', 'coconut', 'coconut'], 'a': ['avocado', 'apple'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002688", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(221) == 'CCXXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(221) == 'CCXXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002689", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'e', 'c', 'b', 'a', 'b', 'd', 'a', 'b', 'b']) == {'e': 2, 'c': 1, 'b': 4, 'a': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'c', 'b', 'a', 'b', 'd', 'a', 'b', 'b']) == {'e': 2, 'c': 1, 'b': 4, 'a': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002690", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('dcdddb') == 'dcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcdddb') == 'dcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002691", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 5, 1, 3, 4, 0]) == [1, 5, 3, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 1, 3, 4, 0]) == [1, 5, 3, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002692", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog dog the Sun sat ran ran sun') == {'dog': 2, 'the': 1, 'sun': 2, 'sat': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog dog the Sun sat ran ran sun') == {'dog': 2, 'the': 1, 'sun': 2, 'sat': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002693", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-8, 20, -7, -16, -15]) == -26\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-8, 20, -7, -16, -15]) == -26\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002694", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[3], [6, 8, 5], 2, [8, 8]]) == [3, 6, 8, 5, 2, 8, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3], [6, 8, 5], 2, [8, 8]]) == [3, 6, 8, 5, 2, 8, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002695", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([3, 4, 3, 8, 4, 7, 0, 5, 1, 5], 4) == [0, 5, 1, 5, 3, 4, 3, 8, 4, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 4, 3, 8, 4, 7, 0, 5, 1, 5], 4) == [0, 5, 1, 5, 3, 4, 3, 8, 4, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002696", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([4, 6, 2, 9, 3, 1, 2, 4, 2], 4) == [1, 2, 4, 2, 4, 6, 2, 9, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 6, 2, 9, 3, 1, 2, 4, 2], 4) == [1, 2, 4, 2, 4, 6, 2, 9, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002697", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ecdaaed') == 'ecda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecdaaed') == 'ecda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002698", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(10, 56) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(10, 56) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002699", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(9118) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9118) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002700", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(47, 10, 98) == 93\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(47, 10, 98) == 93\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002701", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([1, 2, 8]) == [1, 3, 11]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, 2, 8]) == [1, 3, 11]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002702", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([44, 24, -1]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([44, 24, -1]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002703", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 0, 4, 8, 0, 5, 7, 7, 9], 7) == [4, 8, 0, 5, 7, 7, 9, 4, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 0, 4, 8, 0, 5, 7, 7, 9], 7) == [4, 8, 0, 5, 7, 7, 9, 4, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002704", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[{}{}]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{}{}]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002705", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([13, 66, 69, 74, 78, 81, 89], 118) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 66, 69, 74, 78, 81, 89], 118) == -1\nassert binary_search([13, 66, 69, 74, 78, 81, 89], 13) == 0\nassert binary_search([13, 66, 69, 74, 78, 81, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002706", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 4, 1], [0, 4, 1], [0, 2, 5]], [[4, 0], [5, 4], [1, 5]]) == [[33, 21], [21, 21], [15, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 4, 1], [0, 4, 1], [0, 2, 5]], [[4, 0], [5, 4], [1, 5]]) == [[33, 21], [21, 21], [15, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002707", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([21, 46, 49, 44, 17, 43, 16]) == [16, 17, 21, 43, 44, 46, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 46, 49, 44, 17, 43, 16]) == [16, 17, 21, 43, 44, 46, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002708", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('ccaccacc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccaccacc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002709", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('37m15s') == 2235\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('37m15s') == 2235\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002710", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 28, 'f': 77}) == {28: 'a', 77: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 28, 'f': 77}) == {28: 'a', 77: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002711", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 4, 1, 0, 3, 5, 4]) == [2, 4, 1, 0, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 1, 0, 3, 5, 4]) == [2, 4, 1, 0, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002712", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([2, 2, 1, -9]) == [2, 4, 5, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([2, 2, 1, -9]) == [2, 4, 5, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002713", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(3372) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3372) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002714", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([38, 8, 39, 18, 49, 35, 11, 23]) == [8, 11, 18, 23, 35, 38, 39, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([38, 8, 39, 18, 49, 35, 11, 23]) == [8, 11, 18, 23, 35, 38, 39, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002715", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=117; host=auto') == {'path': '117', 'host': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=117; host=auto') == {'path': '117', 'host': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002716", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(0); s.push(64); s.push(28)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(0); s.push(64); s.push(28)\nassert s.peek() == 28\nassert s.pop() == 28\nassert s.pop() == 64\nassert s.is_empty() == False\nassert s.pop() == 0\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002717", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(0); s.push(45); s.push(19)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(0); s.push(45); s.push(19)\nassert s.peek() == 19\nassert s.pop() == 19\nassert s.pop() == 45\nassert s.is_empty() == False\nassert s.pop() == 0\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002718", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([27, 5, 23]) == [5, 23, 27]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 5, 23]) == [5, 23, 27]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_002719", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('World Hello', 6) == 'Cuxrj Nkrru'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Hello', 6) == 'Cuxrj Nkrru'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002720", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([50, 47, 39, 8, 20]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, 47, 39, 8, 20]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002721", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('edze') == 'ezde'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('edze') == 'ezde'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002722", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 78, 93], 93) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 78, 93], 93) == 2\nassert binary_search([4, 78, 93], 4) == 0\nassert binary_search([4, 78, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002723", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat ran. sat dog, cat.') == {'cat': 2, 'ran': 1, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat ran. sat dog, cat.') == {'cat': 2, 'ran': 1, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002724", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 84, 'd': 80, 'f': 91, 'a': 31, 'b': 59}) == {84: 'c', 80: 'd', 91: 'f', 31: 'a', 59: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 84, 'd': 80, 'f': 91, 'a': 31, 'b': 59}) == {84: 'c', 80: 'd', 91: 'f', 31: 'a', 59: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002725", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('c ba babb aaebbe') == 'C Ba Babb Aaebbe'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('c ba babb aaebbe') == 'C Ba Babb Aaebbe'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002726", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([9, -6, -7, 9, 5, 6, 9, -6]) == [9, 3, -4, 5, 10, 16, 25, 19]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, -6, -7, 9, 5, 6, 9, -6]) == [9, 3, -4, 5, 10, 16, 25, 19]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002727", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(64); s.push(62); s.push(41)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(64); s.push(62); s.push(41)\nassert s.peek() == 41\nassert s.pop() == 41\nassert s.pop() == 62\nassert s.is_empty() == False\nassert s.pop() == 64\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002728", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('baaaaa', 'cac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaaaa', 'cac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002729", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(38) == [2, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(38) == [2, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002730", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(4601) == 11\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4601) == 11\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002731", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(45, 43) == 1935\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(45, 43) == 1935\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002732", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('ababbbbabb', 'aa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbbbabb', 'aa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002733", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([4, 4, 0, 1], [1, 7, 4]) == [4, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 4, 0, 1], [1, 7, 4]) == [4, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002734", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([29, 21, 21, 13, 21, 22]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 21, 21, 13, 21, 22]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002735", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('hgggggcd fhhcfbbd b ae cbe habc') == 'hgggggcd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hgggggcd fhhcfbbd b ae cbe habc') == 'hgggggcd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002736", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'd', 'd']) == {'e': 1, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'd', 'd']) == {'e': 1, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002737", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello World', 8) == 'Pmttw Ewztl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello World', 8) == 'Pmttw Ewztl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002738", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([38, 2, 24]) == [2, 24, 38]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([38, 2, 24]) == [2, 24, 38]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002739", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aabbb') == 'a2b3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aabbb') == 'a2b3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002740", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(']{{b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']{{b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002741", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 5, 'e': 0, 'f': 27, 'b': 32}) == {5: 'c', 0: 'e', 27: 'f', 32: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 5, 'e': 0, 'f': 27, 'b': 32}) == {5: 'c', 0: 'e', 27: 'f', 32: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002742", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-46, -9]) == -9\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-46, -9]) == -9\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002743", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aaaaa', 'aa') == 4\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaa', 'aa') == 4\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002744", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('fikajryakvlqy') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('fikajryakvlqy') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002745", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('d abbe bdafcg ff hefab') == 'bdafcg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('d abbe bdafcg ff hefab') == 'bdafcg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002746", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(110, 92) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(110, 92) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002747", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([6, 9, 2, 2, 1, 0, 1, 3], [5, 6, 1, 0, 9, 3, 2]) == [6, 9, 2, 1, 0, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 2, 2, 1, 0, 1, 3], [5, 6, 1, 0, 9, 3, 2]) == [6, 9, 2, 1, 0, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002748", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=858; host=off; user=487; mode=off') == {'port': '858', 'host': 'off', 'user': '487', 'mode': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=858; host=off; user=487; mode=off') == {'port': '858', 'host': 'off', 'user': '487', 'mode': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002749", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 9, 0, 2, 9, 3, 3, 8], 4) == [[8, 9, 0, 2], [9, 3, 3, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 9, 0, 2, 9, 3, 3, 8], 4) == [[8, 9, 0, 2], [9, 3, 3, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002750", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('gxxxiqichtq') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('gxxxiqichtq') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002751", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('gfdhed dedgde dggac geafdaac eagcc') == 'geafdaac'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gfdhed dedgde dggac geafdaac eagcc') == 'geafdaac'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002752", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([1, -29, -8, 37]) == 37\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([1, -29, -8, 37]) == 37\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002753", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(220)\nacc.deposit(209)\nacc.withdraw(259)\nacc.withdraw(463)\nassert acc.get_balance() == 429\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(220)\nacc.deposit(209)\nassert acc.get_balance() == 429\nacc.withdraw(259)\nassert acc.get_balance() == 170\nacc.withdraw(463)\nassert acc.get_balance() == 170\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002754", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 7, 3, 0, 6, 6, 1], [0, 2, 2, 3]) == [2, 3, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 3, 0, 6, 6, 1], [0, 2, 2, 3]) == [2, 3, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002755", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 1, 5, 5, 2, 9, 8, 0, 3], 5) == [[6, 1, 5, 5, 2], [9, 8, 0, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 1, 5, 5, 2, 9, 8, 0, 3], 5) == [[6, 1, 5, 5, 2], [9, 8, 0, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002756", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(2973) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2973) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002757", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(926) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(926) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002758", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([8, 39, 33, 41, 32, 42, 20, 41]) == [8, 20, 32, 33, 39, 41, 41, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([8, 39, 33, 41, 32, 42, 20, 41]) == [8, 20, 32, 33, 39, 41, 41, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002759", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(23, 7) == 161\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 7) == 161\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002760", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('11 * 8 * (7 * 1)') == 616\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('11 * 8 * (7 * 1)') == 616\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002761", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbcccabc', 'bbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbcccabc', 'bbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002762", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(364) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(364) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002763", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('XIII') == 13\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XIII') == 13\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002764", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['abcz', 'abcz', 'abc']) == 'abc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abcz', 'abcz', 'abc']) == 'abc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002765", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the! the, Cat sun, the ran Ran sat Sat') == {'the': 3, 'cat': 1, 'sun': 1, 'ran': 2, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the! the, Cat sun, the ran Ran sat Sat') == {'the': 3, 'cat': 1, 'sun': 1, 'ran': 2, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002766", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([7, 3]) == 10\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([7, 3]) == 10\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002767", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 25, 'd': 35, 'c': 54, 'b': 96}) == {25: 'f', 35: 'd', 54: 'c', 96: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 25, 'd': 35, 'c': 54, 'b': 96}) == {25: 'f', 35: 'd', 54: 'c', 96: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002768", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baaabbbaabaa', 'ab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaabbbaabaa', 'ab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002769", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-20, -14, 6, 16, 17, -2]) == 3\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, -14, 6, 16, 17, -2]) == 3\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002770", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(88) == [2, 2, 2, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(88) == [2, 2, 2, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002771", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=755; path=auto; port=auto; user=464') == {'host': '755', 'path': 'auto', 'port': 'auto', 'user': '464'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=755; path=auto; port=auto; user=464') == {'host': '755', 'path': 'auto', 'port': 'auto', 'user': '464'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002772", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 0, 6], [4, 0, 5, 7, 8, 7, 2]) == [2, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 0, 6], [4, 0, 5, 7, 8, 7, 2]) == [2, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002773", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 1, 3, 6, 2, 2, 8, 7], 8) == [6, 1, 3, 6, 2, 2, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 1, 3, 6, 2, 2, 8, 7], 8) == [6, 1, 3, 6, 2, 2, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002774", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('cat the Sun the the sun dog!') == {'cat': 1, 'the': 3, 'sun': 2, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat the Sun the the sun dog!') == {'cat': 1, 'the': 3, 'sun': 2, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002775", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(3836) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3836) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002776", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(53, 42) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(53, 42) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002777", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[1, 2, 6, 7], [8, 8, 0, 2], [5, 9, 0, 4]]) == [[1, 8, 5], [2, 8, 9], [6, 0, 0], [7, 2, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 2, 6, 7], [8, 8, 0, 2], [5, 9, 0, 4]]) == [[1, 8, 5], [2, 8, 9], [6, 0, 0], [7, 2, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002778", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([3, 2, 6, 8, 4, 6, 3, 9, 3, 4], 3) == [[3, 2, 6], [8, 4, 6], [3, 9, 3], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 2, 6, 8, 4, 6, 3, 9, 3, 4], 3) == [[3, 2, 6], [8, 4, 6], [3, 9, 3], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002779", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('ac,11,bbbab,\",,a\",\",b\"') == ['ac', '11', 'bbbab', ',,a', ',b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ac,11,bbbab,\",,a\",\",b\"') == ['ac', '11', 'bbbab', ',,a', ',b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002780", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([33, 0, 10, 33, 22]) == [0, 10, 22, 33, 33]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([33, 0, 10, 33, 22]) == [0, 10, 22, 33, 33]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002781", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([2, 7, 4, 1], 3) == [[2, 7, 4], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 7, 4, 1], 3) == [[2, 7, 4], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002782", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[3, -6], [-8, -8], [9, -2], [-9, 0]], [[3, 4], [2, -6], [-3, 3], [-4, -2]]) == [[6, -2], [-6, -14], [6, 1], [-13, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -6], [-8, -8], [9, -2], [-9, 0]], [[3, 4], [2, -6], [-3, 3], [-4, -2]]) == [[6, -2], [-6, -14], [6, 1], [-13, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002783", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(324) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(324) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002784", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'avocado', 'cherry', 'coconut', 'banana', 'berry', 'banana']) == {'b': ['berry', 'banana', 'berry', 'banana'], 'a': ['avocado'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'avocado', 'cherry', 'coconut', 'banana', 'berry', 'banana']) == {'b': ['berry', 'banana', 'berry', 'banana'], 'a': ['avocado'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002785", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 5, 2, 2, 4, 1, 3, 3, 2]) == [0, 5, 2, 4, 1, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 2, 2, 4, 1, 3, 3, 2]) == [0, 5, 2, 4, 1, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002786", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([3, 20], [1, 3, 6, 12, 14, 18, 19]) == [1, 3, 3, 6, 12, 14, 18, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 20], [1, 3, 6, 12, 14, 18, 19]) == [1, 3, 3, 6, 12, 14, 18, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002787", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([4, 7, 12, 11, 23, 13, 26]) == [4, 7, 11, 12, 13, 23, 26]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 7, 12, 11, 23, 13, 26]) == [4, 7, 11, 12, 13, 23, 26]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002788", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('18') == 18\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('18') == 18\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002789", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(126)\nacc.deposit(164)\nacc.withdraw(196)\nacc.withdraw(430)\nassert acc.get_balance() == 290\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(126)\nacc.deposit(164)\nassert acc.get_balance() == 290\nacc.withdraw(196)\nassert acc.get_balance() == 94\nacc.withdraw(430)\nassert acc.get_balance() == 94\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002790", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5], 0, [3, 2], 7]) == [5, 0, 3, 2, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], 0, [3, 2], 7]) == [5, 0, 3, 2, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002791", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=691; path=619; user=off') == {'mode': '691', 'path': '619', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=691; path=619; user=off') == {'mode': '691', 'path': '619', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002792", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'b', 'd', 'e', 'a', 'b', 'd', 'a']) == {'a': 3, 'b': 2, 'd': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'd', 'e', 'a', 'b', 'd', 'a']) == {'a': 3, 'b': 2, 'd': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002793", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[2, -5, -3], [6, 4, 9], [-9, 9, -3]], [[-8, 2, -3], [-6, -1, -5], [9, 8, 8]]) == [[-6, -3, -6], [0, 3, 4], [0, 17, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -5, -3], [6, 4, 9], [-9, 9, -3]], [[-8, 2, -3], [-6, -1, -5], [9, 8, 8]]) == [[-6, -3, -6], [0, 3, 4], [0, 17, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002794", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([26, 0, 3, 40, 32, 38, 10]) == [0, 3, 10, 26, 32, 38, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([26, 0, 3, 40, 32, 38, 10]) == [0, 3, 10, 26, 32, 38, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002795", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-1, -2, 2], [-6, 8, 2], [9, 5, 6]], [[4, -7, -7], [-5, 2, 1], [-9, -4, -5]]) == [[3, -9, -5], [-11, 10, 3], [0, 1, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -2, 2], [-6, 8, 2], [9, 5, 6]], [[4, -7, -7], [-5, 2, 1], [-9, -4, -5]]) == [[3, -9, -5], [-11, 10, 3], [0, 1, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002796", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9198) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9198) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002797", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 1, 'b': 8, 'd': 2, 'e': 5}, 6) == {'b': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 1, 'b': 8, 'd': 2, 'e': 5}, 6) == {'b': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002798", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat! ran, dog dog sun sun') == {'cat': 1, 'ran': 1, 'dog': 2, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat! ran, dog dog sun sun') == {'cat': 1, 'ran': 1, 'dog': 2, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002799", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'w': 7, 'z': 9}, {'w': 1, 'x': 4, 'y': 9}) == {'x': 7, 'w': 8, 'z': 9, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'w': 7, 'z': 9}, {'w': 1, 'x': 4, 'y': 9}) == {'x': 7, 'w': 8, 'z': 9, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002800", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran dog the sat') == {'ran': 1, 'dog': 1, 'the': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog the sat') == {'ran': 1, 'dog': 1, 'the': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002801", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('DCCLXXIII') == 773\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DCCLXXIII') == 773\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002802", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(8706) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8706) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002803", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(286) == [2, 11, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(286) == [2, 11, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002804", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(4219) == 16\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4219) == 16\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002805", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 1, 1, 7, 7], 3) == [[1, 1, 1], [7, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 1, 1, 7, 7], 3) == [[1, 1, 1], [7, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002806", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('byimnztpt') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('byimnztpt') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002807", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[9]], 7, 7]) == 23\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[9]], 7, 7]) == 23\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002808", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=106; user=off; port=581') == {'path': '106', 'user': 'off', 'port': '581'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=106; user=off; port=581') == {'path': '106', 'user': 'off', 'port': '581'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002809", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('add') == 'a1d2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('add') == 'a1d2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002810", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CDLII') == 452\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLII') == 452\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002811", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=off; mode=auto') == {'user': 'off', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; mode=auto') == {'user': 'off', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002812", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(915) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(915) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002813", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{()](}(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{()](}(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002814", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(17, 2) == 34\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 2) == 34\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002815", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('dd,56,ecc,dca') == ['dd', '56', 'ecc', 'dca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dd,56,ecc,dca') == ['dd', '56', 'ecc', 'dca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002816", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(4296) == 6924\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4296) == 6924\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002817", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(7468) == 86\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7468) == 86\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002818", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('c eebb') == 'C Eebb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('c eebb') == 'C Eebb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002819", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran Dog dog sun sun dog') == {'ran': 1, 'dog': 3, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran Dog dog sun sun dog') == {'ran': 1, 'dog': 3, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002820", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 3, 5, 1, 0], [8, 3, 0, 9, 0, 5, 4, 8]) == [8, 3, 5, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 3, 5, 1, 0], [8, 3, 0, 9, 0, 5, 4, 8]) == [8, 3, 5, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002821", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat Cat the! sun ran! ran sat! sat cat ran') == {'cat': 3, 'the': 1, 'sun': 1, 'ran': 3, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat Cat the! sun ran! ran sat! sat cat ran') == {'cat': 3, 'the': 1, 'sun': 1, 'ran': 3, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002822", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 6, 'x': 4}, {'w': 5, 'z': 6, 'y': 9}) == {'z': 12, 'x': 4, 'w': 5, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 6, 'x': 4}, {'w': 5, 'z': 6, 'y': 9}) == {'z': 12, 'x': 4, 'w': 5, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002823", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 71, 'b': 5, 'c': 17, 'f': 51, 'd': 30}) == {71: 'a', 5: 'b', 17: 'c', 51: 'f', 30: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 71, 'b': 5, 'c': 17, 'f': 51, 'd': 30}) == {71: 'a', 5: 'b', 17: 'c', 51: 'f', 30: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002824", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=656; path=281') == {'host': '656', 'path': '281'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=656; path=281') == {'host': '656', 'path': '281'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002825", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=off; user=559; port=855') == {'host': 'off', 'user': '559', 'port': '855'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=off; user=559; port=855') == {'host': 'off', 'user': '559', 'port': '855'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002826", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=318; path=120; user=auto; port=off') == {'host': '318', 'path': '120', 'user': 'auto', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=318; path=120; user=auto; port=off') == {'host': '318', 'path': '120', 'user': 'auto', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002827", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[3, -1, -2], [1, 9, -2], [2, 5, 5], [3, 6, -2]], [[9, 5, -5], [-7, -9, -7], [-1, 9, 8], [-5, -1, 3]]) == [[12, 4, -7], [-6, 0, -9], [1, 14, 13], [-2, 5, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -1, -2], [1, 9, -2], [2, 5, 5], [3, 6, -2]], [[9, 5, -5], [-7, -9, -7], [-1, 9, 8], [-5, -1, 3]]) == [[12, 4, -7], [-6, 0, -9], [1, 14, 13], [-2, 5, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002828", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[6, 3, 1, 5], [4, 2, 4, 8], [6, 3, 5, 1]]) == [[6, 4, 6], [3, 2, 3], [1, 4, 5], [5, 8, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 3, 1, 5], [4, 2, 4, 8], [6, 3, 5, 1]]) == [[6, 4, 6], [3, 2, 3], [1, 4, 5], [5, 8, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002829", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[2, 5, 0], [3, 9, 4], [5, 7, 1], [1], [7, 7, 9, 2]]) == [2, 5, 0, 3, 9, 4, 5, 7, 1, 1, 7, 7, 9, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 5, 0], [3, 9, 4], [5, 7, 1], [1], [7, 7, 9, 2]]) == [2, 5, 0, 3, 9, 4, 5, 7, 1, 1, 7, 7, 9, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002830", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 5, 7, 8, 3, 6, 8], 3) == [[2, 5, 7], [8, 3, 6], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 7, 8, 3, 6, 8], 3) == [[2, 5, 7], [8, 3, 6], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002831", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(37); s.push(23); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(37); s.push(23); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 23\nassert s.is_empty() == False\nassert s.pop() == 37\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002832", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(283)\nacc.deposit(298)\nacc.withdraw(210)\nacc.withdraw(605)\nassert acc.get_balance() == 581\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(283)\nacc.deposit(298)\nassert acc.get_balance() == 581\nacc.withdraw(210)\nassert acc.get_balance() == 371\nacc.withdraw(605)\nassert acc.get_balance() == 371\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002833", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaabbbc') == 'a4b3c1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaabbbc') == 'a4b3c1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002834", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([2, [4], [7, 8, 7], [9, 3], 4]) == [2, 4, 7, 8, 7, 9, 3, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, [4], [7, 8, 7], [9, 3], 4]) == [2, 4, 7, 8, 7, 9, 3, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002835", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'b', 'c', 'c', 'e', 'e', 'a', 'b', 'c']) == {'e': 3, 'b': 2, 'c': 3, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'c', 'c', 'e', 'e', 'a', 'b', 'c']) == {'e': 3, 'b': 2, 'c': 3, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002836", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(4, 12) == 16777216\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 12) == 16777216\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002837", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(26, 33, 29) == 18\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(26, 33, 29) == 18\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002838", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(6, 12, 250) == 86\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(6, 12, 250) == 86\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002839", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(56)\nacc.deposit(78)\nacc.withdraw(100)\nacc.withdraw(195)\nassert acc.get_balance() == 134\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(56)\nacc.deposit(78)\nassert acc.get_balance() == 134\nacc.withdraw(100)\nassert acc.get_balance() == 34\nacc.withdraw(195)\nassert acc.get_balance() == 34\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002840", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 1, 1, 4, 4, 4, 5]) == [5, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 1, 4, 4, 4, 5]) == [5, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002841", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([2, 49, 80, 94], 184) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 49, 80, 94], 184) == -1\nassert binary_search([2, 49, 80, 94], 2) == 0\nassert binary_search([2, 49, 80, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002842", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-3, 3], [-7, -6]], [[-3, -9], [7, -1]]) == [[-6, -6], [0, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 3], [-7, -6]], [[-3, -9], [7, -1]]) == [[-6, -6], [0, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002843", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-5, -2], [-3, -1], [-7, -7]], [[3, -6], [4, -4], [1, -3]]) == [[-2, -8], [1, -5], [-6, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -2], [-3, -1], [-7, -7]], [[3, -6], [4, -4], [1, -3]]) == [[-2, -8], [1, -5], [-6, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002844", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(25) == 23\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(25) == 23\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002845", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([12, 14, 33, 34, 56, 81, 82, 95], 56) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([12, 14, 33, 34, 56, 81, 82, 95], 56) == 4\nassert binary_search([12, 14, 33, 34, 56, 81, 82, 95], 12) == 0\nassert binary_search([12, 14, 33, 34, 56, 81, 82, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002846", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['avocado', 'berry', 'avocado', 'cherry', 'apple']) == {'a': ['avocado', 'avocado', 'apple'], 'b': ['berry'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'berry', 'avocado', 'cherry', 'apple']) == {'a': ['avocado', 'avocado', 'apple'], 'b': ['berry'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002847", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(3777) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3777) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002848", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(802) == 'DCCCII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(802) == 'DCCCII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002849", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('aaccyfxzvkcko') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('aaccyfxzvkcko') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002850", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([4, 7, 8, 11, 12], [10, 13]) == [4, 7, 8, 10, 11, 12, 13]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 7, 8, 11, 12], [10, 13]) == [4, 7, 8, 10, 11, 12, 13]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002851", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('acdedaa', 'aadacde') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acdedaa', 'aadacde') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002852", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('dddec', 'deddc') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dddec', 'deddc') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002853", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(34, 131, 183) == 34\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(34, 131, 183) == 34\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002854", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('acaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('acaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002855", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=off; host=873') == {'mode': 'off', 'host': '873'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=off; host=873') == {'mode': 'off', 'host': '873'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002856", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bacbbccacaabcabb', 'ccac') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bacbbccacaabcabb', 'ccac') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002857", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('cat, dog ran sat! sat sat.') == {'cat': 1, 'dog': 1, 'ran': 1, 'sat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat, dog ran sat! sat sat.') == {'cat': 1, 'dog': 1, 'ran': 1, 'sat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002858", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, 0], [8, 3]], [[-2, -4], [1, -9]]) == [[-9, -4], [9, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 0], [8, 3]], [[-2, -4], [1, -9]]) == [[-9, -4], [9, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002859", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-5, -1, 7], [9, 7, -1]], [[0, -9, 4], [2, 2, 6]]) == [[-5, -10, 11], [11, 9, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -1, 7], [9, 7, -1]], [[0, -9, 4], [2, 2, 6]]) == [[-5, -10, 11], [11, 9, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002860", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(6192) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6192) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002861", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"ab,,\",bca,\",aab\",ebca') == ['ab,,', 'bca', ',aab', 'ebca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"ab,,\",bca,\",aab\",ebca') == ['ab,,', 'bca', ',aab', 'ebca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002862", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 6, 6, 9, 14, 17], [0, 6, 11, 14, 16]) == [0, 0, 6, 6, 6, 9, 11, 14, 14, 16, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 6, 6, 9, 14, 17], [0, 6, 11, 14, 16]) == [0, 0, 6, 6, 6, 9, 11, 14, 14, 16, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002863", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([6, 3, -7, 2]) == [6, 9, 2, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([6, 3, -7, 2]) == [6, 9, 2, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002864", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('bdd ccba aae') == 'Bdd Ccba Aae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bdd ccba aae') == 'Bdd Ccba Aae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002865", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMMCCCLXXIV') == 3374\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMCCCLXXIV') == 3374\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002866", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([7, 34, 27, 0, 44, 4, 30]) == [0, 4, 7, 27, 30, 34, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 34, 27, 0, 44, 4, 30]) == [0, 4, 7, 27, 30, 34, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002867", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('cf hfa ae fcbedddc da ecec') == 'fcbedddc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('cf hfa ae fcbedddc da ecec') == 'fcbedddc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002868", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('b})b}}b{') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b})b}}b{') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002869", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(7763) == 3677\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7763) == 3677\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002870", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([9, 14, 39, 47, 45, 21, 16, 28, 11, 48]) == [9, 11, 14, 16, 21, 28, 39, 45, 47, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([9, 14, 39, 47, 45, 21, 16, 28, 11, 48]) == [9, 11, 14, 16, 21, 28, 39, 45, 47, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002871", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([0, 4, 7, 9, 10, 11, 18], [3, 5, 11, 12, 20, 20]) == [0, 3, 4, 5, 7, 9, 10, 11, 11, 12, 18, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 4, 7, 9, 10, 11, 18], [3, 5, 11, 12, 20, 20]) == [0, 3, 4, 5, 7, 9, 10, 11, 11, 12, 18, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002872", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[5, 4], [9, 2], [0, 0], [6, 1]]) == [[5, 9, 0, 6], [4, 2, 0, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 4], [9, 2], [0, 0], [6, 1]]) == [[5, 9, 0, 6], [4, 2, 0, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002873", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-7, -6, 2, 5]) == [-7, -13, -11, -6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -6, 2, 5]) == [-7, -13, -11, -6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002874", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(473)\nacc.deposit(62)\nacc.withdraw(141)\nacc.withdraw(561)\nassert acc.get_balance() == 535\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(473)\nacc.deposit(62)\nassert acc.get_balance() == 535\nacc.withdraw(141)\nassert acc.get_balance() == 394\nacc.withdraw(561)\nassert acc.get_balance() == 394\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002875", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(21) == [3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(21) == [3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002876", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(42, 111, 342) == 216\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(42, 111, 342) == 216\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002877", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ddddd') == 'd5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddd') == 'd5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002878", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[8, 9, 6]], 5, 2]) == 30\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[8, 9, 6]], 5, 2]) == 30\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002879", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-9, 4, 4]) == [-9, -5, -1]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-9, 4, 4]) == [-9, -5, -1]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002880", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(50, 199, 440) == 200\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(50, 199, 440) == 200\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002881", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran sun! sat sat sat sat cat sat') == {'ran': 1, 'sun': 1, 'sat': 5, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sun! sat sat sat sat cat sat') == {'ran': 1, 'sun': 1, 'sat': 5, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002882", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('ababaaa', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababaaa', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002883", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 16, 'a': 25, 'c': 98, 'b': 77, 'd': 35}) == {16: 'f', 25: 'a', 98: 'c', 77: 'b', 35: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 16, 'a': 25, 'c': 98, 'b': 77, 'd': 35}) == {16: 'f', 25: 'a', 98: 'c', 77: 'b', 35: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002884", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 6}, {'z': 3}) == {'w': 6, 'z': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6}, {'z': 3}) == {'w': 6, 'z': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002885", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([38, 11, 19, -25]) == 38\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([38, 11, 19, -25]) == 38\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002886", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1078) == 8701\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1078) == 8701\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002887", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('b[[b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b[[b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002888", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'coconut', 'coconut', 'banana', 'coconut', 'apple', 'date']) == {'c': ['cherry', 'coconut', 'coconut', 'coconut'], 'b': ['banana'], 'a': ['apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'coconut', 'coconut', 'banana', 'coconut', 'apple', 'date']) == {'c': ['cherry', 'coconut', 'coconut', 'coconut'], 'b': ['banana'], 'a': ['apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002889", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('dog! ran Ran the sat, Sat cat The') == {'dog': 1, 'ran': 2, 'the': 2, 'sat': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog! ran Ran the sat, Sat cat The') == {'dog': 1, 'ran': 2, 'the': 2, 'sat': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002890", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat sun the! cat, sun') == {'cat': 2, 'sun': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sun the! cat, sun') == {'cat': 2, 'sun': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002891", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ece', 'ece') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ece', 'ece') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002892", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([2, 5, 7, 4, 2, 3, 7, 8, 7], 15) == [4, 2, 3, 7, 8, 7, 2, 5, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 5, 7, 4, 2, 3, 7, 8, 7], 15) == [4, 2, 3, 7, 8, 7, 2, 5, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002893", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=off; host=on; user=223; mode=737') == {'path': 'off', 'host': 'on', 'user': '223', 'mode': '737'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; host=on; user=223; mode=737') == {'path': 'off', 'host': 'on', 'user': '223', 'mode': '737'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002894", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 0, 8, 1], 5) == [[4, 0, 8, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 0, 8, 1], 5) == [[4, 0, 8, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002895", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([4, 12], [4]) == [4, 4, 12]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 12], [4]) == [4, 4, 12]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002896", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(3630) == 363\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3630) == 363\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002897", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([2, 3, 13, 14, 20], [9, 9]) == [2, 3, 9, 9, 13, 14, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 3, 13, 14, 20], [9, 9]) == [2, 3, 9, 9, 13, 14, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002898", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(955) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(955) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002899", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[1], [5, 0]]) == [1, 5, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1], [5, 0]]) == [1, 5, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002900", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('vzudnj') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('vzudnj') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002901", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([0, 12], [12]) == [0, 12, 12]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 12], [12]) == [0, 12, 12]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002902", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('abda aacad bea a') == 'Abda Aacad Bea A'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abda aacad bea a') == 'Abda Aacad Bea A'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002903", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMMLXXV') == 3075\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMLXXV') == 3075\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002904", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([5, 28, 3, 6, 4, 25]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 28, 3, 6, 4, 25]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002905", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[3, 4], [2, 6, 1], [5]], [0, [0, 6]], 4]) == 31\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[3, 4], [2, 6, 1], [5]], [0, [0, 6]], 4]) == 31\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002906", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('acdbbbbc') == 'acdb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acdbbbbc') == 'acdb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002907", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbbbbaaabab', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbaaabab', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002908", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'c': 4, 'b': 4, 'a': 6}, 6) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 4, 'b': 4, 'a': 6}, 6) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002909", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CXLI') == 141\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXLI') == 141\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002910", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code', 25) == 'Bncd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 25) == 'Bncd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002911", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[1, 1, 4], 2, [8, 6, 1, 1], 1]) == [1, 1, 4, 2, 8, 6, 1, 1, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 1, 4], 2, [8, 6, 1, 1], 1]) == [1, 1, 4, 2, 8, 6, 1, 1, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002912", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 9, 'e': 1, 'd': 7}, 3) == {'c': 9, 'd': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 9, 'e': 1, 'd': 7}, 3) == {'c': 9, 'd': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002913", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('befbzdcx') == 'xcdzbfeb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('befbzdcx') == 'xcdzbfeb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002914", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([3, -7]) == [3, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, -7]) == [3, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002915", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h46m') == 20760\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h46m') == 20760\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002916", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 58, 'c': 6, 'f': 97}) == {58: 'b', 6: 'c', 97: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 58, 'c': 6, 'f': 97}) == {58: 'b', 6: 'c', 97: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002917", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(8 * 6 - (10 - 15))') == 53\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(8 * 6 - (10 - 15))') == 53\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002918", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('World Hello', 8) == 'Ewztl Pmttw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Hello', 8) == 'Ewztl Pmttw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002919", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('ba') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('ba') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002920", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('4h11m59s') == 15119\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h11m59s') == 15119\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002921", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([30, 38, 11, 48]) == [11, 30, 38, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 38, 11, 48]) == [11, 30, 38, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002922", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 7, 'b': 30}) == {7: 'a', 30: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 7, 'b': 30}) == {7: 'a', 30: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002923", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('ryjzsmeui') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ryjzsmeui') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002924", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'b': 9, 'c': 5, 'd': 2}, 3) == {'b': 9, 'c': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 9, 'c': 5, 'd': 2}, 3) == {'b': 9, 'c': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002925", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('baaaaa', 'babb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaaaa', 'babb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002926", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[7, -6], [0, -4], [2, 5], [-8, -7]], [[8, -8], [-5, 1], [-1, 1], [-8, 1]]) == [[15, -14], [-5, -3], [1, 6], [-16, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, -6], [0, -4], [2, 5], [-8, -7]], [[8, -8], [-5, 1], [-1, 1], [-8, 1]]) == [[15, -14], [-5, -3], [1, 6], [-16, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002927", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(755) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(755) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002928", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(1510) == 7\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1510) == 7\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002929", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 1, 1, 4, 5]) == [1, 4, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 1, 4, 5]) == [1, 4, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002930", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[3, -6, -7], [-3, -6, 3]], [[3, 2, 4], [5, 4, -1]]) == [[6, -4, -3], [2, -2, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -6, -7], [-3, -6, 3]], [[3, 2, 4], [5, 4, -1]]) == [[6, -4, -3], [2, -2, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002931", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(21); s.push(67); s.push(72)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(21); s.push(67); s.push(72)\nassert s.peek() == 72\nassert s.pop() == 72\nassert s.pop() == 67\nassert s.is_empty() == False\nassert s.pop() == 21\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002932", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('b,96') == ['b', '96']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('b,96') == ['b', '96']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002933", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(174)\nacc.deposit(226)\nacc.withdraw(113)\nacc.withdraw(552)\nassert acc.get_balance() == 400\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(174)\nacc.deposit(226)\nassert acc.get_balance() == 400\nacc.withdraw(113)\nassert acc.get_balance() == 287\nacc.withdraw(552)\nassert acc.get_balance() == 287\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002934", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 1}, {'y': 8, 'x': 3, 'z': 7}) == {'z': 8, 'y': 8, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1}, {'y': 8, 'x': 3, 'z': 7}) == {'z': 8, 'y': 8, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002935", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(65) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(65) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002936", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(7); s.push(68); s.push(1)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(7); s.push(68); s.push(1)\nassert s.peek() == 1\nassert s.pop() == 1\nassert s.pop() == 68\nassert s.is_empty() == False\nassert s.pop() == 7\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002937", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[0, 5], [8, 3], [6, 9]]) == [[0, 8, 6], [5, 3, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 5], [8, 3], [6, 9]]) == [[0, 8, 6], [5, 3, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002938", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([20, 14, 24, 12, 3]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 14, 24, 12, 3]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002939", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('d egcf') == 'egcf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('d egcf') == 'egcf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002940", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(70) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(70) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002941", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-29, 49, -9, -34]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-29, 49, -9, -34]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002942", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([3, 9, 1, 5, 3, 3, 0, 8, 0], 5) == [[3, 9, 1, 5, 3], [3, 0, 8, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 9, 1, 5, 3, 3, 0, 8, 0], 5) == [[3, 9, 1, 5, 3], [3, 0, 8, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002943", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abbabaabba', 'aabb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbabaabba', 'aabb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_002944", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([5, 6, 6, 7], 2) == [6, 7, 5, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 6, 6, 7], 2) == [6, 7, 5, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002945", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(439) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(439) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002946", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([49, 30, 48, 28]) == [28, 30, 48, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([49, 30, 48, 28]) == [28, 30, 48, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002947", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(8349) == 9438\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8349) == 9438\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002948", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('bec bbddea cdeb') == 'Bec Bbddea Cdeb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bec bbddea cdeb') == 'Bec Bbddea Cdeb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002949", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CDXXXI') == 431\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXXI') == 431\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002950", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 2, 3], [4, 1, 4], [4, 2, 1]], [[3, 5, 1], [3, 1, 1], [5, 0, 1]]) == [[33, 22, 9], [35, 21, 9], [23, 22, 7]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2, 3], [4, 1, 4], [4, 2, 1]], [[3, 5, 1], [3, 1, 1], [5, 0, 1]]) == [[33, 22, 9], [35, 21, 9], [23, 22, 7]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002951", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('({})') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('({})') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002952", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MMCDXLVIII') == 2448\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCDXLVIII') == 2448\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002953", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['c', 'b', 'd', 'b', 'c', 'c']) == {'c': 3, 'b': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'b', 'd', 'b', 'c', 'c']) == {'c': 3, 'b': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002954", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([3, 31, 98], 101) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 31, 98], 101) == -1\nassert binary_search([3, 31, 98], 3) == 0\nassert binary_search([3, 31, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002955", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun Sun dog. dog') == {'sun': 2, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun Sun dog. dog') == {'sun': 2, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002956", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(311) == 'CCCXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(311) == 'CCCXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002957", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran, cat sun! sat, cat sat sat sun') == {'ran': 1, 'cat': 2, 'sun': 2, 'sat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran, cat sun! sat, cat sat sat sun') == {'ran': 1, 'cat': 2, 'sun': 2, 'sat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002958", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('dog sun dog the sun cat ran') == {'dog': 2, 'sun': 2, 'the': 1, 'cat': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sun dog the sun cat ran') == {'dog': 2, 'sun': 2, 'the': 1, 'cat': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002959", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(5942) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5942) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002960", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[2, 2, 1], 7, [6, 4, 6]]) == 28\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, 2, 1], 7, [6, 4, 6]]) == 28\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002961", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([26, 5, 7, 18, 26, 26]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 5, 7, 18, 26, 26]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002962", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([15, 37, 38, 69, 81, 87, 88], 135) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 37, 38, 69, 81, 87, 88], 135) == -1\nassert binary_search([15, 37, 38, 69, 81, 87, 88], 15) == 0\nassert binary_search([15, 37, 38, 69, 81, 87, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002963", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 44, 'e': 43, 'b': 17, 'd': 39}) == {44: 'c', 43: 'e', 17: 'b', 39: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 44, 'e': 43, 'b': 17, 'd': 39}) == {44: 'c', 43: 'e', 17: 'b', 39: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002964", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 6, 10, 16], [0, 12, 12]) == [0, 0, 6, 10, 12, 12, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 6, 10, 16], [0, 12, 12]) == [0, 0, 6, 10, 12, 12, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002965", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('cccccccc') == 'c8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccccc') == 'c8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002966", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([9, 19, 38, 39], 166) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([9, 19, 38, 39], 166) == -1\nassert binary_search([9, 19, 38, 39], 9) == 0\nassert binary_search([9, 19, 38, 39], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002967", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 9, 'z': 4, 'x': 7}, {'y': 1}) == {'y': 10, 'z': 4, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9, 'z': 4, 'x': 7}, {'y': 1}) == {'y': 10, 'z': 4, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002968", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([15, 28, 30, 40, 74, 90], 30) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 28, 30, 40, 74, 90], 30) == 2\nassert binary_search([15, 28, 30, 40, 74, 90], 15) == 0\nassert binary_search([15, 28, 30, 40, 74, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002969", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('aee,bcea,ab') == ['aee', 'bcea', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aee,bcea,ab') == ['aee', 'bcea', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002970", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aacccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aacccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002971", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(17) == 12\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(17) == 12\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002972", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('jgxt') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('jgxt') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002973", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-8, -7, 0, -8, 8]) == [-8, -15, -15, -23, -15]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, -7, 0, -8, 8]) == [-8, -15, -15, -23, -15]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002974", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-20, -1, -11, -11, 11]) == -32\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, -1, -11, -11, 11]) == -32\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002975", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(65); s.push(91); s.push(36)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(65); s.push(91); s.push(36)\nassert s.peek() == 36\nassert s.pop() == 36\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 65\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002976", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(2506) == 6052\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2506) == 6052\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002977", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(9, 4) == 6561\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 4) == 6561\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002978", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('fchgbbg fbhf ag be hcaeeac') == 'fchgbbg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fchgbbg fbhf ag be hcaeeac') == 'fchgbbg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002979", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(120)\nacc.deposit(240)\nacc.withdraw(99)\nacc.withdraw(428)\nassert acc.get_balance() == 360\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(120)\nacc.deposit(240)\nassert acc.get_balance() == 360\nacc.withdraw(99)\nassert acc.get_balance() == 261\nacc.withdraw(428)\nassert acc.get_balance() == 261\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002980", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([46, 40, 33, 35, 30, 26]) == [26, 30, 33, 35, 40, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 40, 33, 35, 30, 26]) == [26, 30, 33, 35, 40, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002981", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 50, 'a': 82, 'c': 18}) == {50: 'e', 82: 'a', 18: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 50, 'a': 82, 'c': 18}) == {50: 'e', 82: 'a', 18: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002982", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('14') == 14\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('14') == 14\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_002983", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bcbaccabccacb', 'acac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcbaccabccacb', 'acac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_002984", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([16, 44, 43, 5, 26, 23]) == [5, 16, 23, 26, 43, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([16, 44, 43, 5, 26, 23]) == [5, 16, 23, 26, 43, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002985", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(2564) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2564) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002986", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 31, 'b': 48, 'c': 95}) == {31: 'f', 48: 'b', 95: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 31, 'b': 48, 'c': 95}) == {31: 'f', 48: 'b', 95: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002987", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(13, 25) == 325\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 25) == 325\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002988", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([50, 3, 34, 39]) == [3, 34, 39, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([50, 3, 34, 39]) == [3, 34, 39, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002989", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-9, -6], [-4, -6], [6, 7]], [[-5, -3], [2, -6], [0, -8]]) == [[-14, -9], [-2, -12], [6, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -6], [-4, -6], [6, 7]], [[-5, -3], [2, -6], [0, -8]]) == [[-14, -9], [-2, -12], [6, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002990", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-28, 36, -18]) == 36\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-28, 36, -18]) == 36\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002991", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['b', 'd', 'd', 'd']) == {'b': 1, 'd': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'd', 'd', 'd']) == {'b': 1, 'd': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002992", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[5, [9, 2, 2], 6], 9]) == [5, 9, 2, 2, 6, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, [9, 2, 2], 6], 9]) == [5, 9, 2, 2, 6, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002993", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-7, -7, 6, 3, 5, -8, 4, 8]) == [-7, -14, -8, -5, 0, -8, -4, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -7, 6, 3, 5, -8, 4, 8]) == [-7, -14, -8, -5, 0, -8, -4, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002994", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0, 7, 8, 3], 9, 1, [0, 5], [8, 3, 8, 6]]) == [0, 7, 8, 3, 9, 1, 0, 5, 8, 3, 8, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 7, 8, 3], 9, 1, [0, 5], [8, 3, 8, 6]]) == [0, 7, 8, 3, 9, 1, 0, 5, 8, 3, 8, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002995", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 5, 17, 19, 19, 20, 20], [2, 4, 7, 8, 11]) == [0, 2, 4, 5, 7, 8, 11, 17, 19, 19, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 5, 17, 19, 19, 20, 20], [2, 4, 7, 8, 11]) == [0, 2, 4, 5, 7, 8, 11, 17, 19, 19, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_002996", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([18, 38, 47, 49, 75, 76, 79], 187) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([18, 38, 47, 49, 75, 76, 79], 187) == -1\nassert binary_search([18, 38, 47, 49, 75, 76, 79], 18) == 0\nassert binary_search([18, 38, 47, 49, 75, 76, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002997", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 2, 0, 4, 3, 2, 0]) == [1, 2, 0, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 0, 4, 3, 2, 0]) == [1, 2, 0, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_002998", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(35, 0, 303) == 1\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(35, 0, 303) == 1\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_002999", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(28, 177) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 177) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003000", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CVI') == 106\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CVI') == 106\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003001", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 7, 6, 8, 6, 5, 7, 7, 6, 6, 8], 3) == [[0, 7, 6], [8, 6, 5], [7, 7, 6], [6, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 7, 6, 8, 6, 5, 7, 7, 6, 6, 8], 3) == [[0, 7, 6], [8, 6, 5], [7, 7, 6], [6, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003002", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ebaeebd') == 'ebad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebaeebd') == 'ebad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003003", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'c', 'a', 'a', 'e', 'd', 'd', 'a', 'a']) == {'e': 2, 'c': 1, 'a': 4, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'c', 'a', 'a', 'e', 'd', 'd', 'a', 'a']) == {'e': 2, 'c': 1, 'a': 4, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003004", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('bceeebcadaeeaa') == 'bcead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bceeebcadaeeaa') == 'bcead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003005", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 7, 12, 15], [0, 0, 7]) == [0, 0, 0, 7, 7, 12, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 7, 12, 15], [0, 0, 7]) == [0, 0, 0, 7, 7, 12, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003006", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 49, 'd': 70, 'b': 91, 'f': 75, 'e': 68}) == {49: 'a', 70: 'd', 91: 'b', 75: 'f', 68: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 49, 'd': 70, 'b': 91, 'f': 75, 'e': 68}) == {49: 'a', 70: 'd', 91: 'b', 75: 'f', 68: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003007", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(34) == [2, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(34) == [2, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003008", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(6, 8) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 8) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003009", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(4, 12) == 16777216\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 12) == 16777216\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003010", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(29, 94, 391) == 219\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(29, 94, 391) == 219\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003011", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(10, 25) == 50\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(10, 25) == 50\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003012", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=394; user=auto; port=on') == {'mode': '394', 'user': 'auto', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=394; user=auto; port=on') == {'mode': '394', 'user': 'auto', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003013", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ebfabf', 'ebfabfe') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ebfabf', 'ebfabfe') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003014", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[2, 1], [0, 2]], [[0, 5, 0], [1, 5, 1]]) == [[1, 15, 1], [2, 10, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 1], [0, 2]], [[0, 5, 0], [1, 5, 1]]) == [[1, 15, 1], [2, 10, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003015", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 47, 'e': 5, 'd': 84}) == {47: 'a', 5: 'e', 84: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 47, 'e': 5, 'd': 84}) == {47: 'a', 5: 'e', 84: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003016", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[]{}[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{}[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003017", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 7, 3, 1], 3) == [[4, 7, 3], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 7, 3, 1], 3) == [[4, 7, 3], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003018", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(20); s.push(35); s.push(0)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(20); s.push(35); s.push(0)\nassert s.peek() == 0\nassert s.pop() == 0\nassert s.pop() == 35\nassert s.is_empty() == False\nassert s.pop() == 20\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003019", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('aeabedb') == 'aebd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aeabedb') == 'aebd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003020", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(5108) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5108) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003021", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(129) == 'CXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(129) == 'CXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003022", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('2,82,\",baa\",81') == ['2', '82', ',baa', '81']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('2,82,\",baa\",81') == ['2', '82', ',baa', '81']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003023", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(9, 20) == 180\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 20) == 180\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003024", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'apple', 'date', 'avocado', 'banana', 'coconut', 'date', 'apple']) == {'d': ['date', 'date', 'date'], 'a': ['apple', 'avocado', 'apple'], 'b': ['banana'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'date', 'avocado', 'banana', 'coconut', 'date', 'apple']) == {'d': ['date', 'date', 'date'], 'a': ['apple', 'avocado', 'apple'], 'b': ['banana'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003025", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=643; user=184') == {'port': '643', 'user': '184'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=643; user=184') == {'port': '643', 'user': '184'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003026", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(19, 14, 48) == 25\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 14, 48) == 25\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003027", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 7, 'b': 2, 'e': 0}, 3) == {'c': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 7, 'b': 2, 'e': 0}, 3) == {'c': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003028", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('({]{}(}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('({]{}(}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003029", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 6, 7, 5, 9, 3], [2, 6, 8, 1, 2, 2]) == [2, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 6, 7, 5, 9, 3], [2, 6, 8, 1, 2, 2]) == [2, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003030", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 0, 0, 2, 9], 4) == [0, 0, 2, 9, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 0, 0, 2, 9], 4) == [0, 0, 2, 9, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003031", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(33, 144, 240) == 81\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(33, 144, 240) == 81\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003032", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([43, 9, 6, 19, 9]) == [6, 9, 9, 19, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([43, 9, 6, 19, 9]) == [6, 9, 9, 19, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003033", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(158, 100) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(158, 100) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003034", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('cbcbbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbcbbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003035", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([13], [0, 1, 3, 5, 7, 18]) == [0, 1, 3, 5, 7, 13, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([13], [0, 1, 3, 5, 7, 18]) == [0, 1, 3, 5, 7, 13, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003036", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 7, 4, 8, 1, 7], [8, 0, 5, 2, 8, 7, 7, 2]) == [2, 7, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 4, 8, 1, 7], [8, 0, 5, 2, 8, 7, 7, 2]) == [2, 7, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003037", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 3, 'd': 18}) == {3: 'a', 18: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 3, 'd': 18}) == {3: 'a', 18: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003038", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([26, 3, 3, 23, 3, 24, 26]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 3, 3, 23, 3, 24, 26]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003039", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CDV') == 405\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDV') == 405\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003040", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'apple', 'cherry', 'cherry', 'cherry', 'avocado']) == {'c': ['cherry', 'cherry', 'cherry', 'cherry'], 'a': ['apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'apple', 'cherry', 'cherry', 'cherry', 'avocado']) == {'c': ['cherry', 'cherry', 'cherry', 'cherry'], 'a': ['apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003041", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(8) == 3\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(8) == 3\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003042", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 8, 8, 6, 1, 9, 6, 3], 8) == [1, 8, 8, 6, 1, 9, 6, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 8, 8, 6, 1, 9, 6, 3], 8) == [1, 8, 8, 6, 1, 9, 6, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003043", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('bb{a{[}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('bb{a{[}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003044", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('cifrdvoy') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('cifrdvoy') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003045", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(16, 10) == 80\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 10) == 80\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003046", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('LXIII') == 63\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXIII') == 63\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003047", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([34, 39, 54, 56, 63, 93], 121) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([34, 39, 54, 56, 63, 93], 121) == -1\nassert binary_search([34, 39, 54, 56, 63, 93], 34) == 0\nassert binary_search([34, 39, 54, 56, 63, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003048", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'avocado', 'apple', 'cherry', 'cherry', 'avocado']) == {'d': ['date'], 'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'avocado', 'apple', 'cherry', 'cherry', 'avocado']) == {'d': ['date'], 'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003049", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(3, 5) == 15\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(3, 5) == 15\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003050", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(13, 7) == 91\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 7) == 91\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003051", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(82, 76) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(82, 76) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003052", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('hc bdb') == 'bdb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hc bdb') == 'bdb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003053", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 1, 5, 0, 1, 0, 1, 5]) == [5, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 5, 0, 1, 0, 1, 5]) == [5, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003054", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(6769) == 9676\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6769) == 9676\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003055", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('(([]))') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(([]))') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003056", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('cbcbaabcbc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbcbaabcbc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003057", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(372) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(372) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003058", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('(b(}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(b(}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003059", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([9, 4, -22, -50, -22]) == 9\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([9, 4, -22, -50, -22]) == 9\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003060", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(905) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(905) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003061", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('acbbb', 'cc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acbbb', 'cc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003062", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(1933) == 43\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1933) == 43\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003063", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('10 + 7 + 9') == 26\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10 + 7 + 9') == 26\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003064", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'w': 8, 'y': 3}, {'x': 3, 'z': 9}) == {'z': 11, 'w': 8, 'y': 3, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'w': 8, 'y': 3}, {'x': 3, 'z': 9}) == {'z': 11, 'w': 8, 'y': 3, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003065", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('ababbbaa', 'bb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbbaa', 'bb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003066", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([35, 18, 29, 35, 36, 18]) == [18, 18, 29, 35, 35, 36]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 18, 29, 35, 36, 18]) == [18, 18, 29, 35, 35, 36]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_003067", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[6, 6, 9, 7], [6, 4, 7, 3], [6, 0, 4, 5]]) == [[6, 6, 6], [6, 4, 0], [9, 7, 4], [7, 3, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 6, 9, 7], [6, 4, 7, 3], [6, 0, 4, 5]]) == [[6, 6, 6], [6, 4, 0], [9, 7, 4], [7, 3, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003068", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-6, 11, 1, 2, 16, 20]) == 44\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, 11, 1, 2, 16, 20]) == 44\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003069", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[7, -9], [8, -9]], [[6, 0], [-6, 6]]) == [[13, -9], [2, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, -9], [8, -9]], [[6, 0], [-6, 6]]) == [[13, -9], [2, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003070", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('hpoezprsztqt') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hpoezprsztqt') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003071", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['date', 'cherry', 'cherry', 'avocado']) == {'d': ['date'], 'c': ['cherry', 'cherry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'cherry', 'avocado']) == {'d': ['date'], 'c': ['cherry', 'cherry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003072", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(180)\nacc.deposit(129)\nacc.withdraw(158)\nacc.withdraw(343)\nassert acc.get_balance() == 309\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(180)\nacc.deposit(129)\nassert acc.get_balance() == 309\nacc.withdraw(158)\nassert acc.get_balance() == 151\nacc.withdraw(343)\nassert acc.get_balance() == 151\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003073", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 8, 'w': 6}, {'w': 9, 'z': 5, 'y': 4}) == {'x': 8, 'w': 15, 'z': 5, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 8, 'w': 6}, {'w': 9, 'z': 5, 'y': 4}) == {'x': 8, 'w': 15, 'z': 5, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003074", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('efedbc', 'bfeedc') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efedbc', 'bfeedc') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003075", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-7, 1], [-7, -3], [9, -8]], [[5, -7], [1, -3], [2, 4]]) == [[-2, -6], [-6, -6], [11, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 1], [-7, -3], [9, -8]], [[5, -7], [1, -3], [2, 4]]) == [[-2, -6], [-6, -6], [11, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003076", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('baabba b cdd') == 'Baabba B Cdd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('baabba b cdd') == 'Baabba B Cdd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003077", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 6, 9, 7, 7, 0, 8], [5, 1, 3, 6, 6, 7, 2, 7]) == [7, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 6, 9, 7, 7, 0, 8], [5, 1, 3, 6, 6, 7, 2, 7]) == [7, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003078", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-5, -9], [-5, -6]], [[-3, -8], [-3, -4]]) == [[-8, -17], [-8, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -9], [-5, -6]], [[-3, -8], [-3, -4]]) == [[-8, -17], [-8, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003079", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('b[]({(]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b[]({(]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003080", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(64); s.push(27); s.push(44)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(64); s.push(27); s.push(44)\nassert s.peek() == 44\nassert s.pop() == 44\nassert s.pop() == 27\nassert s.is_empty() == False\nassert s.pop() == 64\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003081", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 7, 9, 0, 9, 7, 7], 3) == [[2, 7, 9], [0, 9, 7], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 7, 9, 0, 9, 7, 7], 3) == [[2, 7, 9], [0, 9, 7], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003082", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'd', 'e', 'b', 'e', 'c', 'c', 'e', 'b', 'a']) == {'a': 2, 'd': 1, 'e': 3, 'b': 2, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'e', 'b', 'e', 'c', 'c', 'e', 'b', 'a']) == {'a': 2, 'd': 1, 'e': 3, 'b': 2, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003083", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('caabbaac') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caabbaac') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003084", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(458402) == 677\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(458402) == 677\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003085", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([26, 14, 20, 20, 23, 20, 20]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 14, 20, 20, 23, 20, 20]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003086", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('19') == 19\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19') == 19\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003087", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([0, 4, 7, 5, 7], [7, 8, 9, 9, 9, 0]) == [0, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 4, 7, 5, 7], [7, 8, 9, 9, 9, 0]) == [0, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003088", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(7101) == 84\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7101) == 84\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003089", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('(}]a[]}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(}]a[]}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003090", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([1, 5, 4, 1, 3, 0, 2, 2, 3, 5, 5]) == [1, 5, 4, 3, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 4, 1, 3, 0, 2, 2, 3, 5, 5]) == [1, 5, 4, 3, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003091", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([1]) == [1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1]) == [1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003092", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('ecbdd', 'bcedd') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ecbdd', 'bcedd') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003093", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(19, 19) == 19\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 19) == 19\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003094", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 8, 3, 4, 4, 0], [8, 0, 9, 5, 4]) == [8, 4, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 8, 3, 4, 4, 0], [8, 0, 9, 5, 4]) == [8, 4, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003095", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 1, 8, 4, 6, 6, 4, 0, 9, 5], 2) == [[6, 1], [8, 4], [6, 6], [4, 0], [9, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 1, 8, 4, 6, 6, 4, 0, 9, 5], 2) == [[6, 1], [8, 4], [6, 6], [4, 0], [9, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003096", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 0, 1, 3, 2, 4, 1]) == [3, 0, 1, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 1, 3, 2, 4, 1]) == [3, 0, 1, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003097", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(5590) == 19\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5590) == 19\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003098", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[8, 7, 2, 7], [6, 5, 6, 0], [6, 6, 1], [4], [2]]) == [8, 7, 2, 7, 6, 5, 6, 0, 6, 6, 1, 4, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 7, 2, 7], [6, 5, 6, 0], [6, 6, 1], [4], [2]]) == [8, 7, 2, 7, 6, 5, 6, 0, 6, 6, 1, 4, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003099", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([4, 9, 6, 23]) == [4, 6, 9, 23]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 9, 6, 23]) == [4, 6, 9, 23]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003100", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('dzabd') == 'dbazd'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('dzabd') == 'dbazd'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003101", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(63); s.push(7); s.push(48)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(63); s.push(7); s.push(48)\nassert s.peek() == 48\nassert s.pop() == 48\nassert s.pop() == 7\nassert s.is_empty() == False\nassert s.pop() == 63\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003102", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('daaa') == 'd1a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('daaa') == 'd1a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003103", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(4, 16) == 16\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 16) == 16\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003104", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aaaaaaabaaa', 'ba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaaaabaaa', 'ba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003105", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(37); s.push(6); s.push(71)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(37); s.push(6); s.push(71)\nassert s.peek() == 71\nassert s.pop() == 71\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 37\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003106", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([31, 44, 49, 39, 47, 20, 13, 4]) == [4, 13, 20, 31, 39, 44, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([31, 44, 49, 39, 47, 20, 13, 4]) == [4, 13, 20, 31, 39, 44, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003107", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(3621) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3621) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003108", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(16); s.push(58); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(16); s.push(58); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 58\nassert s.is_empty() == False\nassert s.pop() == 16\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003109", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(79) == 35\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(79) == 35\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003110", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-47, 33, -45]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-47, 33, -45]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003111", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([3, 8, 3, 4, 9, 7, 5, 4, 4, 0], 5) == [[3, 8, 3, 4, 9], [7, 5, 4, 4, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 8, 3, 4, 9, 7, 5, 4, 4, 0], 5) == [[3, 8, 3, 4, 9], [7, 5, 4, 4, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003112", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([7, 4, 7, 0], 3) == [4, 7, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 4, 7, 0], 3) == [4, 7, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003113", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('dffhddah geeha eccf bhcdfh dag') == 'dffhddah'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dffhddah geeha eccf bhcdfh dag') == 'dffhddah'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003114", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(427) == 53\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(427) == 53\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003115", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[7, -9, -8], [3, 5, 5]], [[-7, -2, 1], [-8, -3, 8]]) == [[0, -11, -7], [-5, 2, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, -9, -8], [3, 5, 5]], [[-7, -2, 1], [-8, -3, 8]]) == [[0, -11, -7], [-5, 2, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003116", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'cherry', 'coconut', 'banana', 'banana', 'avocado', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['coconut', 'cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'cherry', 'coconut', 'banana', 'banana', 'avocado', 'coconut']) == {'a': ['avocado', 'avocado'], 'c': ['coconut', 'cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003117", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 89, 'b': 0, 'a': 92, 'd': 59, 'f': 90}) == {89: 'c', 0: 'b', 92: 'a', 59: 'd', 90: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 89, 'b': 0, 'a': 92, 'd': 59, 'f': 90}) == {89: 'c', 0: 'b', 92: 'a', 59: 'd', 90: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003118", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(4390) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4390) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003119", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[5, 1], [4, 4], [5, 3]], [[2, 5, 1], [1, 1, 0]]) == [[11, 26, 5], [12, 24, 4], [13, 28, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 1], [4, 4], [5, 3]], [[2, 5, 1], [1, 1, 0]]) == [[11, 26, 5], [12, 24, 4], [13, 28, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003120", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CLXVIII') == 168\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLXVIII') == 168\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003121", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(262) == [2, 131]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(262) == [2, 131]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003122", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('12m30s') == 750\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('12m30s') == 750\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003123", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'c': 16, 'f': 73}) == {16: 'c', 73: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 16, 'f': 73}) == {16: 'c', 73: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003124", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('29,\"ab,\",cbe,cda,14') == ['29', 'ab,', 'cbe', 'cda', '14']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('29,\"ab,\",cbe,cda,14') == ['29', 'ab,', 'cbe', 'cda', '14']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003125", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([1, [9], [5, 1, 4], [8], [1]]) == [1, 9, 5, 1, 4, 8, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [9], [5, 1, 4], [8], [1]]) == [1, 9, 5, 1, 4, 8, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003126", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('abaabdddddae') == 'abde'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abaabdddddae') == 'abde'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003127", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([9, 6, 4, 3], 8) == [9, 6, 4, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 6, 4, 3], 8) == [9, 6, 4, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003128", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[6, [4, 3, 7], [0, 9, 1]], [9, [2, 4, 6]]]) == [6, 4, 3, 7, 0, 9, 1, 9, 2, 4, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[6, [4, 3, 7], [0, 9, 1]], [9, [2, 4, 6]]]) == [6, 4, 3, 7, 0, 9, 1, 9, 2, 4, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003129", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['c', 'a', 'b', 'c', 'e', 'e', 'b', 'c', 'c', 'd']) == {'c': 4, 'a': 1, 'b': 2, 'e': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'b', 'c', 'e', 'e', 'b', 'c', 'c', 'd']) == {'c': 4, 'a': 1, 'b': 2, 'e': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003130", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(616) == 616\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(616) == 616\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003131", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-1, -7], [-5, -2], [6, 9]], [[-2, -2], [-6, -1], [-8, 0]]) == [[-3, -9], [-11, -3], [-2, 9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -7], [-5, -2], [6, 9]], [[-2, -2], [-6, -1], [-8, 0]]) == [[-3, -9], [-11, -3], [-2, 9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003132", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(59); s.push(60); s.push(95)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(59); s.push(60); s.push(95)\nassert s.peek() == 95\nassert s.pop() == 95\nassert s.pop() == 60\nassert s.is_empty() == False\nassert s.pop() == 59\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003133", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(175) == 'CLXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(175) == 'CLXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003134", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(5839) == 76\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5839) == 76\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003135", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(1606) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1606) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003136", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(1, 9) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 9) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003137", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(1240) == 'MCCXL'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1240) == 'MCCXL'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003138", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(87); s.push(17); s.push(55)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(87); s.push(17); s.push(55)\nassert s.peek() == 55\nassert s.pop() == 55\nassert s.pop() == 17\nassert s.is_empty() == False\nassert s.pop() == 87\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003139", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['ba', 'bayzx', 'ba']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ba', 'bayzx', 'ba']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003140", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ecaca') == 'eca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecaca') == 'eca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003141", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(223)\nacc.deposit(211)\nacc.withdraw(264)\nacc.withdraw(621)\nassert acc.get_balance() == 434\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(223)\nacc.deposit(211)\nassert acc.get_balance() == 434\nacc.withdraw(264)\nassert acc.get_balance() == 170\nacc.withdraw(621)\nassert acc.get_balance() == 170\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003142", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[0], [5, [9, 4, 4]]]) == [0, 5, 9, 4, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[0], [5, [9, 4, 4]]]) == [0, 5, 9, 4, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003143", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(19) == [19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(19) == [19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003144", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MMIII') == 2003\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMIII') == 2003\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003145", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['caazy', 'caaz']) == 'caaz'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['caazy', 'caaz']) == 'caaz'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003146", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([8, 0, 3, 0, 8, 2], 3) == [0, 8, 2, 8, 0, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 0, 3, 0, 8, 2], 3) == [0, 8, 2, 8, 0, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003147", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'a', 'b', 'b', 'd', 'a', 'c', 'd']) == {'a': 3, 'b': 2, 'd': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'a', 'b', 'b', 'd', 'a', 'c', 'd']) == {'a': 3, 'b': 2, 'd': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003148", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(54, 27) == 27\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(54, 27) == 27\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003149", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 19) == 'qrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 19) == 'qrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003150", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-3, -2]) == [-3, -5]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-3, -2]) == [-3, -5]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003151", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('babbccbbbcbcbaaa', 'aba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbccbbbcbcbaaa', 'aba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003152", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eabaa') == 'eab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eabaa') == 'eab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003153", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 14) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 14) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003154", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([13, 48, 38, 39, 3]) == [3, 13, 38, 39, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([13, 48, 38, 39, 3]) == [3, 13, 38, 39, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003155", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat Sat dog the. sun, the, sat sat! cat cat.') == {'sat': 4, 'dog': 1, 'the': 2, 'sun': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat Sat dog the. sun, the, sat sat! cat cat.') == {'sat': 4, 'dog': 1, 'the': 2, 'sun': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003156", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([29, 27, 29, 21]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 27, 29, 21]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003157", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(2, 15) == 30\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(2, 15) == 30\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003158", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('user=766; host=832; port=auto') == {'user': '766', 'host': '832', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=766; host=832; port=auto') == {'user': '766', 'host': '832', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003159", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 7, 7, 6, 0, 5, 2], 3) == [[4, 7, 7], [6, 0, 5], [2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 7, 7, 6, 0, 5, 2], 3) == [[4, 7, 7], [6, 0, 5], [2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003160", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(945) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(945) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003161", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([31, 41, 32]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([31, 41, 32]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003162", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bccdbeac') == 'bcdea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bccdbeac') == 'bcdea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003163", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[3, -5, -8], [5, 9, -6], [-8, 4, -9]], [[0, 0, 2], [4, 8, 7], [-8, 6, 5]]) == [[3, -5, -6], [9, 17, 1], [-16, 10, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -5, -8], [5, 9, -6], [-8, 4, -9]], [[0, 0, 2], [4, 8, 7], [-8, 6, 5]]) == [[3, -5, -6], [9, 17, 1], [-16, 10, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003164", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Sat the the dog') == {'sat': 1, 'the': 2, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat the the dog') == {'sat': 1, 'the': 2, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003165", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 0, 7, 4, 5], [1, 2, 0, 6, 9]) == [2, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 0, 7, 4, 5], [1, 2, 0, 6, 9]) == [2, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003166", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 54, 'b': 99}) == {54: 'd', 99: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 54, 'b': 99}) == {54: 'd', 99: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003167", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([9, 8, 0, 3], 3) == [[9, 8, 0], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 8, 0, 3], 3) == [[9, 8, 0], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003168", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([13, 35, 90, 95], 169) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 35, 90, 95], 169) == -1\nassert binary_search([13, 35, 90, 95], 13) == 0\nassert binary_search([13, 35, 90, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003169", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(43) == 29\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(43) == 29\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003170", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('dde') == 'Dde'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dde') == 'Dde'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003171", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(11) == 'XI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(11) == 'XI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003172", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(33, 3) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 3) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003173", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('[][{}()]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][{}()]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003174", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 2, 2, 8, 3, 2, 9, 7, 3, 2, 0, 1], 5) == [[2, 2, 2, 8, 3], [2, 9, 7, 3, 2], [0, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 2, 2, 8, 3, 2, 9, 7, 3, 2, 0, 1], 5) == [[2, 2, 2, 8, 3], [2, 9, 7, 3, 2], [0, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003175", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['c', 'cyy', 'cy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['c', 'cyy', 'cy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003176", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(95) == [5, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(95) == [5, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003177", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 4, 'x': 4}, {'z': 7, 'y': 9, 'w': 8}) == {'w': 12, 'x': 4, 'z': 7, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 4, 'x': 4}, {'z': 7, 'y': 9, 'w': 8}) == {'w': 12, 'x': 4, 'z': 7, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003178", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(2183) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2183) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003179", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([7, 7, 8, 3, 1, 3, 6, 0, 2, 2, 5, 5, 9, 9, 2, 9], 2) == [[7, 7], [8, 3], [1, 3], [6, 0], [2, 2], [5, 5], [9, 9], [2, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 7, 8, 3, 1, 3, 6, 0, 2, 2, 5, 5, 9, 9, 2, 9], 2) == [[7, 7], [8, 3], [1, 3], [6, 0], [2, 2], [5, 5], [9, 9], [2, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003180", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([9, 17, 50, 33, 20]) == [9, 17, 20, 33, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([9, 17, 50, 33, 20]) == [9, 17, 20, 33, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003181", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'coconut', 'cherry', 'berry', 'apple', 'date', 'berry']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry', 'berry'], 'a': ['apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'coconut', 'cherry', 'berry', 'apple', 'date', 'berry']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry', 'berry'], 'a': ['apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003182", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[8, 3, 0, 0], [9, 4, 5, 2], 9, [2, 7, 9]]) == [8, 3, 0, 0, 9, 4, 5, 2, 9, 2, 7, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 3, 0, 0], [9, 4, 5, 2], 9, [2, 7, 9]]) == [8, 3, 0, 0, 9, 4, 5, 2, 9, 2, 7, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003183", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('dbabbd', 'dbabbdf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dbabbd', 'dbabbdf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003184", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(531) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(531) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003185", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('5') == 5\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('5') == 5\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003186", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(256) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(256) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003187", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbbbbbbccccaaaa') == 'b8c4a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbccccaaaa') == 'b8c4a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003188", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[2, 4, 9, 2], [4, 6, 0, 8], [3, 0, 6, 8], [2, 4, 3, 6]]) == [[2, 4, 3, 2], [4, 6, 0, 4], [9, 0, 6, 3], [2, 8, 8, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 4, 9, 2], [4, 6, 0, 8], [3, 0, 6, 8], [2, 4, 3, 6]]) == [[2, 4, 3, 2], [4, 6, 0, 4], [9, 0, 6, 3], [2, 8, 8, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003189", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('da') == 'd1a1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('da') == 'd1a1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003190", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([2, 5, 16, 20], [15]) == [2, 5, 15, 16, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 5, 16, 20], [15]) == [2, 5, 15, 16, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003191", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(96) == 12\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(96) == 12\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003192", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([5, 7, [0, 8, 4, 0], 9]) == [5, 7, 0, 8, 4, 0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 7, [0, 8, 4, 0], 9]) == [5, 7, 0, 8, 4, 0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003193", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 5, 'z': 6}, {'y': 8, 'x': 4, 'w': 6}) == {'w': 11, 'z': 6, 'y': 8, 'x': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5, 'z': 6}, {'y': 8, 'x': 4, 'w': 6}) == {'w': 11, 'z': 6, 'y': 8, 'x': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003194", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 2, 5, 4, 2, 0, 2]) == [1, 2, 5, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 5, 4, 2, 0, 2]) == [1, 2, 5, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003195", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(1816) == 'MDCCCXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1816) == 'MDCCCXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003196", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(34); s.push(48); s.push(67)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(34); s.push(48); s.push(67)\nassert s.peek() == 67\nassert s.pop() == 67\nassert s.pop() == 48\nassert s.is_empty() == False\nassert s.pop() == 34\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003197", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(40, 103, 558) == 328\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(40, 103, 558) == 328\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003198", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbabababba', 'aba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabababba', 'aba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003199", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(745) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(745) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003200", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat the. cat ran, sun sat! sun') == {'sat': 2, 'the': 1, 'cat': 1, 'ran': 1, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat the. cat ran, sun sat! sun') == {'sat': 2, 'the': 1, 'cat': 1, 'ran': 1, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003201", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([4, 37, 40, 38, 17, 16, 13, 18, 33, 28, 43]) == [4, 13, 16, 17, 18, 28, 33, 37, 38, 40, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 37, 40, 38, 17, 16, 13, 18, 33, 28, 43]) == [4, 13, 16, 17, 18, 28, 33, 37, 38, 40, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003202", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([17, 8, 21, 21, 25, 27]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 8, 21, 21, 25, 27]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003203", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(13, 13) == 13\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 13) == 13\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003204", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h27m14s') == 12434\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h27m14s') == 12434\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003205", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(8808) == 93\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8808) == 93\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003206", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([0, 28, 30, 49, 53, 57, 61, 63, 64, 66, 69, 81], 61) == 6\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 28, 30, 49, 53, 57, 61, 63, 64, 66, 69, 81], 61) == 6\nassert binary_search([0, 28, 30, 49, 53, 57, 61, 63, 64, 66, 69, 81], 0) == 0\nassert binary_search([0, 28, 30, 49, 53, 57, 61, 63, 64, 66, 69, 81], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003207", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('febc') == 'cbef'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('febc') == 'cbef'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003208", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 5, 7, 9, 3, 6, 7, 9], 6) == [7, 9, 3, 6, 7, 9, 8, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 7, 9, 3, 6, 7, 9], 6) == [7, 9, 3, 6, 7, 9, 8, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003209", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([14, 43, 2, 39, 40, 28, 45, 45]) == [2, 14, 28, 39, 40, 43, 45, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([14, 43, 2, 39, 40, 28, 45, 45]) == [2, 14, 28, 39, 40, 43, 45, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003210", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'date', 'coconut', 'berry', 'avocado', 'banana', 'banana', 'cherry']) == {'a': ['avocado', 'avocado'], 'd': ['date'], 'c': ['coconut', 'cherry'], 'b': ['berry', 'banana', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'coconut', 'berry', 'avocado', 'banana', 'banana', 'cherry']) == {'a': ['avocado', 'avocado'], 'd': ['date'], 'c': ['coconut', 'cherry'], 'b': ['berry', 'banana', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003211", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(79) == 8\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(79) == 8\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003212", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(199, 97) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(199, 97) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003213", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('a}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003214", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([0, 13, 41, 59, 70, 82, 83, 95], 114) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 13, 41, 59, 70, 82, 83, 95], 114) == -1\nassert binary_search([0, 13, 41, 59, 70, 82, 83, 95], 0) == 0\nassert binary_search([0, 13, 41, 59, 70, 82, 83, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003215", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('cae', 'cae') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cae', 'cae') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003216", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([6, 12, 2]) == [2, 6, 12]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([6, 12, 2]) == [2, 6, 12]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003217", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 0, 9, 7], 4) == [[0, 0, 9, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 0, 9, 7], 4) == [[0, 0, 9, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003218", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([20, 28, 50, 20]) == [20, 20, 28, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([20, 28, 50, 20]) == [20, 20, 28, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003219", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Python', 20) == 'Jsnbih'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 20) == 'Jsnbih'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003220", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([1, 5, 6]) == [1, 5, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1, 5, 6]) == [1, 5, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003221", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('hgch acb') == 'hgch'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hgch acb') == 'hgch'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003222", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python', 13) == 'Clguba'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 13) == 'Clguba'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003223", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 1, 'y': 4}, {'x': 4, 'z': 1}) == {'x': 5, 'y': 4, 'z': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1, 'y': 4}, {'x': 4, 'z': 1}) == {'x': 5, 'y': 4, 'z': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003224", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([3, -4, 3]) == [3, -1, 2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, -4, 3]) == [3, -1, 2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003225", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('exfdyeef') == 'feeydfxe'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('exfdyeef') == 'feeydfxe'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003226", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(25, 2) == 50\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(25, 2) == 50\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003227", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([9, 4, 8, 9, 6, 6, 0], [0, 0, 6, 8, 1, 6, 2, 6]) == [8, 6, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 4, 8, 9, 6, 6, 0], [0, 0, 6, 8, 1, 6, 2, 6]) == [8, 6, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003228", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([18, 17, 19, 14, 0, 27, 26, 16]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 17, 19, 14, 0, 27, 26, 16]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003229", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'berry', 'berry', 'date', 'coconut', 'berry']) == {'c': ['cherry', 'coconut'], 'a': ['avocado'], 'b': ['berry', 'berry', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'berry', 'berry', 'date', 'coconut', 'berry']) == {'c': ['cherry', 'coconut'], 'a': ['avocado'], 'b': ['berry', 'berry', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003230", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(729) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(729) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003231", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('exf') == 'fxe'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('exf') == 'fxe'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003232", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('cbdehaaa dd cbgef efg ddebeb') == 'cbdehaaa'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('cbdehaaa dd cbgef efg ddebeb') == 'cbdehaaa'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003233", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'banana', 'date']) == {'b': ['banana', 'banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'banana', 'date']) == {'b': ['banana', 'banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003234", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(17, 166, 41) == 8\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(17, 166, 41) == 8\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003235", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(7, 32, 822) == 397\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(7, 32, 822) == 397\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003236", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('beabb') == 'bea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beabb') == 'bea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003237", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('tdgumdvkjllbe') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('tdgumdvkjllbe') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003238", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 54, 'e': 56, 'f': 55}) == {54: 'b', 56: 'e', 55: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 54, 'e': 56, 'f': 55}) == {54: 'b', 56: 'e', 55: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003239", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2909) == 'MMCMIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2909) == 'MMCMIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003240", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([7, 38, 18]) == [7, 18, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 38, 18]) == [7, 18, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003241", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([11, 38, 14, 50, 19, 26, 16, 10]) == [10, 11, 14, 16, 19, 26, 38, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([11, 38, 14, 50, 19, 26, 16, 10]) == [10, 11, 14, 16, 19, 26, 38, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003242", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('saair') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('saair') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003243", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('4') == 4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('4') == 4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003244", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('10,\",a,b,\",bcea') == ['10', ',a,b,', 'bcea']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('10,\",a,b,\",bcea') == ['10', ',a,b,', 'bcea']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003245", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 1, 'w': 9}, {'w': 6, 'x': 8, 'z': 2}) == {'x': 9, 'w': 15, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1, 'w': 9}, {'w': 6, 'x': 8, 'z': 2}) == {'x': 9, 'w': 15, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003246", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([3, 70, 71], 3) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 70, 71], 3) == 0\nassert binary_search([3, 70, 71], 3) == 0\nassert binary_search([3, 70, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003247", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbabbaa', 'abb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabbaa', 'abb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003248", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('14m51s') == 891\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('14m51s') == 891\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003249", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([7]) == 7\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([7]) == 7\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003250", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 70, 'f': 12}) == {70: 'c', 12: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 70, 'f': 12}) == {70: 'c', 12: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003251", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(8, 134, 535) == 39\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(8, 134, 535) == 39\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003252", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(18 * 5) + 16 * 12') == 282\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(18 * 5) + 16 * 12') == 282\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003253", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 2, 0, 1, 0, 5]) == [1, 2, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 0, 1, 0, 5]) == [1, 2, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003254", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 1], [0, 3]], [[1, 1], [3, 4]]) == [[3, 4], [9, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 1], [0, 3]], [[1, 1], [3, 4]]) == [[3, 4], [9, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003255", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('([])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('([])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003256", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('badb') == 'bad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('badb') == 'bad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003257", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([0, 29, 28]) == [0, 28, 29]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([0, 29, 28]) == [0, 28, 29]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003258", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(230) == 'CCXXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(230) == 'CCXXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003259", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MDCCCLXXXVIII') == 1888\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDCCCLXXXVIII') == 1888\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003260", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([8, 1, [1, 9, 7]]) == [8, 1, 1, 9, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([8, 1, [1, 9, 7]]) == [8, 1, 1, 9, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003261", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('wmjldlvw') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('wmjldlvw') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003262", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 43, 'd': 77, 'e': 32, 'c': 42, 'a': 47}) == {43: 'b', 77: 'd', 32: 'e', 42: 'c', 47: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 43, 'd': 77, 'e': 32, 'c': 42, 'a': 47}) == {43: 'b', 77: 'd', 32: 'e', 42: 'c', 47: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003263", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([13, -10, 19]) == 22\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([13, -10, 19]) == 22\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003264", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 2, 3, 3, 1, 0, 1, 5]) == [3, 2, 1, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 2, 3, 3, 1, 0, 1, 5]) == [3, 2, 1, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003265", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bacaaaacab') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bacaaaacab') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003266", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(7548) == 86\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7548) == 86\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003267", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('cb,edad,\"b,ba\",ebee,1') == ['cb', 'edad', 'b,ba', 'ebee', '1']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cb,edad,\"b,ba\",ebee,1') == ['cb', 'edad', 'b,ba', 'ebee', '1']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003268", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(9 * 3 - 20)') == 7\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(9 * 3 - 20)') == 7\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003269", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, 7, 8]) == [8, 7, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, 7, 8]) == [8, 7, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003270", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'berry']) == {'a': ['avocado'], 'c': ['cherry'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'berry']) == {'a': ['avocado'], 'c': ['cherry'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003271", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(47, 27) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(47, 27) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003272", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([6, [7, 7, 0]]) == 20\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([6, [7, 7, 0]]) == 20\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003273", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('gqvmy') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('gqvmy') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003274", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[5, 0, 3], [3, 1, 3]], [[1, 1], [3, 4], [5, 5]]) == [[20, 20], [21, 22]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 0, 3], [3, 1, 3]], [[1, 1], [3, 4], [5, 5]]) == [[20, 20], [21, 22]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003275", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[0, 4], [7, 9], [0, 6]]) == [[0, 7, 0], [4, 9, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 4], [7, 9], [0, 6]]) == [[0, 7, 0], [4, 9, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003276", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('1h4m37s') == 3877\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h4m37s') == 3877\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003277", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-38, 5, 45, 42, 8, 17, 43]) == 45\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-38, 5, 45, 42, 8, 17, 43]) == 45\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003278", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'd', 'a']) == {'e': 1, 'd': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'd', 'a']) == {'e': 1, 'd': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003279", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(7085) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7085) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003280", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[4, 1, 0], [5, 5, 1], [0, 1, 3]], [[2, 2], [2, 5], [3, 3]]) == [[10, 13], [23, 38], [11, 14]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 1, 0], [5, 5, 1], [0, 1, 3]], [[2, 2], [2, 5], [3, 3]]) == [[10, 13], [23, 38], [11, 14]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003281", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(2546) == 50\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2546) == 50\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003282", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([6, 2, 2, 6], 6) == [2, 6, 6, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 2, 2, 6], 6) == [2, 6, 6, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003283", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 34, 'f': 16}) == {34: 'd', 16: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 34, 'f': 16}) == {34: 'd', 16: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003284", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=553; mode=833') == {'user': '553', 'mode': '833'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=553; mode=833') == {'user': '553', 'mode': '833'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003285", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 9, 9, 3, 5, 7, 4, 1, 9], 3) == [[4, 9, 9], [3, 5, 7], [4, 1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 9, 9, 3, 5, 7, 4, 1, 9], 3) == [[4, 9, 9], [3, 5, 7], [4, 1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003286", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3303) == 'MMMCCCIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3303) == 'MMMCCCIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003287", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([1, 5, 5, 6, 8], [9, 3, 1]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 5, 5, 6, 8], [9, 3, 1]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003288", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'x': 2, 'z': 8}) == {'z': 15, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'x': 2, 'z': 8}) == {'z': 15, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003289", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('babbaaaa', 'ab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbaaaa', 'ab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003290", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 5, 1, 4, 2, 0]) == [0, 5, 1, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 1, 4, 2, 0]) == [0, 5, 1, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003291", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([13, 20, 29, 46]) == [13, 20, 29, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([13, 20, 29, 46]) == [13, 20, 29, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003292", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 1, 7, 3, 0, 1], [6, 2, 3, 6, 9]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 1, 7, 3, 0, 1], [6, 2, 3, 6, 9]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003293", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([11, -10, 14]) == 15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([11, -10, 14]) == 15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003294", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('baccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('baccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003295", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('the sun, sat cat. dog cat') == {'the': 1, 'sun': 1, 'sat': 1, 'cat': 2, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the sun, sat cat. dog cat') == {'the': 1, 'sun': 1, 'sat': 1, 'cat': 2, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003296", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 5], [4, 0], [2, 5]], [[4, 4, 0], [3, 2, 1]]) == [[27, 22, 5], [16, 16, 0], [23, 18, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 5], [4, 0], [2, 5]], [[4, 4, 0], [3, 2, 1]]) == [[27, 22, 5], [16, 16, 0], [23, 18, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003297", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('dac acbc aaa dedcd') == 'Dac Acbc Aaa Dedcd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dac acbc aaa dedcd') == 'Dac Acbc Aaa Dedcd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003298", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'banana', 'banana']) == {'b': ['berry', 'banana', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'banana']) == {'b': ['berry', 'banana', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003299", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDLXXIX') == 479\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXXIX') == 479\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003300", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('LXXXII') == 82\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXXXII') == 82\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003301", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([21, 50, 46]) == [21, 46, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 50, 46]) == [21, 46, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003302", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([49, 19, 50, 5, 3, 13, 6, 32]) == [3, 5, 6, 13, 19, 32, 49, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([49, 19, 50, 5, 3, 13, 6, 32]) == [3, 5, 6, 13, 19, 32, 49, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003303", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 24) == 'vwx'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 24) == 'vwx'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003304", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(14, 17) == 238\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 17) == 238\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003305", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bbaccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbaccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003306", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bae', 'baed') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bae', 'baed') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003307", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=on; user=435; port=off') == {'mode': 'on', 'user': '435', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; user=435; port=off') == {'mode': 'on', 'user': '435', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003308", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('34m7s') == 2047\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('34m7s') == 2047\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003309", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(41) == [41]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(41) == [41]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003310", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbbbab', 'bb') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbab', 'bb') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003311", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, 4, -8, 5], [-9, 1, -9, 8], [-4, 9, -6, 9], [6, -1, -6, -9]], [[2, 3, -3, 3], [1, 7, 4, 9], [-3, 4, 4, -3], [-2, 7, -2, 3]]) == [[8, 7, -11, 8], [-8, 8, -5, 17], [-7, 13, -2, 6], [4, 6, -8, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, 4, -8, 5], [-9, 1, -9, 8], [-4, 9, -6, 9], [6, -1, -6, -9]], [[2, 3, -3, 3], [1, 7, 4, 9], [-3, 4, 4, -3], [-2, 7, -2, 3]]) == [[8, 7, -11, 8], [-8, 8, -5, 17], [-7, 13, -2, 6], [4, 6, -8, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003312", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([25, 22, 12, 47, 3, 14]) == [3, 12, 14, 22, 25, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 22, 12, 47, 3, 14]) == [3, 12, 14, 22, 25, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003313", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(37) == [37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(37) == [37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003314", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(8858) == 8588\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8858) == 8588\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003315", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXV') == 415\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXV') == 415\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003316", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 4, 4, 9], [8, 9, 7, 6, 1, 5, 2, 6]) == [7, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 4, 4, 9], [8, 9, 7, 6, 1, 5, 2, 6]) == [7, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003317", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 7, 7, 5], [5, 3, 1, 6, 0, 1, 0, 4]) == [1, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 7, 7, 5], [5, 3, 1, 6, 0, 1, 0, 4]) == [1, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003318", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([9, 24, 21, 10]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 24, 21, 10]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003319", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'z': 2, 'w': 5}, {'w': 8}) == {'x': 9, 'z': 2, 'w': 13}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'z': 2, 'w': 5}, {'w': 8}) == {'x': 9, 'z': 2, 'w': 13}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003320", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 95, 'f': 86, 'e': 67, 'a': 50}) == {95: 'd', 86: 'f', 67: 'e', 50: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 95, 'f': 86, 'e': 67, 'a': 50}) == {95: 'd', 86: 'f', 67: 'e', 50: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003321", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([6, 9, 2, 8, 9, 6], [8, 5, 6, 1, 3, 6, 2, 7]) == [6, 2, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 2, 8, 9, 6], [8, 5, 6, 1, 3, 6, 2, 7]) == [6, 2, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003322", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(3146) == 56\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3146) == 56\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003323", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(277) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(277) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003324", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(45) == [3, 3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(45) == [3, 3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003325", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 1, 5, 2, 1, 5]) == [0, 1, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 1, 5, 2, 1, 5]) == [0, 1, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003326", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 27, 'd': 90, 'b': 50, 'c': 51}) == {27: 'f', 90: 'd', 50: 'b', 51: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 27, 'd': 90, 'b': 50, 'c': 51}) == {27: 'f', 90: 'd', 50: 'b', 51: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003327", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(76); s.push(32); s.push(9)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(76); s.push(32); s.push(9)\nassert s.peek() == 9\nassert s.pop() == 9\nassert s.pop() == 32\nassert s.is_empty() == False\nassert s.pop() == 76\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003328", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMMCDLII') == 3452\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMCDLII') == 3452\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003329", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(738999) == 859\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(738999) == 859\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003330", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(3463) == 'MMMCDLXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3463) == 'MMMCDLXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003331", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'b', 'd']) == {'a': 1, 'b': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'd']) == {'a': 1, 'b': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003332", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 1, 6, 7, 9, 7, 6, 2, 2, 3], 3) == [[9, 1, 6], [7, 9, 7], [6, 2, 2], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 1, 6, 7, 9, 7, 6, 2, 2, 3], 3) == [[9, 1, 6], [7, 9, 7], [6, 2, 2], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003333", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([26, 2, 19, 19, 36, 0]) == [0, 2, 19, 19, 26, 36]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([26, 2, 19, 19, 36, 0]) == [0, 2, 19, 19, 26, 36]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003334", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(4135) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4135) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003335", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['cccz', 'cccyz']) == 'ccc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cccz', 'cccyz']) == 'ccc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003336", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([7, 9, 8, 0, 8, 3, 0, 6, 6], 5) == [[7, 9, 8, 0, 8], [3, 0, 6, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 9, 8, 0, 8, 3, 0, 6, 6], 5) == [[7, 9, 8, 0, 8], [3, 0, 6, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003337", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(36) == 21\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(36) == 21\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003338", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([2, 44, 46, 64, 69], 64) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 44, 46, 64, 69], 64) == 3\nassert binary_search([2, 44, 46, 64, 69], 2) == 0\nassert binary_search([2, 44, 46, 64, 69], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003339", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 67, 'd': 94, 'e': 50}) == {67: 'c', 94: 'd', 50: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 67, 'd': 94, 'e': 50}) == {67: 'c', 94: 'd', 50: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003340", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[[7], 3, 1]]) == [7, 3, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[7], 3, 1]]) == [7, 3, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003341", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([1, 8, 0, 1, 8, 1, 0, 5, 7], 2) == [[1, 8], [0, 1], [8, 1], [0, 5], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 8, 0, 1, 8, 1, 0, 5, 7], 2) == [[1, 8], [0, 1], [8, 1], [0, 5], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003342", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([1, 4, 2, 0, 7], 8) == [2, 0, 7, 1, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 4, 2, 0, 7], 8) == [2, 0, 7, 1, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003343", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 7, 4, 7, 8], 4) == [[5, 7, 4, 7], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 7, 4, 7, 8], 4) == [[5, 7, 4, 7], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003344", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gdg g dgbafhf fgheba bh eche') == 'dgbafhf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gdg g dgbafhf fgheba bh eche') == 'dgbafhf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003345", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('fdfddcb', 'fdfddcbb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fdfddcb', 'fdfddcbb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003346", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('becbeeca') == 'beca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('becbeeca') == 'beca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003347", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['c', 'b', 'd', 'b', 'a', 'd', 'c', 'c', 'b']) == {'c': 3, 'b': 3, 'd': 2, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'b', 'd', 'b', 'a', 'd', 'c', 'c', 'b']) == {'c': 3, 'b': 3, 'd': 2, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003348", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 4, 2, 5, 1, 3, 0, 1]) == [5, 4, 2, 1, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 2, 5, 1, 3, 0, 1]) == [5, 4, 2, 1, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003349", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 4, 'z': 6, 'x': 9}, {'x': 5, 'y': 8, 'w': 5}) == {'y': 12, 'z': 6, 'x': 14, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 4, 'z': 6, 'x': 9}, {'x': 5, 'y': 8, 'w': 5}) == {'y': 12, 'z': 6, 'x': 14, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003350", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 94, 'a': 63, 'd': 60, 'c': 9, 'f': 11}) == {94: 'e', 63: 'a', 60: 'd', 9: 'c', 11: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 94, 'a': 63, 'd': 60, 'c': 9, 'f': 11}) == {94: 'e', 63: 'a', 60: 'd', 9: 'c', 11: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003351", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bccbccaaababa', 'bc') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bccbccaaababa', 'bc') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003352", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(918300) == 958\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(918300) == 958\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003353", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([14, 17, 22, 70, 80, 84, 87, 90, 99], 169) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 17, 22, 70, 80, 84, 87, 90, 99], 169) == -1\nassert binary_search([14, 17, 22, 70, 80, 84, 87, 90, 99], 14) == 0\nassert binary_search([14, 17, 22, 70, 80, 84, 87, 90, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003354", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(184, 200) == 8\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(184, 200) == 8\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003355", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('e,bea,b') == ['e', 'bea', 'b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('e,bea,b') == ['e', 'bea', 'b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003356", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([26, 0, 7, 31, 12, 40, 30, 41]) == [0, 7, 12, 26, 30, 31, 40, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 0, 7, 31, 12, 40, 30, 41]) == [0, 7, 12, 26, 30, 31, 40, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003357", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('40,ade,\",ba\",78') == ['40', 'ade', ',ba', '78']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('40,ade,\",ba\",78') == ['40', 'ade', ',ba', '78']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003358", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('13 + (10 * 20)') == 213\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13 + (10 * 20)') == 213\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003359", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 15, 'a': 21, 'd': 5, 'c': 86}) == {15: 'f', 21: 'a', 5: 'd', 86: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 15, 'a': 21, 'd': 5, 'c': 86}) == {15: 'f', 21: 'a', 5: 'd', 86: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003360", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(1218) == 'MCCXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1218) == 'MCCXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003361", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([1, 8, 10, 13, 16, 19, 20], [1, 6]) == [1, 1, 6, 8, 10, 13, 16, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 8, 10, 13, 16, 19, 20], [1, 6]) == [1, 1, 6, 8, 10, 13, 16, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003362", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('babbabbccccba', 'cc') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbabbccccba', 'cc') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003363", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 10, 'a': 7, 'c': 10}, 4) == {'d': 10, 'a': 7, 'c': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 10, 'a': 7, 'c': 10}, 4) == {'d': 10, 'a': 7, 'c': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003364", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(8571) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8571) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003365", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 63, 'e': 16, 'c': 57, 'f': 7}) == {63: 'b', 16: 'e', 57: 'c', 7: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 63, 'e': 16, 'c': 57, 'f': 7}) == {63: 'b', 16: 'e', 57: 'c', 7: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003366", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(837) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(837) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003367", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babba', 'bba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babba', 'bba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003368", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(831519) == 911\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(831519) == 911\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003369", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CDLXV') == 465\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXV') == 465\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003370", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(3096) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3096) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003371", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(6, 7) == 279936\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(6, 7) == 279936\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003372", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('hbaxummkcjgl') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hbaxummkcjgl') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003373", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 3, 1, 4, 5, 0, 3, 4], 7) == [3, 1, 4, 5, 0, 3, 4, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 3, 1, 4, 5, 0, 3, 4], 7) == [3, 1, 4, 5, 0, 3, 4, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003374", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([12, 1, 6, 19]) == 38\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([12, 1, 6, 19]) == 38\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003375", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[9, 3, 0], [5, 9, 8], [9, 3, 2]]) == [[9, 5, 9], [3, 9, 3], [0, 8, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 3, 0], [5, 9, 8], [9, 3, 2]]) == [[9, 5, 9], [3, 9, 3], [0, 8, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003376", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('94,bb') == ['94', 'bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('94,bb') == ['94', 'bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003377", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[4, 3], [3, 3], [-2, -3]], [[4, 0], [3, -2], [5, -7]]) == [[8, 3], [6, 1], [3, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, 3], [3, 3], [-2, -3]], [[4, 0], [3, -2], [5, -7]]) == [[8, 3], [6, 1], [3, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003378", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('gprqttkfqp') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('gprqttkfqp') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003379", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([35, 36, 45, 45, 6, 13, 38]) == [6, 13, 35, 36, 38, 45, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([35, 36, 45, 45, 6, 13, 38]) == [6, 13, 35, 36, 38, 45, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003380", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(64); s.push(92); s.push(8)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(64); s.push(92); s.push(8)\nassert s.peek() == 8\nassert s.pop() == 8\nassert s.pop() == 92\nassert s.is_empty() == False\nassert s.pop() == 64\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003381", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([9, 0, [0, 4, 7], [6, 4, 5]]) == [9, 0, 0, 4, 7, 6, 4, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 0, [0, 4, 7], [6, 4, 5]]) == [9, 0, 0, 4, 7, 6, 4, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003382", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(1594) == 'MDXCIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1594) == 'MDXCIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003383", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('user=on; port=auto; host=689; mode=on') == {'user': 'on', 'port': 'auto', 'host': '689', 'mode': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; port=auto; host=689; mode=on') == {'user': 'on', 'port': 'auto', 'host': '689', 'mode': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003384", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('xacafx') == 'xfacax'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xacafx') == 'xfacax'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003385", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(4835) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4835) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003386", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(34, 128, 112) == 64\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(34, 128, 112) == 64\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003387", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('abea') == 'Abea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abea') == 'Abea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003388", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bdccccc') == 'b1d1c5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bdccccc') == 'b1d1c5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003389", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python', 24) == 'Nwrfml'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 24) == 'Nwrfml'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003390", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 31, 'e': 27}) == {31: 'c', 27: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 31, 'e': 27}) == {31: 'c', 27: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003391", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'berry', 'avocado', 'berry', 'apple', 'coconut']) == {'a': ['avocado', 'avocado', 'apple'], 'c': ['coconut', 'coconut'], 'b': ['berry', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'berry', 'avocado', 'berry', 'apple', 'coconut']) == {'a': ['avocado', 'avocado', 'apple'], 'c': ['coconut', 'coconut'], 'b': ['berry', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003392", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[8, 7, 7], 7, 9, [0, 4], [1, 8, 2, 6]]) == [8, 7, 7, 7, 9, 0, 4, 1, 8, 2, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 7, 7], 7, 9, [0, 4], [1, 8, 2, 6]]) == [8, 7, 7, 7, 9, 0, 4, 1, 8, 2, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003393", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([47, 35, 41, 1]) == [1, 35, 41, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([47, 35, 41, 1]) == [1, 35, 41, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003394", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 4}, {'y': 6, 'z': 7}) == {'y': 10, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 4}, {'y': 6, 'z': 7}) == {'y': 10, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003395", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-6, -15, 17, 9]) == 5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, -15, 17, 9]) == 5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003396", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 7, 11], [2, 12]) == [1, 2, 7, 11, 12]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 7, 11], [2, 12]) == [1, 2, 7, 11, 12]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003397", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('bfdgddad egh dgf adcc a') == 'bfdgddad'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bfdgddad egh dgf adcc a') == 'bfdgddad'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003398", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabab', 'abb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabab', 'abb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003399", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('20,bb') == ['20', 'bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('20,bb') == ['20', 'bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003400", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('bddggcb bdbge') == 'bddggcb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bddggcb bdbge') == 'bddggcb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003401", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['b', 'd', 'c', 'd', 'a', 'b', 'c', 'e', 'b', 'a']) == {'b': 3, 'd': 2, 'c': 2, 'a': 2, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'd', 'c', 'd', 'a', 'b', 'c', 'e', 'b', 'a']) == {'b': 3, 'd': 2, 'c': 2, 'a': 2, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003402", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 0, 2, 4, 0, 8, 9, 9, 6], 12) == [9, 9, 6, 4, 0, 2, 4, 0, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 0, 2, 4, 0, 8, 9, 9, 6], 12) == [9, 9, 6, 4, 0, 2, 4, 0, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003403", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([48, 17, 17, 40, 46, 11, 2]) == [2, 11, 17, 17, 40, 46, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([48, 17, 17, 40, 46, 11, 2]) == [2, 11, 17, 17, 40, 46, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003404", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([1, 3, 1, 1, 1, 3]) == [1, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 1, 1, 1, 3]) == [1, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003405", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 5, 3, 4, 6, 0, 3, 1, 3, 1], 4) == [[6, 5, 3, 4], [6, 0, 3, 1], [3, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 5, 3, 4, 6, 0, 3, 1, 3, 1], 4) == [[6, 5, 3, 4], [6, 0, 3, 1], [3, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003406", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([5, 2, 3, 1, 5, 4, 7, 8], 4) == [[5, 2, 3, 1], [5, 4, 7, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 2, 3, 1, 5, 4, 7, 8], 4) == [[5, 2, 3, 1], [5, 4, 7, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003407", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(85) == 9\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(85) == 9\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003408", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([4, 37, 20, 2, 26, 19]) == [2, 4, 19, 20, 26, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 37, 20, 2, 26, 19]) == [2, 4, 19, 20, 26, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003409", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 19) == 'qrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 19) == 'qrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003410", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('33m52s') == 2032\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('33m52s') == 2032\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003411", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(110)\nacc.deposit(125)\nacc.withdraw(196)\nacc.withdraw(412)\nassert acc.get_balance() == 235\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(110)\nacc.deposit(125)\nassert acc.get_balance() == 235\nacc.withdraw(196)\nassert acc.get_balance() == 39\nacc.withdraw(412)\nassert acc.get_balance() == 39\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003412", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('cad,33,26,\",,a\"') == ['cad', '33', '26', ',,a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cad,33,26,\",,a\"') == ['cad', '33', '26', ',,a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003413", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[2, 4, 7, 7], [9, 9], [0, 8]]) == [2, 4, 7, 7, 9, 9, 0, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 4, 7, 7], [9, 9], [0, 8]]) == [2, 4, 7, 7, 9, 9, 0, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003414", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(57, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(57, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003415", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(278) == 872\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(278) == 872\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003416", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-2, 4, -4, 1], [-5, 2, -2, -3], [-7, -6, -1, 2], [-6, 4, 1, -3]], [[7, -5, -6, -6], [-5, 5, 6, -8], [-1, 0, 9, 5], [-8, 5, -1, 0]]) == [[5, -1, -10, -5], [-10, 7, 4, -11], [-8, -6, 8, 7], [-14, 9, 0, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, 4, -4, 1], [-5, 2, -2, -3], [-7, -6, -1, 2], [-6, 4, 1, -3]], [[7, -5, -6, -6], [-5, 5, 6, -8], [-1, 0, 9, 5], [-8, 5, -1, 0]]) == [[5, -1, -10, -5], [-10, 7, 4, -11], [-8, -6, 8, 7], [-14, 9, 0, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003417", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=873; path=783; host=237') == {'port': '873', 'path': '783', 'host': '237'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=873; path=783; host=237') == {'port': '873', 'path': '783', 'host': '237'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003418", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[6, 9, 7, 1], 2, [4], [8, 7], 7]) == [6, 9, 7, 1, 2, 4, 8, 7, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 9, 7, 1], 2, [4], [8, 7], 7]) == [6, 9, 7, 1, 2, 4, 8, 7, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003419", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([2, 22, 0, 9, 7]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 22, 0, 9, 7]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003420", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['avocado', 'date', 'banana', 'coconut']) == {'a': ['avocado'], 'd': ['date'], 'b': ['banana'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'banana', 'coconut']) == {'a': ['avocado'], 'd': ['date'], 'b': ['banana'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003421", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'date', 'apple', 'banana']) == {'b': ['berry', 'banana'], 'c': ['cherry'], 'd': ['date'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'date', 'apple', 'banana']) == {'b': ['berry', 'banana'], 'c': ['cherry'], 'd': ['date'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003422", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aaabbbba', 'aaaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabbbba', 'aaaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003423", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 5], [1, 4]], [[3, 0], [3, 3]]) == [[18, 15], [15, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5], [1, 4]], [[3, 0], [3, 3]]) == [[18, 15], [15, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003424", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(8, 157, 101) == 12\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(8, 157, 101) == 12\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003425", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([1, 5, 5, 10, 19], [6, 11, 14]) == [1, 5, 5, 6, 10, 11, 14, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 5, 5, 10, 19], [6, 11, 14]) == [1, 5, 5, 6, 10, 11, 14, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003426", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[[8, 5], [3]], [4], 6]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[8, 5], [3]], [4], 6]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003427", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(356) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(356) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003428", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'apple', 'cherry', 'cherry', 'cherry', 'cherry', 'cherry']) == {'b': ['banana'], 'c': ['coconut', 'cherry', 'cherry', 'cherry', 'cherry', 'cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'apple', 'cherry', 'cherry', 'cherry', 'cherry', 'cherry']) == {'b': ['banana'], 'c': ['coconut', 'cherry', 'cherry', 'cherry', 'cherry', 'cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003429", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'a', 'e', 'b', 'a', 'e', 'b', 'd', 'c', 'c']) == {'d': 2, 'a': 2, 'e': 2, 'b': 2, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'a', 'e', 'b', 'a', 'e', 'b', 'd', 'c', 'c']) == {'d': 2, 'a': 2, 'e': 2, 'b': 2, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003430", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([5, 1, 9, 8, 2, 5, 0], 5) == [[5, 1, 9, 8, 2], [5, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 1, 9, 8, 2, 5, 0], 5) == [[5, 1, 9, 8, 2], [5, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003431", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([21, 38, 6, 26, 10]) == [6, 10, 21, 26, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([21, 38, 6, 26, 10]) == [6, 10, 21, 26, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003432", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h46m2s') == 13562\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h46m2s') == 13562\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003433", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(154) == 'CLIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(154) == 'CLIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003434", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([7, [7, 5, 7, 6], [0, 7, 3], [6, 8, 8, 7]]) == [7, 7, 5, 7, 6, 0, 7, 3, 6, 8, 8, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([7, [7, 5, 7, 6], [0, 7, 3], [6, 8, 8, 7]]) == [7, 7, 5, 7, 6, 0, 7, 3, 6, 8, 8, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003435", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bbdddd') == 'b2d4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbdddd') == 'b2d4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003436", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(56, 6) == 168\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(56, 6) == 168\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003437", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, 9], [-3, -7]], [[6, 8], [2, 6]]) == [[-1, 17], [-1, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 9], [-3, -7]], [[6, 8], [2, 6]]) == [[-1, 17], [-1, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003438", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('39,dca') == ['39', 'dca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('39,dca') == ['39', 'dca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003439", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(47) == [47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(47) == [47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003440", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('99,a,adee') == ['99', 'a', 'adee']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('99,a,adee') == ['99', 'a', 'adee']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003441", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([5, 24, 26, 46], 165) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 24, 26, 46], 165) == -1\nassert binary_search([5, 24, 26, 46], 5) == 0\nassert binary_search([5, 24, 26, 46], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003442", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('a]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003443", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(11, 66, 889) == 442\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(11, 66, 889) == 442\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003444", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('3h29m8s') == 12548\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h29m8s') == 12548\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003445", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bbbdfbf', 'bbdfbfb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bbbdfbf', 'bbdfbfb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003446", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sun sun. cat. the') == {'sun': 2, 'cat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun. cat. the') == {'sun': 2, 'cat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003447", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('8') == 8\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('8') == 8\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003448", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 0, 5, 4]) == [5, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 5, 4]) == [5, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003449", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(1896) == 'MDCCCXCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1896) == 'MDCCCXCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003450", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([43, 44, 24, 47, 50]) == [24, 43, 44, 47, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([43, 44, 24, 47, 50]) == [24, 43, 44, 47, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003451", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([1, 6, 34, 37, 61, 81], 129) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 6, 34, 37, 61, 81], 129) == -1\nassert binary_search([1, 6, 34, 37, 61, 81], 1) == 0\nassert binary_search([1, 6, 34, 37, 61, 81], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003452", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('24m45s') == 1485\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('24m45s') == 1485\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003453", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([44, 17, 29, 30]) == [17, 29, 30, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 17, 29, 30]) == [17, 29, 30, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003454", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(126, 67) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(126, 67) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003455", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 3], [4, 5]], [[2, 1], [0, 3]]) == [[2, 10], [8, 19]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 3], [4, 5]], [[2, 1], [0, 3]]) == [[2, 10], [8, 19]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003456", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bbebdd') == 'bed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbebdd') == 'bed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003457", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('11,aab,dc,aec,ad') == ['11', 'aab', 'dc', 'aec', 'ad']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('11,aab,dc,aec,ad') == ['11', 'aab', 'dc', 'aec', 'ad']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003458", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'w': 5, 'y': 6, 'z': 6}) == {'y': 12, 'w': 5, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'w': 5, 'y': 6, 'z': 6}) == {'y': 12, 'w': 5, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003459", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 1, 'y': 6, 'z': 1}, {'y': 7, 'z': 8}) == {'w': 1, 'y': 13, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 1, 'y': 6, 'z': 1}, {'y': 7, 'z': 8}) == {'w': 1, 'y': 13, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003460", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(2553) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2553) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003461", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[0], [8], 2, 9]) == [0, 8, 2, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], [8], 2, 9]) == [0, 8, 2, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003462", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['a', 'b', 'b', 'd', 'd']) == {'a': 1, 'b': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'b', 'd', 'd']) == {'a': 1, 'b': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003463", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([32, 12, 4, 37, 33, 18, 42, 28]) == [4, 12, 18, 28, 32, 33, 37, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 12, 4, 37, 33, 18, 42, 28]) == [4, 12, 18, 28, 32, 33, 37, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003464", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('baaaa') == 'b1a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('baaaa') == 'b1a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003465", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(2, 6) == 64\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 6) == 64\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003466", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ad') == 'Ad'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ad') == 'Ad'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003467", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([7], [10]) == [7, 10]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7], [10]) == [7, 10]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003468", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(14, 46) == 322\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 46) == 322\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003469", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[8, 2], [5, 6], [4, 9]]) == 34\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[8, 2], [5, 6], [4, 9]]) == 34\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003470", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([18, 29, 18, 15, 23, 6, 5]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 29, 18, 15, 23, 6, 5]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003471", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[5, 4], [-8, 8], [5, -2]], [[-6, -1], [2, 2], [-5, 3]]) == [[-1, 3], [-6, 10], [0, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 4], [-8, 8], [5, -2]], [[-6, -1], [2, 2], [-5, 3]]) == [[-1, 3], [-6, 10], [0, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003472", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(166) == 'CLXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(166) == 'CLXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003473", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0, 0], [1, 1, 3, 5], 0]) == [0, 0, 1, 1, 3, 5, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 0], [1, 1, 3, 5], 0]) == [0, 0, 1, 1, 3, 5, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003474", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('dhg gghbchc') == 'gghbchc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dhg gghbchc') == 'gghbchc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003475", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([12, 14, -4, 16, -19]) == 19\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([12, 14, -4, 16, -19]) == 19\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003476", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(41); s.push(72); s.push(72)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(41); s.push(72); s.push(72)\nassert s.peek() == 72\nassert s.pop() == 72\nassert s.pop() == 72\nassert s.is_empty() == False\nassert s.pop() == 41\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003477", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([9, 6, 7, 5, 6, 0], 4) == [[9, 6, 7, 5], [6, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 6, 7, 5, 6, 0], 4) == [[9, 6, 7, 5], [6, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003478", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'apple', 'coconut', 'apple', 'date', 'cherry', 'berry', 'cherry']) == {'b': ['berry', 'berry'], 'a': ['apple', 'apple'], 'c': ['coconut', 'cherry', 'cherry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'apple', 'coconut', 'apple', 'date', 'cherry', 'berry', 'cherry']) == {'b': ['berry', 'berry'], 'a': ['apple', 'apple'], 'c': ['coconut', 'cherry', 'cherry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003479", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([7, 3, 15, 40, 1]) == [1, 3, 7, 15, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([7, 3, 15, 40, 1]) == [1, 3, 7, 15, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003480", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(2, 54) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(2, 54) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003481", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[7, 8], [8], [7]]) == [7, 8, 8, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 8], [8], [7]]) == [7, 8, 8, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003482", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 7, 'd': 9, 'c': 5}, 6) == {'b': 7, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 7, 'd': 9, 'c': 5}, 6) == {'b': 7, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003483", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(42, 28) == 14\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(42, 28) == 14\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003484", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[8, 2], [0, 7], [8, 1], [0, 2]]) == [[8, 0, 8, 0], [2, 7, 1, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 2], [0, 7], [8, 1], [0, 2]]) == [[8, 0, 8, 0], [2, 7, 1, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003485", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([33, 43, 96], 43) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([33, 43, 96], 43) == 1\nassert binary_search([33, 43, 96], 33) == 0\nassert binary_search([33, 43, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003486", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[7, 4, -5], [-2, -1, 0], [1, 1, 1]], [[0, 2, -5], [-1, -3, 4], [7, 3, 7]]) == [[7, 6, -10], [-3, -4, 4], [8, 4, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 4, -5], [-2, -1, 0], [1, 1, 1]], [[0, 2, -5], [-1, -3, 4], [7, 3, 7]]) == [[7, 6, -10], [-3, -4, 4], [8, 4, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003487", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(49) == [7, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(49) == [7, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003488", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'banana', 'coconut', 'date', 'apple', 'apple']) == {'d': ['date', 'date'], 'b': ['banana'], 'c': ['coconut'], 'a': ['apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'banana', 'coconut', 'date', 'apple', 'apple']) == {'d': ['date', 'date'], 'b': ['banana'], 'c': ['coconut'], 'a': ['apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003489", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(211) == 'CCXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(211) == 'CCXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003490", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 0, 6, 1, 4], 2) == [[8, 0], [6, 1], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 0, 6, 1, 4], 2) == [[8, 0], [6, 1], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003491", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[9, 1, 8], [9, 7], [4]]) == 38\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 1, 8], [9, 7], [4]]) == 38\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003492", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(86) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(86) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003493", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([4, 5, 5, 8, 11, 16], [1, 7, 19]) == [1, 4, 5, 5, 7, 8, 11, 16, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 5, 5, 8, 11, 16], [1, 7, 19]) == [1, 4, 5, 5, 7, 8, 11, 16, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003494", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 24) == 'vwx'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 24) == 'vwx'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003495", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 67, 'a': 14, 'c': 41}) == {67: 'd', 14: 'a', 41: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 67, 'a': 14, 'c': 41}) == {67: 'd', 14: 'a', 41: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003496", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(1723) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1723) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003497", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 1], [5, 1], [0, 4]], [[4, 1], [5, 0]]) == [[17, 3], [25, 5], [20, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1], [5, 1], [0, 4]], [[4, 1], [5, 0]]) == [[17, 3], [25, 5], [20, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003498", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([14, 14, 16, 16], [4, 7]) == [4, 7, 14, 14, 16, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([14, 14, 16, 16], [4, 7]) == [4, 7, 14, 14, 16, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003499", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'avocado', 'banana', 'cherry', 'coconut', 'berry', 'avocado', 'avocado']) == {'d': ['date'], 'a': ['avocado', 'avocado', 'avocado'], 'b': ['banana', 'berry'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'avocado', 'banana', 'cherry', 'coconut', 'berry', 'avocado', 'avocado']) == {'d': ['date'], 'a': ['avocado', 'avocado', 'avocado'], 'b': ['banana', 'berry'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003500", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([29, 41, 42, 59, 90], 29) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([29, 41, 42, 59, 90], 29) == 0\nassert binary_search([29, 41, 42, 59, 90], 29) == 0\nassert binary_search([29, 41, 42, 59, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003501", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h20m3s') == 12003\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h20m3s') == 12003\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003502", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(102)\nacc.deposit(36)\nacc.withdraw(82)\nacc.withdraw(238)\nassert acc.get_balance() == 138\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(102)\nacc.deposit(36)\nassert acc.get_balance() == 138\nacc.withdraw(82)\nassert acc.get_balance() == 56\nacc.withdraw(238)\nassert acc.get_balance() == 56\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003503", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(7570) == 757\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7570) == 757\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003504", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('heecedd acbccfh h') == 'heecedd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('heecedd acbccfh h') == 'heecedd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003505", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'a': 10, 'c': 5, 'd': 3, 'e': 7}, 3) == {'a': 10, 'c': 5, 'e': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 10, 'c': 5, 'd': 3, 'e': 7}, 3) == {'a': 10, 'c': 5, 'e': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003506", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bcaebaeb') == 'bcae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcaebaeb') == 'bcae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003507", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([9, 7, [6, 2]]) == [9, 7, 6, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 7, [6, 2]]) == [9, 7, 6, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003508", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 7, 3, 5, 4, 4, 5], 6) == [7, 3, 5, 4, 4, 5, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 7, 3, 5, 4, 4, 5], 6) == [7, 3, 5, 4, 4, 5, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003509", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(48)\nacc.deposit(238)\nacc.withdraw(194)\nacc.withdraw(336)\nassert acc.get_balance() == 286\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(48)\nacc.deposit(238)\nassert acc.get_balance() == 286\nacc.withdraw(194)\nassert acc.get_balance() == 92\nacc.withdraw(336)\nassert acc.get_balance() == 92\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003510", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('c gbghefe fhgge') == 'gbghefe'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('c gbghefe fhgge') == 'gbghefe'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003511", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3267) == 'MMMCCLXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3267) == 'MMMCCLXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003512", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens(']]))') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']]))') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003513", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'x': 8, 'y': 5}, {'y': 2}) == {'z': 4, 'x': 8, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'x': 8, 'y': 5}, {'y': 2}) == {'z': 4, 'x': 8, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003514", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([1, 6, [[9, 8]]]) == 24\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([1, 6, [[9, 8]]]) == 24\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003515", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(8819) == 93\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8819) == 93\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003516", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(328) == 'CCCXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(328) == 'CCCXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003517", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 0, 3, 3, 2, 3]) == [0, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 3, 3, 2, 3]) == [0, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003518", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MCDXXVI') == 1426\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCDXXVI') == 1426\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003519", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[0, 2, 4, 0], [7, 9, 3, 7], [3, 5, 4, 8]]) == [[0, 7, 3], [2, 9, 5], [4, 3, 4], [0, 7, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 2, 4, 0], [7, 9, 3, 7], [3, 5, 4, 8]]) == [[0, 7, 3], [2, 9, 5], [4, 3, 4], [0, 7, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003520", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([7, 3, 8, 4, 6, 5], 5) == [3, 8, 4, 6, 5, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 3, 8, 4, 6, 5], 5) == [3, 8, 4, 6, 5, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003521", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('XXX') == 30\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XXX') == 30\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003522", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('c,49,\"b,b\"') == ['c', '49', 'b,b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,49,\"b,b\"') == ['c', '49', 'b,b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003523", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h6m11s') == 3971\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h6m11s') == 3971\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003524", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[0, -3, -2], [-4, 5, 5]], [[-1, -9, 7], [7, -5, -8]]) == [[-1, -12, 5], [3, 0, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -3, -2], [-4, 5, 5]], [[-1, -9, 7], [7, -5, -8]]) == [[-1, -12, 5], [3, 0, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003525", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(23, 25) == 575\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 25) == 575\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003526", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('cdcce dcabbd ca') == 'Cdcce Dcabbd Ca'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cdcce dcabbd ca') == 'Cdcce Dcabbd Ca'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003527", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('dfee cc ghdbe gaadgahg hfdag') == 'gaadgahg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dfee cc ghdbe gaadgahg hfdag') == 'gaadgahg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003528", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaaddaa') == 'a4d2a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaddaa') == 'a4d2a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003529", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([4, 11, 13, 15, 25, 34, 51, 88], 109) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 11, 13, 15, 25, 34, 51, 88], 109) == -1\nassert binary_search([4, 11, 13, 15, 25, 34, 51, 88], 4) == 0\nassert binary_search([4, 11, 13, 15, 25, 34, 51, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003530", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('13 + (17 - 6)') == 24\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13 + (17 - 6)') == 24\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003531", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(7, 2) == 14\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(7, 2) == 14\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003532", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bcbcaacbcb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcbcaacbcb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003533", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([3, 7, 8, 16, 19, 20, 27, 35, 43, 53, 67, 83], 35) == 7\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 7, 8, 16, 19, 20, 27, 35, 43, 53, 67, 83], 35) == 7\nassert binary_search([3, 7, 8, 16, 19, 20, 27, 35, 43, 53, 67, 83], 3) == 0\nassert binary_search([3, 7, 8, 16, 19, 20, 27, 35, 43, 53, 67, 83], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003534", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 5, 'x': 7, 'w': 4}, {'z': 2}) == {'z': 7, 'x': 7, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 5, 'x': 7, 'w': 4}, {'z': 2}) == {'z': 7, 'x': 7, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003535", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(29)\nacc.deposit(18)\nacc.withdraw(16)\nacc.withdraw(106)\nassert acc.get_balance() == 47\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(29)\nacc.deposit(18)\nassert acc.get_balance() == 47\nacc.withdraw(16)\nassert acc.get_balance() == 31\nacc.withdraw(106)\nassert acc.get_balance() == 31\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003536", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 6, 'w': 6, 'x': 5}, {'y': 7}) == {'z': 6, 'w': 6, 'x': 5, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 6, 'w': 6, 'x': 5}, {'y': 7}) == {'z': 6, 'w': 6, 'x': 5, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003537", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-3, -7, 3, 2, -9, 5]) == [-3, -10, -7, -5, -14, -9]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-3, -7, 3, 2, -9, 5]) == [-3, -10, -7, -5, -14, -9]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003538", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(190) == 106\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(190) == 106\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003539", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([7], [13, 16]) == [7, 13, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7], [13, 16]) == [7, 13, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003540", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(60, 17) == 1020\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(60, 17) == 1020\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003541", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babaabaaabb', 'bb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babaabaaabb', 'bb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003542", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 1, 'e': 11, 'b': 83, 'c': 13}) == {1: 'd', 11: 'e', 83: 'b', 13: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 1, 'e': 11, 'b': 83, 'c': 13}) == {1: 'd', 11: 'e', 83: 'b', 13: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003543", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'd', 'a', 'd', 'b', 'd', 'd', 'd', 'd', 'd']) == {'c': 1, 'd': 7, 'a': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'd', 'a', 'd', 'b', 'd', 'd', 'd', 'd', 'd']) == {'c': 1, 'd': 7, 'a': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003544", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('15 + 15 + (8 + 1)') == 39\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('15 + 15 + (8 + 1)') == 39\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003545", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello Hello', 9) == 'Qnuux Qnuux'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Hello', 9) == 'Qnuux Qnuux'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003546", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(6867) == 27\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6867) == 27\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003547", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(22, 10) == 110\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 10) == 110\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003548", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 5, 4, 1, 0, 3]) == [1, 5, 4, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 4, 1, 0, 3]) == [1, 5, 4, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003549", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=784; user=off; host=124; path=off') == {'mode': '784', 'user': 'off', 'host': '124', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=784; user=off; host=124; path=off') == {'mode': '784', 'user': 'off', 'host': '124', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003550", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(2, 21) == 42\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(2, 21) == 42\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003551", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(18 * 5) - 2') == 88\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(18 * 5) - 2') == 88\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003552", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baaab', 'aaa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaab', 'aaa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003553", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([9, 1, 49, 19, 29, 44, 26, 50, 22, 10, 45, 24]) == [1, 9, 10, 19, 22, 24, 26, 29, 44, 45, 49, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([9, 1, 49, 19, 29, 44, 26, 50, 22, 10, 45, 24]) == [1, 9, 10, 19, 22, 24, 26, 29, 44, 45, 49, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003554", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([1, 5, 8, 11, 15, 18], [7, 15]) == [1, 5, 7, 8, 11, 15, 15, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 5, 8, 11, 15, 18], [7, 15]) == [1, 5, 7, 8, 11, 15, 15, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003555", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(84); s.push(15); s.push(12)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(84); s.push(15); s.push(12)\nassert s.peek() == 12\nassert s.pop() == 12\nassert s.pop() == 15\nassert s.is_empty() == False\nassert s.pop() == 84\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003556", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['e', 'e', 'd', 'b', 'a', 'a', 'a']) == {'e': 2, 'd': 1, 'b': 1, 'a': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'd', 'b', 'a', 'a', 'a']) == {'e': 2, 'd': 1, 'b': 1, 'a': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003557", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('9 + (5 - 18)') == -4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9 + (5 - 18)') == -4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003558", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 8, 5, 6], [7, 0, 7, 4, 5, 1]) == [4, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 8, 5, 6], [7, 0, 7, 4, 5, 1]) == [4, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003559", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('Dog cat. sun cat the dog dog, sat dog, Dog') == {'dog': 5, 'cat': 2, 'sun': 1, 'the': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog cat. sun cat the dog dog, sat dog, Dog') == {'dog': 5, 'cat': 2, 'sun': 1, 'the': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003560", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(2317) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2317) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003561", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([28, 47, 92], 184) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([28, 47, 92], 184) == -1\nassert binary_search([28, 47, 92], 28) == 0\nassert binary_search([28, 47, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003562", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=463; port=off') == {'mode': '463', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=463; port=off') == {'mode': '463', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003563", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(40); s.push(70); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(40); s.push(70); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 70\nassert s.is_empty() == False\nassert s.pop() == 40\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003564", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 4, 4, 9, 6, 2], 3) == [[2, 4, 4], [9, 6, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 4, 4, 9, 6, 2], 3) == [[2, 4, 4], [9, 6, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003565", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(35, 12) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 12) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003566", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-4, -8, 9], [-4, -3, -6], [-7, -2, 0], [1, -9, 0]], [[4, 2, -2], [7, 0, 3], [2, 7, 8], [-3, -5, 6]]) == [[0, -6, 7], [3, -3, -3], [-5, 5, 8], [-2, -14, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -8, 9], [-4, -3, -6], [-7, -2, 0], [1, -9, 0]], [[4, 2, -2], [7, 0, 3], [2, 7, 8], [-3, -5, 6]]) == [[0, -6, 7], [3, -3, -3], [-5, 5, 8], [-2, -14, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003567", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[8, 8, -1], [8, -1, 4]], [[4, -8, -6], [0, 9, 1]]) == [[12, 0, -7], [8, 8, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 8, -1], [8, -1, 4]], [[4, -8, -6], [0, 9, 1]]) == [[12, 0, -7], [8, 8, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003568", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 4, 9, 6, 2, 9, 1, 1, 6], 7) == [9, 6, 2, 9, 1, 1, 6, 0, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 4, 9, 6, 2, 9, 1, 1, 6], 7) == [9, 6, 2, 9, 1, 1, 6, 0, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003569", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([3, 10, 26, 59, 62, 66, 67, 78, 97], 115) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 10, 26, 59, 62, 66, 67, 78, 97], 115) == -1\nassert binary_search([3, 10, 26, 59, 62, 66, 67, 78, 97], 3) == 0\nassert binary_search([3, 10, 26, 59, 62, 66, 67, 78, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003570", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([1, 0, 8, 8]) == [1, 0, 8, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, 0, 8, 8]) == [1, 0, 8, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003571", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(19, 14) == 266\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 14) == 266\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003572", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'z': 6}) == {'z': 14}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'z': 6}) == {'z': 14}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003573", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 6, 'd': 5, 'e': 6}, 4) == {'c': 6, 'd': 5, 'e': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 6, 'd': 5, 'e': 6}, 4) == {'c': 6, 'd': 5, 'e': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003574", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MMMLXIII') == 3063\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMLXIII') == 3063\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003575", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([5, [8, 7], [6]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([5, [8, 7], [6]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003576", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 0], [3, 9]]) == [[7, 3], [0, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 0], [3, 9]]) == [[7, 3], [0, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003577", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(79) == [79]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(79) == [79]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003578", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[7, -6], [5, 1], [-8, 5], [9, -9]], [[5, 5], [-8, 5], [1, -8], [4, -2]]) == [[12, -1], [-3, 6], [-7, -3], [13, -11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, -6], [5, 1], [-8, 5], [9, -9]], [[5, 5], [-8, 5], [1, -8], [4, -2]]) == [[12, -1], [-3, 6], [-7, -3], [13, -11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003579", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aaaaabbbdddaaaaaddddddcccc') == 'a5b3d3a5d6c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaabbbdddaaaaaddddddcccc') == 'a5b3d3a5d6c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003580", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(16, 41) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(16, 41) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003581", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[3, 0, 1, 3], [7, 6], 1, 0]) == [3, 0, 1, 3, 7, 6, 1, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 0, 1, 3], [7, 6], 1, 0]) == [3, 0, 1, 3, 7, 6, 1, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003582", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([4, 12], [6, 13, 14, 19]) == [4, 6, 12, 13, 14, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 12], [6, 13, 14, 19]) == [4, 6, 12, 13, 14, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003583", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(825) == 28\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(825) == 28\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003584", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(7884) == 27\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7884) == 27\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003585", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('ccbbccbbcc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccbbccbbcc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003586", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(472) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(472) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003587", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([31, 5, 0, 22]) == [0, 5, 22, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 5, 0, 22]) == [0, 5, 22, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003588", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 5, 9, 3, 3], 3) == [9, 3, 3, 8, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 9, 3, 3], 3) == [9, 3, 3, 8, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003589", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaaaabbbbccbbbbcccc') == 'a5b4c2b4c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaabbbbccbbbbcccc') == 'a5b4c2b4c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003590", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CDXII') == 412\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXII') == 412\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003591", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(2187) == 46\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2187) == 46\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003592", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(18 + 18 * 14)') == 270\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(18 + 18 * 14)') == 270\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003593", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[2, -8, 9], [2, 6, 1], [-4, 8, -2]], [[0, -6, -7], [-5, 7, -3], [2, -7, 5]]) == [[2, -14, 2], [-3, 13, -2], [-2, 1, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -8, 9], [2, 6, 1], [-4, 8, -2]], [[0, -6, -7], [-5, 7, -3], [2, -7, 5]]) == [[2, -14, 2], [-3, 13, -2], [-2, 1, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003594", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(493) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(493) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003595", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('ababaabaabbba', 'baa') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababaabaabbba', 'baa') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003596", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-6, -18, 17, -20, 10]) == -17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, -18, 17, -20, 10]) == -17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003597", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('xxc') == 'cxx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xxc') == 'cxx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003598", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([9, 7, 1, 8, 6, 3], [5, 9, 6, 6, 6]) == [9, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 7, 1, 8, 6, 3], [5, 9, 6, 6, 6]) == [9, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003599", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-31, -36, -1, 21, 43, -15, 20]) == 43\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-31, -36, -1, 21, 43, -15, 20]) == 43\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003600", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([20, 22, 20, 8, 8, 8, 0]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 22, 20, 8, 8, 8, 0]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003601", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([7], [0, 14, 14]) == [0, 7, 14, 14]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7], [0, 14, 14]) == [0, 7, 14, 14]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003602", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(91) == 92\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(91) == 92\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003603", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Dog ran the ran,') == {'dog': 1, 'ran': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog ran the ran,') == {'dog': 1, 'ran': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003604", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 5, 4, 3, 0]) == [5, 4, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 4, 3, 0]) == [5, 4, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003605", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[9, 4], [6, -5], [9, 9]], [[-6, -6], [0, -8], [-9, -5]]) == [[3, -2], [6, -13], [0, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, 4], [6, -5], [9, 9]], [[-6, -6], [0, -8], [-9, -5]]) == [[3, -2], [6, -13], [0, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003606", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-7, -5, 4, 6]) == [-7, -12, -8, -2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -5, 4, 6]) == [-7, -12, -8, -2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003607", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=254; mode=677; user=off') == {'path': '254', 'mode': '677', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=254; mode=677; user=off') == {'path': '254', 'mode': '677', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003608", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaaabababbbabba', 'ab') == 4\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaabababbbabba', 'ab') == 4\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003609", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[2, 0, 0], [5, 4, 1]], [[1, 2, 1], [2, 5, 3], [2, 3, 1]]) == [[2, 4, 2], [15, 33, 18]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 0, 0], [5, 4, 1]], [[1, 2, 1], [2, 5, 3], [2, 3, 1]]) == [[2, 4, 2], [15, 33, 18]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003610", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 5, 6, 3, 5, 2, 2, 4, 9], 5) == [[2, 5, 6, 3, 5], [2, 2, 4, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 6, 3, 5, 2, 2, 4, 9], 5) == [[2, 5, 6, 3, 5], [2, 2, 4, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003611", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(62); s.push(0); s.push(36)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(62); s.push(0); s.push(36)\nassert s.peek() == 36\nassert s.pop() == 36\nassert s.pop() == 0\nassert s.is_empty() == False\nassert s.pop() == 62\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003612", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('cc hch ehfdbdbe ag gaahgde gcf') == 'ehfdbdbe'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('cc hch ehfdbdbe ag gaahgde gcf') == 'ehfdbdbe'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003613", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('dcdeec') == 'dce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcdeec') == 'dce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003614", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'cherry', 'berry', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['apple'], 'b': ['berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'cherry', 'berry', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['apple'], 'b': ['berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003615", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(86); s.push(91); s.push(77)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(86); s.push(91); s.push(77)\nassert s.peek() == 77\nassert s.pop() == 77\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 86\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003616", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('19 + 9') == 28\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19 + 9') == 28\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003617", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 5, 4], [4, 4, 3]], [[2, 1, 1], [1, 2, 4], [1, 2, 1]]) == [[17, 22, 28], [15, 18, 23]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 5, 4], [4, 4, 3]], [[2, 1, 1], [1, 2, 4], [1, 2, 1]]) == [[17, 22, 28], [15, 18, 23]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003618", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(49, 51) == 2499\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(49, 51) == 2499\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003619", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([3, 0, 48]) == [0, 3, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([3, 0, 48]) == [0, 3, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003620", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(851) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(851) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003621", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003622", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('dcdbe') == 'dcbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcdbe') == 'dcbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003623", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(53); s.push(32); s.push(44)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(53); s.push(32); s.push(44)\nassert s.peek() == 44\nassert s.pop() == 44\nassert s.pop() == 32\nassert s.is_empty() == False\nassert s.pop() == 53\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003624", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('revocaefst') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('revocaefst') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003625", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 13, 15, 20, 28, 29, 50, 59, 64, 84], 117) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 13, 15, 20, 28, 29, 50, 59, 64, 84], 117) == -1\nassert binary_search([4, 13, 15, 20, 28, 29, 50, 59, 64, 84], 4) == 0\nassert binary_search([4, 13, 15, 20, 28, 29, 50, 59, 64, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003626", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('becbacde') == 'becad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('becbacde') == 'becad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003627", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([3, 0, 20, -19, -10]) == -6\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([3, 0, 20, -19, -10]) == -6\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003628", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([1, 0, 6, 24]) == [0, 1, 6, 24]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([1, 0, 6, 24]) == [0, 1, 6, 24]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003629", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(57) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(57) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003630", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(']b]aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']b]aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003631", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(431)\nacc.deposit(112)\nacc.withdraw(151)\nacc.withdraw(667)\nassert acc.get_balance() == 543\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(431)\nacc.deposit(112)\nassert acc.get_balance() == 543\nacc.withdraw(151)\nassert acc.get_balance() == 392\nacc.withdraw(667)\nassert acc.get_balance() == 392\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003632", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[6, 6, 4], [9, 0, 3], [2, 0, 1], [6, 7, 1]]) == [[6, 9, 2, 6], [6, 0, 0, 7], [4, 3, 1, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 6, 4], [9, 0, 3], [2, 0, 1], [6, 7, 1]]) == [[6, 9, 2, 6], [6, 0, 0, 7], [4, 3, 1, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003633", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'c': 3, 'b': 10, 'e': 10}, 7) == {'b': 10, 'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 3, 'b': 10, 'e': 10}, 7) == {'b': 10, 'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003634", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h51m') == 10260\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h51m') == 10260\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003635", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(168)\nacc.deposit(125)\nacc.withdraw(284)\nacc.withdraw(317)\nassert acc.get_balance() == 293\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(168)\nacc.deposit(125)\nassert acc.get_balance() == 293\nacc.withdraw(284)\nassert acc.get_balance() == 9\nacc.withdraw(317)\nassert acc.get_balance() == 9\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003636", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aaabbbbbaaaa', 'baab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabbbbbaaaa', 'baab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003637", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([10, 35, 51, 61, 68, 74, 77], 35) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 35, 51, 61, 68, 74, 77], 35) == 1\nassert binary_search([10, 35, 51, 61, 68, 74, 77], 10) == 0\nassert binary_search([10, 35, 51, 61, 68, 74, 77], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003638", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'y': 4, 'w': 3}, {'x': 2, 'z': 6}) == {'x': 6, 'y': 4, 'w': 3, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'y': 4, 'w': 3}, {'x': 2, 'z': 6}) == {'x': 6, 'y': 4, 'w': 3, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003639", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-1, 20, -15, -20, -15]) == -31\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-1, 20, -15, -20, -15]) == -31\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003640", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 4, 3, 9, 6, 2, 7, 2, 7], 7) == [3, 9, 6, 2, 7, 2, 7, 1, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 4, 3, 9, 6, 2, 7, 2, 7], 7) == [3, 9, 6, 2, 7, 2, 7, 1, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003641", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([19, 36, 31]) == [19, 31, 36]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([19, 36, 31]) == [19, 31, 36]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003642", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(5, 47) == 235\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 47) == 235\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003643", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-4, 3, -8], [-2, -1, -6], [-1, 5, -1]], [[-6, -4, 5], [2, -2, -9], [2, 6, 7]]) == [[-10, -1, -3], [0, -3, -15], [1, 11, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 3, -8], [-2, -1, -6], [-1, 5, -1]], [[-6, -4, 5], [2, -2, -9], [2, 6, 7]]) == [[-10, -1, -3], [0, -3, -15], [1, 11, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003644", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 2, 7], 1) == [7, 8, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 2, 7], 1) == [7, 8, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003645", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(10 + (18 - 7))') == 21\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(10 + (18 - 7))') == 21\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003646", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(4) == 2\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(4) == 2\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003647", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(85); s.push(90); s.push(3)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(85); s.push(90); s.push(3)\nassert s.peek() == 3\nassert s.pop() == 3\nassert s.pop() == 90\nassert s.is_empty() == False\nassert s.pop() == 85\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003648", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ddcccaaaaaaaaad') == 'd2c3a9d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddcccaaaaaaaaad') == 'd2c3a9d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003649", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('godiwyftmcsocl') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('godiwyftmcsocl') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003650", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 72, 'a': 30, 'c': 24}) == {72: 'd', 30: 'a', 24: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 72, 'a': 30, 'c': 24}) == {72: 'd', 30: 'a', 24: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003651", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['a', 'b', 'e', 'e', 'd', 'd', 'c']) == {'a': 1, 'b': 1, 'e': 2, 'd': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'e', 'e', 'd', 'd', 'c']) == {'a': 1, 'b': 1, 'e': 2, 'd': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003652", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(47, 27) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(47, 27) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003653", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(401) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(401) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003654", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([6, 4, 0, 9, 9, 9], 3) == [9, 9, 9, 6, 4, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 4, 0, 9, 9, 9], 3) == [9, 9, 9, 6, 4, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003655", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([22, 11, 22, 23, 20, 22, 20, 17, 7]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 11, 22, 23, 20, 22, 20, 17, 7]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003656", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(32, 47) == 1504\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(32, 47) == 1504\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003657", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'a': 5, 'b': 7, 'e': 10, 'c': 6}, 7) == {'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 5, 'b': 7, 'e': 10, 'c': 6}, 7) == {'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003658", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-8, 2, -5], [-6, 3, -4], [3, -1, -5]], [[-9, 8, 2], [4, -2, -8], [6, 5, -1]]) == [[-17, 10, -3], [-2, 1, -12], [9, 4, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 2, -5], [-6, 3, -4], [3, -1, -5]], [[-9, 8, 2], [4, -2, -8], [6, 5, -1]]) == [[-17, 10, -3], [-2, 1, -12], [9, 4, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003659", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([6, [0, 0], [0, 5]]) == [6, 0, 0, 0, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [0, 0], [0, 5]]) == [6, 0, 0, 0, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003660", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([40, 30, 38, 32, 38, 43, 19, 0, 0, 44]) == [0, 0, 19, 30, 32, 38, 38, 40, 43, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 30, 38, 32, 38, 43, 19, 0, 0, 44]) == [0, 0, 19, 30, 32, 38, 38, 40, 43, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003661", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'coconut', 'cherry', 'date', 'banana', 'berry', 'avocado']) == {'c': ['cherry', 'coconut', 'cherry'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'coconut', 'cherry', 'date', 'banana', 'berry', 'avocado']) == {'c': ['cherry', 'coconut', 'cherry'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003662", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CMLV') == 955\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CMLV') == 955\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003663", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('41,dc,de,ec') == ['41', 'dc', 'de', 'ec']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('41,dc,de,ec') == ['41', 'dc', 'de', 'ec']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003664", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MMCDLIV') == 2454\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCDLIV') == 2454\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003665", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(123, 161) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(123, 161) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003666", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([27, 23, 25, 40]) == [23, 25, 27, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([27, 23, 25, 40]) == [23, 25, 27, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003667", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[2, 0], [5, 9], [2, 6], [3, 8]]) == [[2, 5, 2, 3], [0, 9, 6, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 0], [5, 9], [2, 6], [3, 8]]) == [[2, 5, 2, 3], [0, 9, 6, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003668", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(734) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(734) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003669", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('10') == 10\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10') == 10\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003670", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 6, 'a': 72, 'e': 84, 'c': 14, 'd': 27}) == {6: 'b', 72: 'a', 84: 'e', 14: 'c', 27: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 6, 'a': 72, 'e': 84, 'c': 14, 'd': 27}) == {6: 'b', 72: 'a', 84: 'e', 14: 'c', 27: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003671", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9, 4, 7], [3, 8, 7, 7], 6]) == [9, 4, 7, 3, 8, 7, 7, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 4, 7], [3, 8, 7, 7], 6]) == [9, 4, 7, 3, 8, 7, 7, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003672", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h10m8s') == 7808\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h10m8s') == 7808\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003673", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 8, 9, 0, 7, 7], [4, 3, 1, 6, 3, 1]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 8, 9, 0, 7, 7], [4, 3, 1, 6, 3, 1]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003674", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(83); s.push(44); s.push(78)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(44); s.push(78)\nassert s.peek() == 78\nassert s.pop() == 78\nassert s.pop() == 44\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003675", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(322) == 99\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(322) == 99\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003676", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['b', 'c', 'a', 'b', 'e', 'c', 'd', 'a', 'c', 'e']) == {'b': 2, 'c': 3, 'a': 2, 'e': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'c', 'a', 'b', 'e', 'c', 'd', 'a', 'c', 'e']) == {'b': 2, 'c': 3, 'a': 2, 'e': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003677", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('nxvsnwzdcam') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('nxvsnwzdcam') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003678", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(303) == 'CCCIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(303) == 'CCCIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003679", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([17, 17, 12, 33, 5, 50]) == [5, 12, 17, 17, 33, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([17, 17, 12, 33, 5, 50]) == [5, 12, 17, 17, 33, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003680", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbccbca', 'cbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbccbca', 'cbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003681", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([3, 1, 2, 2], 4) == [[3, 1, 2, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 1, 2, 2], 4) == [[3, 1, 2, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003682", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-5, -1], [1, -7]], [[-1, 5], [-7, 9]]) == [[-6, 4], [-6, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -1], [1, -7]], [[-1, 5], [-7, 9]]) == [[-6, 4], [-6, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003683", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([7, 13]) == 20\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([7, 13]) == 20\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003684", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h53m41s') == 17621\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h53m41s') == 17621\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003685", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[2, 8, 0], [7, 4, 6]]) == [[2, 7], [8, 4], [0, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 8, 0], [7, 4, 6]]) == [[2, 7], [8, 4], [0, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003686", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(62); s.push(22); s.push(37)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(62); s.push(22); s.push(37)\nassert s.peek() == 37\nassert s.pop() == 37\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 62\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003687", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'e', 'e']) == {'d': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'e']) == {'d': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003688", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 3, 8, 7, 4, 6], 11) == [3, 8, 7, 4, 6, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 3, 8, 7, 4, 6], 11) == [3, 8, 7, 4, 6, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003689", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(333) == 18\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(333) == 18\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003690", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(23, 28) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(23, 28) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003691", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([49, 40, 17, 21, 26, 42, 41]) == [17, 21, 26, 40, 41, 42, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([49, 40, 17, 21, 26, 42, 41]) == [17, 21, 26, 40, 41, 42, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003692", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['cazx', 'caxyy']) == 'ca'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cazx', 'caxyy']) == 'ca'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003693", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3899) == 'MMMDCCCXCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3899) == 'MMMDCCCXCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003694", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens(')b{){b[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')b{){b[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003695", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([20, 23, 22, 23, 22]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 23, 22, 23, 22]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003696", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(264) == 29\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(264) == 29\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003697", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('edabcdc') == 'edabc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edabcdc') == 'edabc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003698", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('bceaacaa') == 'bcea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bceaacaa') == 'bcea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003699", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('cbec,\",,aa,\",aacb,eab') == ['cbec', ',,aa,', 'aacb', 'eab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cbec,\",,aa,\",aacb,eab') == ['cbec', ',,aa,', 'aacb', 'eab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003700", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(116) == 'CXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(116) == 'CXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003701", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1117) == 7111\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1117) == 7111\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003702", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[7, 5], [-5, 1]], [[-8, -6], [3, 4]]) == [[-1, -1], [-2, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 5], [-5, 1]], [[-8, -6], [3, 4]]) == [[-1, -1], [-2, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003703", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('baac') == 'bac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('baac') == 'bac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003704", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 98, 'b': 31, 'd': 91, 'f': 33}) == {98: 'c', 31: 'b', 91: 'd', 33: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 98, 'b': 31, 'd': 91, 'f': 33}) == {98: 'c', 31: 'b', 91: 'd', 33: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003705", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=513; path=auto') == {'port': '513', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=513; path=auto') == {'port': '513', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003706", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(436)\nacc.deposit(91)\nacc.withdraw(446)\nacc.withdraw(723)\nassert acc.get_balance() == 527\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(436)\nacc.deposit(91)\nassert acc.get_balance() == 527\nacc.withdraw(446)\nassert acc.get_balance() == 81\nacc.withdraw(723)\nassert acc.get_balance() == 81\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003707", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('bc baecc') == 'Bc Baecc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bc baecc') == 'Bc Baecc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003708", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([0, [6], 6]) == [0, 6, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [6], 6]) == [0, 6, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003709", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(31); s.push(28); s.push(19)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(31); s.push(28); s.push(19)\nassert s.peek() == 19\nassert s.pop() == 19\nassert s.pop() == 28\nassert s.is_empty() == False\nassert s.pop() == 31\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003710", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[3, -5], [1, 4]], [[6, -1], [-9, 6]]) == [[9, -6], [-8, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -5], [1, 4]], [[6, -1], [-9, 6]]) == [[9, -6], [-8, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003711", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('XLV') == 45\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XLV') == 45\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003712", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(168, 89) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(168, 89) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003713", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('d dg') == 'dg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('d dg') == 'dg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003714", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-15, -9, 13, -43, -33, 7, 41, 45, 49]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-15, -9, 13, -43, -33, 7, 41, 45, 49]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003715", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(42, 45) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(42, 45) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003716", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[5, 0, -1], [6, 8, 7]], [[5, 7, 8], [-3, 2, 0]]) == [[10, 7, 7], [3, 10, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 0, -1], [6, 8, 7]], [[5, 7, 8], [-3, 2, 0]]) == [[10, 7, 7], [3, 10, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003717", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['cby', 'cbzzz']) == 'cb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cby', 'cbzzz']) == 'cb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003718", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('hdzzaouyuu') == 5\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hdzzaouyuu') == 5\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003719", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 5, 'w': 6}, {'w': 4, 'z': 6, 'x': 6}) == {'x': 11, 'w': 10, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 5, 'w': 6}, {'w': 4, 'z': 6, 'x': 6}) == {'x': 11, 'w': 10, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003720", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('cccbc', 'cac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cccbc', 'cac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003721", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 3, 4, 5]) == [5, 3, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 3, 4, 5]) == [5, 3, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003722", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[1, 3], 3, [3, 0, 3]]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[1, 3], 3, [3, 0, 3]]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003723", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'w': 6}, {'w': 9, 'z': 9, 'x': 1}) == {'z': 11, 'w': 15, 'x': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'w': 6}, {'w': 9, 'z': 9, 'x': 1}) == {'z': 11, 'w': 15, 'x': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003724", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('aaabaabaaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaabaabaaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003725", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([5, 5, 6, 6, 8, 8], [0, 13, 15]) == [0, 5, 5, 6, 6, 8, 8, 13, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 5, 6, 6, 8, 8], [0, 13, 15]) == [0, 5, 5, 6, 6, 8, 8, 13, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003726", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('){') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('){') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003727", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 41, 'f': 17, 'a': 58}) == {41: 'b', 17: 'f', 58: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 41, 'f': 17, 'a': 58}) == {41: 'b', 17: 'f', 58: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003728", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(1); s.push(38); s.push(80)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(1); s.push(38); s.push(80)\nassert s.peek() == 80\nassert s.pop() == 80\nassert s.pop() == 38\nassert s.is_empty() == False\nassert s.pop() == 1\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003729", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([50, 49, 21, 6, 3, 5, 36]) == [3, 5, 6, 21, 36, 49, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([50, 49, 21, 6, 3, 5, 36]) == [3, 5, 6, 21, 36, 49, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003730", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([9, 16, 9, 28, 18, 4]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 16, 9, 28, 18, 4]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003731", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[0, 3, 2, 4], [6, 0, 6, 7], [7, 8, 0, 8], [8, 0, 3, 9]]) == [[0, 6, 7, 8], [3, 0, 8, 0], [2, 6, 0, 3], [4, 7, 8, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 3, 2, 4], [6, 0, 6, 7], [7, 8, 0, 8], [8, 0, 3, 9]]) == [[0, 6, 7, 8], [3, 0, 8, 0], [2, 6, 0, 3], [4, 7, 8, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003732", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 1, 4, 5, 4, 0, 2, 4, 4]) == [2, 1, 4, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 4, 5, 4, 0, 2, 4, 4]) == [2, 1, 4, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003733", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(2316) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2316) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003734", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(35); s.push(72); s.push(60)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(35); s.push(72); s.push(60)\nassert s.peek() == 60\nassert s.pop() == 60\nassert s.pop() == 72\nassert s.is_empty() == False\nassert s.pop() == 35\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003735", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[()(())]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[()(())]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003736", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(5, 50) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(5, 50) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003737", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[6, -2, -1], [7, -1, 1]], [[2, -6, -6], [2, 1, 7]]) == [[8, -8, -7], [9, 0, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -2, -1], [7, -1, 1]], [[2, -6, -6], [2, 1, 7]]) == [[8, -8, -7], [9, 0, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003738", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-7, -1, -5], [-9, -5, 5]], [[3, 4, -7], [6, 6, -6]]) == [[-4, 3, -12], [-3, 1, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, -1, -5], [-9, -5, 5]], [[3, 4, -7], [6, 6, -6]]) == [[-4, 3, -12], [-3, 1, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003739", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['ccxzz', 'ccxyx', 'cc', 'ccyxx']) == 'cc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ccxzz', 'ccxyx', 'cc', 'ccyxx']) == 'cc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003740", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('ecdcd baea') == 'Ecdcd Baea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ecdcd baea') == 'Ecdcd Baea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003741", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 7, 3, 2, 1, 4, 2, 8, 3], 4) == [[9, 7, 3, 2], [1, 4, 2, 8], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 7, 3, 2, 1, 4, 2, 8, 3], 4) == [[9, 7, 3, 2], [1, 4, 2, 8], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003742", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(1192) == 'MCXCII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1192) == 'MCXCII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003743", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dddddddddd') == 'd10'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddddddd') == 'd10'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003744", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('aaad', 'aaad') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aaad', 'aaad') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003745", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 4, 5, 5, 3]) == [4, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 5, 5, 3]) == [4, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003746", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(10 * 16) * (9 + 2)') == 1760\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(10 * 16) * (9 + 2)') == 1760\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003747", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 5, 2, 0, 2]) == [1, 5, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 2, 0, 2]) == [1, 5, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003748", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([44, 10, 45, 17, 24, 14, 30, 10, 47, 35, 47, 30, 29]) == [10, 10, 14, 17, 24, 29, 30, 30, 35, 44, 45, 47, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([44, 10, 45, 17, 24, 14, 30, 10, 47, 35, 47, 30, 29]) == [10, 10, 14, 17, 24, 29, 30, 30, 35, 44, 45, 47, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003749", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([13, 16, 17, 17, 2, 18]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 16, 17, 17, 2, 18]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003750", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aaccabc') == 'acb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaccabc') == 'acb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003751", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('aaaabaacda') == 'abcd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaaabaacda') == 'abcd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003752", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(18, 16, 76) == 20\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 16, 76) == 20\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003753", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[4], [3, 9, 4], [4, 0, 7], 9]) == [4, 3, 9, 4, 4, 0, 7, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], [3, 9, 4], [4, 0, 7], 9]) == [4, 3, 9, 4, 4, 0, 7, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003754", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('World World', 12) == 'Iadxp Iadxp'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World World', 12) == 'Iadxp Iadxp'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003755", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 94, 'd': 75}) == {94: 'b', 75: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 94, 'd': 75}) == {94: 'b', 75: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003756", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('ccccbbcccc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccccbbcccc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003757", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(62, 42) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(62, 42) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003758", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 87, 'f': 25, 'e': 52}) == {87: 'd', 25: 'f', 52: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 87, 'f': 25, 'e': 52}) == {87: 'd', 25: 'f', 52: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003759", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([14, 14, 24, 5, 24, 0]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 14, 24, 5, 24, 0]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003760", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([13, 17, 52, 73, 82], 184) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 17, 52, 73, 82], 184) == -1\nassert binary_search([13, 17, 52, 73, 82], 13) == 0\nassert binary_search([13, 17, 52, 73, 82], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003761", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(10) == 6\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(10) == 6\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003762", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(8501) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8501) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003763", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([8, 39, 45, 6, 41, 29]) == [6, 8, 29, 39, 41, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([8, 39, 45, 6, 41, 29]) == [6, 8, 29, 39, 41, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003764", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abcbccbbcbb', 'acaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abcbccbbcbb', 'acaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003765", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bcbbcb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcbbcb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003766", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=734; mode=auto') == {'user': '734', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=734; mode=auto') == {'user': '734', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003767", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 3, 0, 4, 0, 1]) == [2, 3, 0, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 0, 4, 0, 1]) == [2, 3, 0, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003768", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[7, 3, 3, 4], [7, 8], 7]) == [7, 3, 3, 4, 7, 8, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 3, 3, 4], [7, 8], 7]) == [7, 3, 3, 4, 7, 8, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003769", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MCCCLXXVIII') == 1378\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCCCLXXVIII') == 1378\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003770", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('yyfxaxfxx') == 'xxfxaxfyy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('yyfxaxfxx') == 'xxfxaxfyy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003771", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the sun ran dog the. sun Ran cat, cat the') == {'the': 3, 'sun': 2, 'ran': 2, 'dog': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the sun ran dog the. sun Ran cat, cat the') == {'the': 3, 'sun': 2, 'ran': 2, 'dog': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003772", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([25, 39, 7, 18, 48, 39, 38]) == [7, 18, 25, 38, 39, 39, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 39, 7, 18, 48, 39, 38]) == [7, 18, 25, 38, 39, 39, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003773", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([24, 39, 36, 15, 4, 38, 31, 27]) == [4, 15, 24, 27, 31, 36, 38, 39]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 39, 36, 15, 4, 38, 31, 27]) == [4, 15, 24, 27, 31, 36, 38, 39]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003774", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('dcebae', 'deecba') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dcebae', 'deecba') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003775", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([2, 3, 5, 2], 4) == [2, 3, 5, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 3, 5, 2], 4) == [2, 3, 5, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003776", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 8, 6, 4, 3, 7, 7, 3, 9], 6) == [4, 3, 7, 7, 3, 9, 9, 8, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 8, 6, 4, 3, 7, 7, 3, 9], 6) == [4, 3, 7, 7, 3, 9, 9, 8, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003777", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bbaabbaabb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbaabbaabb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003778", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[9, 3, 9], [0, 3, 2]]) == [9, 3, 9, 0, 3, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[9, 3, 9], [0, 3, 2]]) == [9, 3, 9, 0, 3, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003779", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('bdhc') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('bdhc') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003780", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran, the the Sat sat ran dog sat, the sun') == {'ran': 2, 'the': 3, 'sat': 3, 'dog': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran, the the Sat sat ran dog sat, the sun') == {'ran': 2, 'the': 3, 'sat': 3, 'dog': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003781", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat. cat The cat. ran') == {'cat': 3, 'the': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat. cat The cat. ran') == {'cat': 3, 'the': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003782", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('bcc,eadd,68,be,71') == ['bcc', 'eadd', '68', 'be', '71']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bcc,eadd,68,be,71') == ['bcc', 'eadd', '68', 'be', '71']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003783", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([4, 18, 31, 68], 68) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 18, 31, 68], 68) == 3\nassert binary_search([4, 18, 31, 68], 4) == 0\nassert binary_search([4, 18, 31, 68], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003784", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('The sat, ran, ran') == {'the': 1, 'sat': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The sat, ran, ran') == {'the': 1, 'sat': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003785", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([26, 11, 16]) == [11, 16, 26]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([26, 11, 16]) == [11, 16, 26]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003786", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('9m27s') == 567\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('9m27s') == 567\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003787", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 5, 8, 5, 6, 1, 3, 5], [6, 6, 7, 9]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 5, 8, 5, 6, 1, 3, 5], [6, 6, 7, 9]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003788", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 55, 'f': 83, 'a': 89, 'd': 60}) == {55: 'b', 83: 'f', 89: 'a', 60: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 55, 'f': 83, 'a': 89, 'd': 60}) == {55: 'b', 83: 'f', 89: 'a', 60: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003789", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 5, 1, 1, 5, 2, 1, 3]) == [3, 5, 1, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 1, 1, 5, 2, 1, 3]) == [3, 5, 1, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003790", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 8, 'w': 5, 'z': 7}, {'x': 9}) == {'y': 8, 'w': 5, 'z': 7, 'x': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8, 'w': 5, 'z': 7}, {'x': 9}) == {'y': 8, 'w': 5, 'z': 7, 'x': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003791", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([34, 50, 28, 33, 5, 46]) == [5, 28, 33, 34, 46, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 50, 28, 33, 5, 46]) == [5, 28, 33, 34, 46, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003792", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 3, 5, 7, 0, 0, 1, 0, 0, 9], 3) == [0, 0, 9, 9, 3, 5, 7, 0, 0, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 3, 5, 7, 0, 0, 1, 0, 0, 9], 3) == [0, 0, 9, 9, 3, 5, 7, 0, 0, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003793", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('foyevotkdxrk') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('foyevotkdxrk') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003794", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([23, 26, 17, 11, 9, 27]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 26, 17, 11, 9, 27]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003795", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 4, 9, 5, 6, 9, 8], 4) == [[1, 4, 9, 5], [6, 9, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 4, 9, 5, 6, 9, 8], 4) == [[1, 4, 9, 5], [6, 9, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003796", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([29, 29, 0, 1, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 29, 0, 1, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003797", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCXVII') == 217\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXVII') == 217\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003798", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 5, 3, 0, 9, 7, 9, 1], 7) == [5, 3, 0, 9, 7, 9, 1, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 5, 3, 0, 9, 7, 9, 1], 7) == [5, 3, 0, 9, 7, 9, 1, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003799", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([6, 9, 0, 9, 9, 1, 0, 1], 2) == [0, 1, 6, 9, 0, 9, 9, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 9, 0, 9, 9, 1, 0, 1], 2) == [0, 1, 6, 9, 0, 9, 9, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003800", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MDCCXLVII') == 1747\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDCCXLVII') == 1747\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003801", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([12, 23, 24, 35, 23]) == [12, 23, 23, 24, 35]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([12, 23, 24, 35, 23]) == [12, 23, 23, 24, 35]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_003802", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(54); s.push(82); s.push(62)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(54); s.push(82); s.push(62)\nassert s.peek() == 62\nassert s.pop() == 62\nassert s.pop() == 82\nassert s.is_empty() == False\nassert s.pop() == 54\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003803", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[a(ab((') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[a(ab((') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003804", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('aaafbe', 'aaabfe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aaafbe', 'aaabfe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003805", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=on; user=on; mode=367') == {'host': 'on', 'user': 'on', 'mode': '367'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; user=on; mode=367') == {'host': 'on', 'user': 'on', 'mode': '367'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003806", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([15, 17, 17]) == [15, 17, 17]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([15, 17, 17]) == [15, 17, 17]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003807", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 2, 2, 3, 2]) == [1, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 2, 3, 2]) == [1, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003808", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(762) == 27\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(762) == 27\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003809", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(3, 7) == 2187\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(3, 7) == 2187\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003810", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 2, 'z': 8}, {'z': 4, 'x': 6, 'w': 2}) == {'w': 4, 'z': 12, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2, 'z': 8}, {'z': 4, 'x': 6, 'w': 2}) == {'w': 4, 'z': 12, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003811", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([3, 7, 7], [2, 2, 7, 2, 3, 9, 4]) == [3, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 7, 7], [2, 2, 7, 2, 3, 9, 4]) == [3, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003812", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'y': 3, 'x': 6}, {'z': 2, 'x': 5}) == {'w': 6, 'y': 3, 'x': 11, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'y': 3, 'x': 6}, {'z': 2, 'x': 5}) == {'w': 6, 'y': 3, 'x': 11, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003813", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h40m45s') == 9645\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h40m45s') == 9645\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003814", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([43, 0, 15, 24, 29, 12, 34, 37, 0, 20, 49]) == [0, 0, 12, 15, 20, 24, 29, 34, 37, 43, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([43, 0, 15, 24, 29, 12, 34, 37, 0, 20, 49]) == [0, 0, 12, 15, 20, 24, 29, 34, 37, 43, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003815", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 81, 'e': 30, 'd': 29}) == {81: 'a', 30: 'e', 29: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 81, 'e': 30, 'd': 29}) == {81: 'a', 30: 'e', 29: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003816", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'e': 3, 'b': 2}, 3) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 3, 'b': 2}, 3) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003817", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([2, [3, [3]]]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([2, [3, [3]]]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003818", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(979812) == 989\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(979812) == 989\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003819", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('edxaab') == 'baaxde'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('edxaab') == 'baaxde'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003820", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(4060) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4060) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003821", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('([])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('([])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003822", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([16, 26, 16, 15]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 26, 16, 15]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003823", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(1847) == 'MDCCCXLVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1847) == 'MDCCCXLVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003824", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(15 * 10) + 10 - 4') == 156\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(15 * 10) + 10 - 4') == 156\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003825", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Code Python', 3) == 'Frgh Sbwkrq'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Python', 3) == 'Frgh Sbwkrq'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003826", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([4, 6, 8, 13, 17, 18, 19], [2, 4, 8, 14]) == [2, 4, 4, 6, 8, 8, 13, 14, 17, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 6, 8, 13, 17, 18, 19], [2, 4, 8, 14]) == [2, 4, 4, 6, 8, 8, 13, 14, 17, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003827", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('a{b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a{b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003828", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('caaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003829", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(73) == [73]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(73) == [73]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003830", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(9642) == 98\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9642) == 98\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003831", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(3, 167, 602) == 201\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(3, 167, 602) == 201\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003832", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(103) == 301\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(103) == 301\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003833", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([45, 38, 21, -19, -32, -35, -38, 31]) == 45\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([45, 38, 21, -19, -32, -35, -38, 31]) == 45\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003834", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(1, 8) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 8) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003835", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('embsz') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('embsz') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003836", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([9, 7, 4, 0], [6, 2, 1, 8, 3]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 7, 4, 0], [6, 2, 1, 8, 3]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003837", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('56,46,95,49') == ['56', '46', '95', '49']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('56,46,95,49') == ['56', '46', '95', '49']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003838", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([4, 2, [1, 9, 3], 5]) == [4, 2, 1, 9, 3, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, 2, [1, 9, 3], 5]) == [4, 2, 1, 9, 3, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003839", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([18, 12, 12, 3]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 12, 12, 3]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003840", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(5 + 4 * 4)') == 21\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(5 + 4 * 4)') == 21\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003841", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[[4, 0], 9, [6]], 4, 3]) == [4, 0, 9, 6, 4, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[4, 0], 9, [6]], 4, 3]) == [4, 0, 9, 6, 4, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003842", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[4, 0], [2, 3], [0, 8]]) == [[4, 2, 0], [0, 3, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 0], [2, 3], [0, 8]]) == [[4, 2, 0], [0, 3, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003843", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([1, 18, -7, 0]) == 18\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([1, 18, -7, 0]) == 18\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003844", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(24, 91, 630) == 234\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(24, 91, 630) == 234\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003845", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('daaac') == 'dac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daaac') == 'dac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003846", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([48, 16, 10, 48, 32, 3]) == [3, 10, 16, 32, 48, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([48, 16, 10, 48, 32, 3]) == [3, 10, 16, 32, 48, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003847", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-1, -8, -8], [-5, -7, 6], [7, -4, -9]], [[7, 7, -3], [4, -4, -2], [1, 3, -5]]) == [[6, -1, -11], [-1, -11, 4], [8, -1, -14]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -8, -8], [-5, -7, 6], [7, -4, -9]], [[7, 7, -3], [4, -4, -2], [1, 3, -5]]) == [[6, -1, -11], [-1, -11, 4], [8, -1, -14]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003848", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([1]) == [1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1]) == [1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003849", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(66); s.push(23); s.push(63)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(66); s.push(23); s.push(63)\nassert s.peek() == 63\nassert s.pop() == 63\nassert s.pop() == 23\nassert s.is_empty() == False\nassert s.pop() == 66\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003850", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('gdbcaa bfbgcchg ffbeb') == 'bfbgcchg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gdbcaa bfbgcchg ffbeb') == 'bfbgcchg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003851", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(213) == [3, 71]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(213) == [3, 71]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003852", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('((8 + 3) - 20 + 11)') == 2\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((8 + 3) - 20 + 11)') == 2\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003853", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 5}, {'x': 5, 'w': 3, 'z': 2}) == {'w': 8, 'x': 5, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5}, {'x': 5, 'w': 3, 'z': 2}) == {'w': 8, 'x': 5, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003854", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['bcxy', 'bc', 'bcxxx']) == 'bc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bcxy', 'bc', 'bcxxx']) == 'bc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003855", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[2, 5], [0, 2], [3, 0]], [[4, 3, 4], [0, 2, 2]]) == [[8, 16, 18], [0, 4, 4], [12, 9, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 5], [0, 2], [3, 0]], [[4, 3, 4], [0, 2, 2]]) == [[8, 16, 18], [0, 4, 4], [12, 9, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003856", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(259) == [7, 37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(259) == [7, 37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003857", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['c', 'cyxz', 'c', 'czxy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['c', 'cyxz', 'c', 'czxy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003858", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('cabaacaacccb', 'abcb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cabaacaacccb', 'abcb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003859", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat, the dog sun sun!') == {'sat': 1, 'the': 1, 'dog': 1, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat, the dog sun sun!') == {'sat': 1, 'the': 1, 'dog': 1, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003860", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=on; mode=auto; user=auto') == {'host': 'on', 'mode': 'auto', 'user': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; mode=auto; user=auto') == {'host': 'on', 'mode': 'auto', 'user': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003861", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h11m18s') == 4278\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h11m18s') == 4278\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003862", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('bb)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('bb)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003863", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(846) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(846) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003864", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 0, 5, 10, 14, 19], [3, 10, 10, 19]) == [0, 0, 3, 5, 10, 10, 10, 14, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 0, 5, 10, 14, 19], [3, 10, 10, 19]) == [0, 0, 3, 5, 10, 10, 10, 14, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003865", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[[4, 7], 7, [5]]]) == [4, 7, 7, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[4, 7], 7, [5]]]) == [4, 7, 7, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003866", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 3, 4], [3, 5, 1], [3, 5, 3]], [[4, 0], [2, 5], [0, 2]]) == [[18, 23], [22, 27], [22, 31]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3, 4], [3, 5, 1], [3, 5, 3]], [[4, 0], [2, 5], [0, 2]]) == [[18, 23], [22, 27], [22, 31]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003867", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('eae', 'eaef') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('eae', 'eaef') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003868", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('cbbededdae') == 'cbeda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbbededdae') == 'cbeda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003869", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(303767) == 551\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(303767) == 551\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003870", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'apple', 'avocado']) == {'c': ['coconut', 'cherry'], 'a': ['apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'apple', 'avocado']) == {'c': ['coconut', 'cherry'], 'a': ['apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003871", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('adech cc cghbg b dhcfcbf bga') == 'dhcfcbf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('adech cc cghbg b dhcfcbf bga') == 'dhcfcbf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003872", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(257) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(257) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003873", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('nftxxshdxo') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('nftxxshdxo') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003874", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 1, 3, 5, 4, 2, 4, 1, 5, 4, 5, 3]) == [4, 1, 3, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 3, 5, 4, 2, 4, 1, 5, 4, 5, 3]) == [4, 1, 3, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003875", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([3, -5, -16]) == -18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([3, -5, -16]) == -18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003876", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('wsfmslgsicpp') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('wsfmslgsicpp') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003877", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([0, 3, 0], [1, 7, 4, 9, 4, 9, 1, 9]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 3, 0], [1, 7, 4, 9, 4, 9, 1, 9]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003878", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('edaab') == 'edab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edaab') == 'edab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003879", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 5, 1, 3, 4, 6, 4, 2], 3) == [[9, 5, 1], [3, 4, 6], [4, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 5, 1, 3, 4, 6, 4, 2], 3) == [[9, 5, 1], [3, 4, 6], [4, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003880", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[{()b({') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{()b({') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003881", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('DCCLIII') == 753\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DCCLIII') == 753\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003882", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[8, 8, 0], [8, 6, 6], [6, 0, 0]]) == [[8, 8, 6], [8, 6, 0], [0, 6, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 8, 0], [8, 6, 6], [6, 0, 0]]) == [[8, 8, 6], [8, 6, 0], [0, 6, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003883", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aabbabbbbb', 'aaba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbabbbbb', 'aaba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003884", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(244) == 21\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(244) == 21\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003885", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(40); s.push(93); s.push(47)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(40); s.push(93); s.push(47)\nassert s.peek() == 47\nassert s.pop() == 47\nassert s.pop() == 93\nassert s.is_empty() == False\nassert s.pop() == 40\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003886", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(1, 12) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 12) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003887", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(3533) == 3353\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3533) == 3353\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003888", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([17, 9, 27, 2, 2, 9]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 9, 27, 2, 2, 9]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003889", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[3], [8, 2, 2, 1], 8, 1]) == [3, 8, 2, 2, 1, 8, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3], [8, 2, 2, 1], 8, 1]) == [3, 8, 2, 2, 1, 8, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003890", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['zy', 'y', '', 'zz']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zy', 'y', '', 'zz']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003891", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('caehggd gehbdbd gcadgeg') == 'caehggd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('caehggd gehbdbd gcadgeg') == 'caehggd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003892", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-7, -6, -8], [-9, 3, 3]], [[3, -5, 0], [-9, -2, -8]]) == [[-4, -11, -8], [-18, 1, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, -6, -8], [-9, 3, 3]], [[3, -5, 0], [-9, -2, -8]]) == [[-4, -11, -8], [-18, 1, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003893", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(2999) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2999) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003894", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('eeebd') == 'ebd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeebd') == 'ebd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003895", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['axxz', 'a', 'axzz', 'ayyy']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['axxz', 'a', 'axzz', 'ayyy']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003896", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[8, 1, 6, 8], [8, 4, 0, 4]]) == [8, 1, 6, 8, 8, 4, 0, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 1, 6, 8], [8, 4, 0, 4]]) == [8, 1, 6, 8, 8, 4, 0, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003897", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('((4 * 8) + 13 * 10)') == 162\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((4 * 8) + 13 * 10)') == 162\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003898", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[4, -1], [2, 5]], [[7, 0], [-1, -9]]) == [[11, -1], [1, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, -1], [2, 5]], [[7, 0], [-1, -9]]) == [[11, -1], [1, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003899", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['avocado', 'avocado', 'apple', 'date', 'date', 'apple', 'banana']) == {'a': ['avocado', 'avocado', 'apple', 'apple'], 'd': ['date', 'date'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'avocado', 'apple', 'date', 'date', 'apple', 'banana']) == {'a': ['avocado', 'avocado', 'apple', 'apple'], 'd': ['date', 'date'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003900", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([36, 41, 38]) == [36, 38, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 41, 38]) == [36, 38, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_003901", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 8, 'f': 12, 'a': 36, 'c': 98, 'b': 31}) == {8: 'e', 12: 'f', 36: 'a', 98: 'c', 31: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 8, 'f': 12, 'a': 36, 'c': 98, 'b': 31}) == {8: 'e', 12: 'f', 36: 'a', 98: 'c', 31: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003902", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([5, 8, 6, 8, 9, 4, 8, 7, 0, 2, 3, 5, 7, 5, 3], 2) == [[5, 8], [6, 8], [9, 4], [8, 7], [0, 2], [3, 5], [7, 5], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 8, 6, 8, 9, 4, 8, 7, 0, 2, 3, 5, 7, 5, 3], 2) == [[5, 8], [6, 8], [9, 4], [8, 7], [0, 2], [3, 5], [7, 5], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003903", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 3) == 'abc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003904", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(72) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(72) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003905", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('()()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003906", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[5, 7, 1], [2, 8, 7], [9, 4, 9]]) == [[5, 2, 9], [7, 8, 4], [1, 7, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 7, 1], [2, 8, 7], [9, 4, 9]]) == [[5, 2, 9], [7, 8, 4], [1, 7, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003907", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(42, 64, 487) == 277\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(42, 64, 487) == 277\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003908", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbaabbaaaaa', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaabbaaaaa', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003909", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 0, 2, 3, 1]) == [3, 0, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 2, 3, 1]) == [3, 0, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003910", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=313; host=off; mode=auto') == {'port': '313', 'host': 'off', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=313; host=off; mode=auto') == {'port': '313', 'host': 'off', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003911", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(573599) == 757\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(573599) == 757\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003912", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 2, 2, 5, 3, 5, 1, 3, 3, 3, 1, 1]) == [3, 2, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 2, 2, 5, 3, 5, 1, 3, 3, 3, 1, 1]) == [3, 2, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003913", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(13 + 4) + 2') == 19\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(13 + 4) + 2') == 19\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003914", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(3834) == 61\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3834) == 61\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003915", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('88,\",a,\",38,65,bdbb') == ['88', ',a,', '38', '65', 'bdbb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('88,\",a,\",38,65,bdbb') == ['88', ',a,', '38', '65', 'bdbb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003916", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('XCVII') == 97\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XCVII') == 97\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003917", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bcacb', 'abc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcacb', 'abc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003918", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('25m43s') == 1543\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('25m43s') == 1543\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003919", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('poawp') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('poawp') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003920", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(498)\nacc.deposit(220)\nacc.withdraw(223)\nacc.withdraw(772)\nassert acc.get_balance() == 718\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(498)\nacc.deposit(220)\nassert acc.get_balance() == 718\nacc.withdraw(223)\nassert acc.get_balance() == 495\nacc.withdraw(772)\nassert acc.get_balance() == 495\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003921", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(83); s.push(68); s.push(38)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(68); s.push(38)\nassert s.peek() == 38\nassert s.pop() == 38\nassert s.pop() == 68\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003922", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 99, 'a': 65, 'd': 43, 'b': 76, 'e': 32}) == {99: 'f', 65: 'a', 43: 'd', 76: 'b', 32: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 99, 'a': 65, 'd': 43, 'b': 76, 'e': 32}) == {99: 'f', 65: 'a', 43: 'd', 76: 'b', 32: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003923", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1418) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1418) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003924", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h9m56s') == 11396\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h9m56s') == 11396\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003925", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(3 * 3 - 6 * 15)') == -81\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(3 * 3 - 6 * 15)') == -81\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003926", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 3}, {'z': 2}) == {'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3}, {'z': 2}) == {'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003927", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([6, 7, 0, 2, 7], [3, 1, 0, 3, 1, 1]) == [0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 7, 0, 2, 7], [3, 1, 0, 3, 1, 1]) == [0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003928", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaddddbbbbb') == 'a6d4b5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaddddbbbbb') == 'a6d4b5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003929", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(49, 51) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(49, 51) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003930", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-4, 8]) == [-4, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-4, 8]) == [-4, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003931", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('zfxx') == 'xxfz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zfxx') == 'xxfz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003932", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-6, 0, 5], [1, -2, 7], [-7, 9, -9]], [[9, 8, -8], [1, -2, 2], [-7, -7, -1]]) == [[3, 8, -3], [2, -4, 9], [-14, 2, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, 0, 5], [1, -2, 7], [-7, 9, -9]], [[9, 8, -8], [1, -2, 2], [-7, -7, -1]]) == [[3, 8, -3], [2, -4, 9], [-14, 2, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003933", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('cdcc') == 'cd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdcc') == 'cd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003934", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'date', 'date', 'date', 'berry']) == {'c': ['coconut'], 'd': ['date', 'date', 'date'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'date', 'date', 'date', 'berry']) == {'c': ['coconut'], 'd': ['date', 'date', 'date'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003935", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([3, 11, 13, 25, 64, 72, 87], 13) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 11, 13, 25, 64, 72, 87], 13) == 2\nassert binary_search([3, 11, 13, 25, 64, 72, 87], 3) == 0\nassert binary_search([3, 11, 13, 25, 64, 72, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003936", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[8, -5, 5], [9, -5, -5], [8, -8, 6]], [[9, 4, -5], [7, 0, -1], [-3, 9, -7]]) == [[17, -1, 0], [16, -5, -6], [5, 1, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -5, 5], [9, -5, -5], [8, -8, 6]], [[9, 4, -5], [7, 0, -1], [-3, 9, -7]]) == [[17, -1, 0], [16, -5, -6], [5, 1, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003937", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(1522) == 39\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1522) == 39\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003938", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[2, 8], [3, 5], [8, 3]]) == [[2, 3, 8], [8, 5, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 8], [3, 5], [8, 3]]) == [[2, 3, 8], [8, 5, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003939", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([4, [[1, 8], [2, 5], [6]]]) == [4, 1, 8, 2, 5, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([4, [[1, 8], [2, 5], [6]]]) == [4, 1, 8, 2, 5, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003940", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'cherry']) == {'b': ['berry'], 'c': ['cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'cherry']) == {'b': ['berry'], 'c': ['cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003941", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 0, 5, 8, 0, 9, 7], [0, 2, 7, 6, 6, 5, 9, 9]) == [0, 5, 9, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 0, 5, 8, 0, 9, 7], [0, 2, 7, 6, 6, 5, 9, 9]) == [0, 5, 9, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003942", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('aaf') == 'faa'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('aaf') == 'faa'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003943", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaaaabbaaa', 'aabb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaabbaaa', 'aabb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003944", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 4, 1, 2, 5, 1, 0, 5]) == [5, 4, 1, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 1, 2, 5, 1, 0, 5]) == [5, 4, 1, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003945", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([47, 6, 43, 5, 46]) == [5, 6, 43, 46, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([47, 6, 43, 5, 46]) == [5, 6, 43, 46, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003946", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([4, [3, 4, 3], [9, 0]]) == 23\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, [3, 4, 3], [9, 0]]) == 23\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003947", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 4, 4, 3, 3, 2, 0, 3]) == [3, 4, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 4, 3, 3, 2, 0, 3]) == [3, 4, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003948", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('gg c dbdbadhc caceadch f') == 'dbdbadhc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gg c dbdbadhc caceadch f') == 'dbdbadhc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003949", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(25) == [5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(25) == [5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003950", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog. Ran sat the dog dog the,') == {'dog': 3, 'ran': 1, 'sat': 1, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog. Ran sat the dog dog the,') == {'dog': 3, 'ran': 1, 'sat': 1, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003951", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[5, 5], [1, 5], [3, 1]], [[2, 1, 0], [1, 5, 2]]) == [[15, 30, 10], [7, 26, 10], [7, 8, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 5], [1, 5], [3, 1]], [[2, 1, 0], [1, 5, 2]]) == [[15, 30, 10], [7, 26, 10], [7, 8, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003952", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([1, 51, 55, 59, 86, 92], 122) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 51, 55, 59, 86, 92], 122) == -1\nassert binary_search([1, 51, 55, 59, 86, 92], 1) == 0\nassert binary_search([1, 51, 55, 59, 86, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003953", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([13, -13, 1]) == 1\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([13, -13, 1]) == 1\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003954", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([1, [7, 3, 4, 2], [3, 0, 0, 2]]) == [1, 7, 3, 4, 2, 3, 0, 0, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [7, 3, 4, 2], [3, 0, 0, 2]]) == [1, 7, 3, 4, 2, 3, 0, 0, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003955", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('((15 - 4) * (5 * 7))') == 385\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((15 - 4) * (5 * 7))') == 385\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003956", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([7, -6]) == [7, 1]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([7, -6]) == [7, 1]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003957", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([20, -2, 19, -9, -7]) == 21\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([20, -2, 19, -9, -7]) == 21\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003958", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(53) == [53]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(53) == [53]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003959", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, 5], [-2, -2]], [[3, -2], [9, -8]]) == [[9, 3], [7, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, 5], [-2, -2]], [[3, -2], [9, -8]]) == [[9, 3], [7, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003960", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([2, 2, 5, 14, 15, 18, 19], [16, 19]) == [2, 2, 5, 14, 15, 16, 18, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 2, 5, 14, 15, 18, 19], [16, 19]) == [2, 2, 5, 14, 15, 16, 18, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003961", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([13, 45, 34, 6, 34]) == [6, 13, 34, 34, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([13, 45, 34, 6, 34]) == [6, 13, 34, 34, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003962", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 0, 2, 2]) == [5, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 2, 2]) == [5, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003963", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aababa', 'baba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aababa', 'baba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003964", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CXXXIX') == 139\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXXIX') == 139\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003965", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(61) == 'LXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(61) == 'LXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003966", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([43, 40, 28, 37, 12, 1]) == [1, 12, 28, 37, 40, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([43, 40, 28, 37, 12, 1]) == [1, 12, 28, 37, 40, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003967", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{]}()') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{]}()') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003968", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbababbbb', 'bbb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbababbbb', 'bbb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_003969", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbcc') == 'b4c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbcc') == 'b4c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_003970", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 7, 8, 8, 2, 6, 5, 5, 7, 3, 5], 4) == [[6, 7, 8, 8], [2, 6, 5, 5], [7, 3, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 7, 8, 8, 2, 6, 5, 5, 7, 3, 5], 4) == [[6, 7, 8, 8], [2, 6, 5, 5], [7, 3, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003971", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('d,ccc') == ['d', 'ccc']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,ccc') == ['d', 'ccc']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003972", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(3234) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3234) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003973", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('The sun sat the cat The ran! Sat ran!') == {'the': 3, 'sun': 1, 'sat': 2, 'cat': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The sun sat the cat The ran! Sat ran!') == {'the': 3, 'sun': 1, 'sat': 2, 'cat': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003974", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('7m26s') == 446\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('7m26s') == 446\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003975", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(17 + 17) + (8 - 3)') == 39\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(17 + 17) + (8 - 3)') == 39\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_003976", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'coconut', 'date', 'date', 'banana', 'coconut']) == {'a': ['avocado'], 'c': ['cherry', 'coconut', 'coconut'], 'd': ['date', 'date'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'coconut', 'date', 'date', 'banana', 'coconut']) == {'a': ['avocado'], 'c': ['cherry', 'coconut', 'coconut'], 'd': ['date', 'date'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003977", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(7252) == 16\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7252) == 16\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003978", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(981) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(981) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003979", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(363) == 'CCCLXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(363) == 'CCCLXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003980", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([9, 20, 43]) == [9, 20, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([9, 20, 43]) == [9, 20, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003981", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(851223) == 922\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(851223) == 922\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003982", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('46m32s') == 2792\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('46m32s') == 2792\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003983", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('fbb', 'fbbb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fbb', 'fbbb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003984", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([8, 20, 18, 20]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 20, 18, 20]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003985", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 7, 2, 4, 5], 4) == [[2, 7, 2, 4], [5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 7, 2, 4, 5], 4) == [[2, 7, 2, 4], [5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003986", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([15, 36, 42, 45, 3, 44, 40, 7, 20, 6]) == [3, 6, 7, 15, 20, 36, 40, 42, 44, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([15, 36, 42, 45, 3, 44, 40, 7, 20, 6]) == [3, 6, 7, 15, 20, 36, 40, 42, 44, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003987", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-14, 38, 43, 27, -45]) == 43\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-14, 38, 43, 27, -45]) == 43\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003988", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 3, 3, 0, 3, 4, 3]) == [3, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 3, 0, 3, 4, 3]) == [3, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003989", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaccbccbccabaa', 'aaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaccbccbccabaa', 'aaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_003990", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 3, 2], [3, 2, 3, 4, 5, 2, 3]) == [3, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 3, 2], [3, 2, 3, 4, 5, 2, 3]) == [3, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003991", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'date', 'cherry', 'avocado', 'coconut', 'cherry', 'berry', 'apple']) == {'b': ['berry', 'berry'], 'd': ['date'], 'c': ['cherry', 'coconut', 'cherry'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'cherry', 'avocado', 'coconut', 'cherry', 'berry', 'apple']) == {'b': ['berry', 'berry'], 'd': ['date'], 'c': ['cherry', 'coconut', 'cherry'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003992", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([7]) == [7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([7]) == [7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003993", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 37, 'f': 27, 'a': 38}) == {37: 'c', 27: 'f', 38: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 37, 'f': 27, 'a': 38}) == {37: 'c', 27: 'f', 38: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003994", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dcba') == 'dcba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcba') == 'dcba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003995", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('afbf befgedcb gccga accfedh ghea a') == 'befgedcb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('afbf befgedcb gccga accfedh ghea a') == 'befgedcb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_003996", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 5}, {'w': 9}) == {'y': 5, 'w': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5}, {'w': 9}) == {'y': 5, 'w': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003997", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('DXXXIV') == 534\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DXXXIV') == 534\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003998", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([7, 4, 8, 6, 7, 3, 5], [8, 7, 3, 2, 3, 5, 7]) == [7, 8, 3, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 4, 8, 6, 7, 3, 5], [8, 7, 3, 2, 3, 5, 7]) == [7, 8, 3, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_003999", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Dog the ran! ran Cat dog! cat cat! ran') == {'dog': 2, 'the': 1, 'ran': 3, 'cat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog the ran! ran Cat dog! cat cat! ran') == {'dog': 2, 'the': 1, 'ran': 3, 'cat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004000", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([7, 23, 43, 33, 18, 15, 36, 26]) == [7, 15, 18, 23, 26, 33, 36, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([7, 23, 43, 33, 18, 15, 36, 26]) == [7, 15, 18, 23, 26, 33, 36, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004001", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 2, 4, 2, 5, 5, 0, 4]) == [2, 4, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 4, 2, 5, 5, 0, 4]) == [2, 4, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004002", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([10, 10, 20, 20, 14]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 10, 20, 20, 14]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004003", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 13) == 'nop'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 13) == 'nop'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004004", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['czzy', 'czyz', 'cy', 'cyzy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['czzy', 'czyz', 'cy', 'cyzy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004005", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CDLXXXII') == 482\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXXXII') == 482\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004006", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('69,ecbb,be,ab') == ['69', 'ecbb', 'be', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('69,ecbb,be,ab') == ['69', 'ecbb', 'be', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004007", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 3], [0, 0], [1, 3]], [[3, 4], [4, 2]]) == [[21, 18], [0, 0], [15, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3], [0, 0], [1, 3]], [[3, 4], [4, 2]]) == [[21, 18], [0, 0], [15, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004008", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=293; port=auto; host=on') == {'path': '293', 'port': 'auto', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=293; port=auto; host=on') == {'path': '293', 'port': 'auto', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004009", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([21, 7, 13, 13, 7, 1, 14]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 7, 13, 13, 7, 1, 14]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004010", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([3, 4, 1]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3, 4, 1]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004011", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([18, 11, 30]) == [11, 18, 30]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([18, 11, 30]) == [11, 18, 30]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004012", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCXV') == 215\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXV') == 215\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004013", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(25) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(25) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004014", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran sun ran. Sat sat cat. cat cat') == {'ran': 2, 'sun': 1, 'sat': 2, 'cat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sun ran. Sat sat cat. cat cat') == {'ran': 2, 'sun': 1, 'sat': 2, 'cat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004015", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 3], [4, 2]], [[2, 1, 1], [0, 0, 0]]) == [[6, 3, 3], [8, 4, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3], [4, 2]], [[2, 1, 1], [0, 0, 0]]) == [[6, 3, 3], [8, 4, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004016", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('bbbabbbbabbaba', 'bbaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbabbbbabbaba', 'bbaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004017", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('caeee') == 'cae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caeee') == 'cae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004018", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=auto; user=386; mode=672; host=844') == {'path': 'auto', 'user': '386', 'mode': '672', 'host': '844'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=auto; user=386; mode=672; host=844') == {'path': 'auto', 'user': '386', 'mode': '672', 'host': '844'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004019", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 79, 'd': 85, 'a': 46, 'c': 41, 'b': 44}) == {79: 'e', 85: 'd', 46: 'a', 41: 'c', 44: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 79, 'd': 85, 'a': 46, 'c': 41, 'b': 44}) == {79: 'e', 85: 'd', 46: 'a', 41: 'c', 44: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004020", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(152) == 23\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(152) == 23\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004021", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'x': 4}, {'w': 1, 'x': 8, 'y': 6}) == {'w': 8, 'x': 12, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'x': 4}, {'w': 1, 'x': 8, 'y': 6}) == {'w': 8, 'x': 12, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004022", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('mciphquvoevd') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('mciphquvoevd') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004023", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('eaeccb') == 'eacb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eaeccb') == 'eacb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004024", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(81) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(81) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004025", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([26, 41, 21, 20, 25, 25, 26, 36]) == [20, 21, 25, 25, 26, 26, 36, 41]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([26, 41, 21, 20, 25, 25, 26, 36]) == [20, 21, 25, 25, 26, 26, 36, 41]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004026", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('5m28s') == 328\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5m28s') == 328\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004027", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('awggreao') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('awggreao') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004028", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'b', 'a', 'd']) == {'d': 2, 'b': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'b', 'a', 'd']) == {'d': 2, 'b': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004029", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2267) == 'MMCCLXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2267) == 'MMCCLXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004030", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'e': 10, 'b': 3, 'a': 4}, 2) == {'e': 10, 'b': 3, 'a': 4}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 10, 'b': 3, 'a': 4}, 2) == {'e': 10, 'b': 3, 'a': 4}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004031", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 1, 4, 2, 3, 5, 1, 0, 2, 3]) == [3, 1, 4, 2, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 4, 2, 3, 5, 1, 0, 2, 3]) == [3, 1, 4, 2, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004032", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('9 + 6 * 15') == 99\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9 + 6 * 15') == 99\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004033", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([11, 13, 18, 20], [0, 3, 3, 9, 14, 20]) == [0, 3, 3, 9, 11, 13, 14, 18, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([11, 13, 18, 20], [0, 3, 3, 9, 14, 20]) == [0, 3, 3, 9, 11, 13, 14, 18, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004034", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('c gc h cdfddfh cagadbg') == 'cdfddfh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('c gc h cdfddfh cagadbg') == 'cdfddfh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004035", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([4, 13]) == 17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([4, 13]) == 17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004036", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([1, 6, 3, 6, 7, 3], 4) == [[1, 6, 3, 6], [7, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 6, 3, 6, 7, 3], 4) == [[1, 6, 3, 6], [7, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004037", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens(')([') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')([') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004038", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([30, 31, 32, 91], 131) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([30, 31, 32, 91], 131) == -1\nassert binary_search([30, 31, 32, 91], 30) == 0\nassert binary_search([30, 31, 32, 91], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004039", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 9, 3, 5, 1, 3], 3) == [5, 1, 3, 9, 9, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 9, 3, 5, 1, 3], 3) == [5, 1, 3, 9, 9, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004040", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([13, 33, 31, 18, 27]) == [13, 18, 27, 31, 33]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([13, 33, 31, 18, 27]) == [13, 18, 27, 31, 33]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004041", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(21, 14) == 42\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 14) == 42\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004042", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(5) == 5\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(5) == 5\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004043", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(27, 33) == 297\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(27, 33) == 297\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004044", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([17, 1, 17, 38, 36, 16, 21]) == [1, 16, 17, 17, 21, 36, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([17, 1, 17, 38, 36, 16, 21]) == [1, 16, 17, 17, 21, 36, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004045", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(157) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(157) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004046", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('baaea') == 'bae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('baaea') == 'bae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004047", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([2, 2, 22, 29, 2, 2]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 2, 22, 29, 2, 2]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004048", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 11) == 'ijk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 11) == 'ijk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004049", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(37, 17) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(37, 17) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004050", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[7, 9, 0], [8, 0, 0], [6, 2, 4], [3, 1, 7]]) == [[7, 8, 6, 3], [9, 0, 2, 1], [0, 0, 4, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 9, 0], [8, 0, 0], [6, 2, 4], [3, 1, 7]]) == [[7, 8, 6, 3], [9, 0, 2, 1], [0, 0, 4, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004051", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(442) == 115\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(442) == 115\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004052", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=on; host=298; path=on') == {'mode': 'on', 'host': '298', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; host=298; path=on') == {'mode': 'on', 'host': '298', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004053", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([20, 47, 44, 8]) == [8, 20, 44, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 47, 44, 8]) == [8, 20, 44, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004054", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCCLXI') == 361\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXI') == 361\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004055", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([22, 43, 95], 22) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([22, 43, 95], 22) == 0\nassert binary_search([22, 43, 95], 22) == 0\nassert binary_search([22, 43, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004056", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'y': 6}, {'z': 9, 'y': 8}) == {'z': 13, 'y': 14}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'y': 6}, {'z': 9, 'y': 8}) == {'z': 13, 'y': 14}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004057", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([3, 4]) == [3, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 4]) == [3, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004058", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('ade aebcda') == 'Ade Aebcda'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ade aebcda') == 'Ade Aebcda'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004059", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[3, 1], [8, -5], [-8, 6]], [[6, -7], [-1, 4], [-9, 8]]) == [[9, -6], [7, -1], [-17, 14]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, 1], [8, -5], [-8, 6]], [[6, -7], [-1, 4], [-9, 8]]) == [[9, -6], [7, -1], [-17, 14]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004060", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(99); s.push(91); s.push(29)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(91); s.push(29)\nassert s.peek() == 29\nassert s.pop() == 29\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004061", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(87) == 30\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(87) == 30\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004062", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('ydzdcfzfb') == 'bfzfcdzdy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ydzdcfzfb') == 'bfzfcdzdy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004063", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([13, 39, 19, 25]) == [13, 19, 25, 39]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([13, 39, 19, 25]) == [13, 19, 25, 39]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004064", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(14, 15) == 210\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 15) == 210\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004065", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaabbbbbbbbbd') == 'a8b9d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaabbbbbbbbbd') == 'a8b9d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004066", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(48, 87, 876) == 852\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(48, 87, 876) == 852\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004067", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([1, 10, 16, 36, 46, 47, 69, 75, 80, 88], 139) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 10, 16, 36, 46, 47, 69, 75, 80, 88], 139) == -1\nassert binary_search([1, 10, 16, 36, 46, 47, 69, 75, 80, 88], 1) == 0\nassert binary_search([1, 10, 16, 36, 46, 47, 69, 75, 80, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004068", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(555) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(555) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004069", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[7, 2], [6]]) == [7, 2, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 2], [6]]) == [7, 2, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004070", "instruction": "Write fib_recursive(n) -> int: recursive fib.\n\nExample:\nassert fib_recursive(16) == 987\n\nImplement exactly this signature: `def fib_recursive(n)`. The tests call it directly.", "tests": "assert fib_recursive(16) == 987\nassert fib_recursive(0) == 0\nassert fib_recursive(10) == 55", "family": "fib_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004071", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('44m24s') == 2664\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('44m24s') == 2664\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004072", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(1580) == 'MDLXXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1580) == 'MDLXXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004073", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[2, 5, 0], [1, 3], [2]]) == [2, 5, 0, 1, 3, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 5, 0], [1, 3], [2]]) == [2, 5, 0, 1, 3, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004074", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([25, 16, 9, 33, 33, 16, 36]) == [9, 16, 16, 25, 33, 33, 36]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([25, 16, 9, 33, 33, 16, 36]) == [9, 16, 16, 25, 33, 33, 36]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004075", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([3, 0, 1, 6, 7, 2, 1, 1, 9, 6], 2) == [[3, 0], [1, 6], [7, 2], [1, 1], [9, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 0, 1, 6, 7, 2, 1, 1, 9, 6], 2) == [[3, 0], [1, 6], [7, 2], [1, 1], [9, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004076", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bdebdcdbdcdcee') == 'bdec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bdebdcdbdcdcee') == 'bdec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004077", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(705) == 26\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(705) == 26\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004078", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[3, 2], [8, 4], [4, 9]]) == [[3, 8, 4], [2, 4, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 2], [8, 4], [4, 9]]) == [[3, 8, 4], [2, 4, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004079", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 27, 'e': 35}) == {27: 'a', 35: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 27, 'e': 35}) == {27: 'a', 35: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004080", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([38, 23, 17, 37, 45, 27, 46, 26]) == [17, 23, 26, 27, 37, 38, 45, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([38, 23, 17, 37, 45, 27, 46, 26]) == [17, 23, 26, 27, 37, 38, 45, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004081", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([21, -5, -50, -36, -36, -43, -36]) == 21\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([21, -5, -50, -36, -36, -43, -36]) == 21\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004082", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(8) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(8) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004083", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[[0], 1], [[0], 8, [1]], [9]]) == [0, 1, 0, 8, 1, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[0], 1], [[0], 8, [1]], [9]]) == [0, 1, 0, 8, 1, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004084", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([2, 2, 11]) == [2, 2, 11]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 2, 11]) == [2, 2, 11]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_004085", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(4); s.push(1); s.push(65)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(4); s.push(1); s.push(65)\nassert s.peek() == 65\nassert s.pop() == 65\nassert s.pop() == 1\nassert s.is_empty() == False\nassert s.pop() == 4\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004086", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([10, 18], [0, 3, 7, 15, 15, 16, 20]) == [0, 3, 7, 10, 15, 15, 16, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([10, 18], [0, 3, 7, 15, 15, 16, 20]) == [0, 3, 7, 10, 15, 15, 16, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004087", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(143)\nacc.deposit(153)\nacc.withdraw(207)\nacc.withdraw(491)\nassert acc.get_balance() == 296\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(143)\nacc.deposit(153)\nassert acc.get_balance() == 296\nacc.withdraw(207)\nassert acc.get_balance() == 89\nacc.withdraw(491)\nassert acc.get_balance() == 89\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004088", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(4149) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4149) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004089", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(432) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(432) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004090", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CXIX') == 119\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXIX') == 119\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004091", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(3904) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3904) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004092", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([8, 3, 7, 5, 1, 9, 2], [4, 7, 9, 6, 7, 6, 7, 7]) == [7, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 3, 7, 5, 1, 9, 2], [4, 7, 9, 6, 7, 6, 7, 7]) == [7, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004093", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'banana', 'date']) == {'c': ['cherry'], 'a': ['avocado'], 'b': ['banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'banana', 'date']) == {'c': ['cherry'], 'a': ['avocado'], 'b': ['banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004094", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('efcbeybx') == 'xbyebcfe'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('efcbeybx') == 'xbyebcfe'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004095", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 24, 'c': 35, 'b': 39, 'a': 4}) == {24: 'd', 35: 'c', 39: 'b', 4: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 24, 'c': 35, 'b': 39, 'a': 4}) == {24: 'd', 35: 'c', 39: 'b', 4: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004096", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 12) == 'jkl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 12) == 'jkl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004097", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('39m10s') == 2350\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('39m10s') == 2350\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004098", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(745) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(745) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004099", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(3036) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3036) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004100", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([20, 15, 8, 42, 3, 18]) == [3, 8, 15, 18, 20, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 15, 8, 42, 3, 18]) == [3, 8, 15, 18, 20, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004101", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([3, [4]]) == [3, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([3, [4]]) == [3, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004102", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 7, 3, 5, 5, 5, 0, 8, 8, 9, 0, 0, 5, 8, 2, 8], 5) == [[6, 7, 3, 5, 5], [5, 0, 8, 8, 9], [0, 0, 5, 8, 2], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 7, 3, 5, 5, 5, 0, 8, 8, 9, 0, 0, 5, 8, 2, 8], 5) == [[6, 7, 3, 5, 5], [5, 0, 8, 8, 9], [0, 0, 5, 8, 2], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004103", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'a', 'b', 'e', 'b', 'c', 'a', 'c', 'd', 'c']) == {'e': 2, 'a': 2, 'b': 2, 'c': 3, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'b', 'e', 'b', 'c', 'a', 'c', 'd', 'c']) == {'e': 2, 'a': 2, 'b': 2, 'c': 3, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004104", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(2993) == 54\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2993) == 54\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004105", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'a': 0, 'd': 2, 'b': 9, 'c': 4}, 4) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 0, 'd': 2, 'b': 9, 'c': 4}, 4) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004106", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccccccccccc') == 'c13'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccccccccc') == 'c13'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004107", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(50) == 'L'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(50) == 'L'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004108", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'d': 79, 'a': 85, 'c': 73}) == {79: 'd', 85: 'a', 73: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 79, 'a': 85, 'c': 73}) == {79: 'd', 85: 'a', 73: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004109", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([10, 10, 8, 17, 6]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 10, 8, 17, 6]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004110", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([49, 71, 90, 93], 93) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([49, 71, 90, 93], 93) == 3\nassert binary_search([49, 71, 90, 93], 49) == 0\nassert binary_search([49, 71, 90, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004111", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 1, 5, 3, 1, 1, 1, 3, 3, 5]) == [5, 1, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 5, 3, 1, 1, 1, 3, 3, 5]) == [5, 1, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004112", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[]{}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004113", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 2, 1, 4], 3) == [[8, 2, 1], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 2, 1, 4], 3) == [[8, 2, 1], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004114", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(241) == 21\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(241) == 21\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004115", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bbaaaaaabb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbaaaaaabb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004116", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3788) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3788) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004117", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=off; mode=260; path=auto; host=off') == {'port': 'off', 'mode': '260', 'path': 'auto', 'host': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; mode=260; path=auto; host=off') == {'port': 'off', 'mode': '260', 'path': 'auto', 'host': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004118", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog, the sun, Sat dog ran sat') == {'dog': 2, 'the': 1, 'sun': 1, 'sat': 2, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog, the sun, Sat dog ran sat') == {'dog': 2, 'the': 1, 'sun': 1, 'sat': 2, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004119", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[7, 5], [-5, -1]], [[5, 3], [-8, -7]]) == [[12, 8], [-13, -8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 5], [-5, -1]], [[5, 3], [-8, -7]]) == [[12, 8], [-13, -8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004120", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(493) == 48\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(493) == 48\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004121", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([32, 12, 38, 2, 17, 1, 45, 3, 22, 23, 9, 16]) == [1, 2, 3, 9, 12, 16, 17, 22, 23, 32, 38, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 12, 38, 2, 17, 1, 45, 3, 22, 23, 9, 16]) == [1, 2, 3, 9, 12, 16, 17, 22, 23, 32, 38, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004122", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([7, 4, 0, 4, 3, 6, 1, 6], 5) == [4, 3, 6, 1, 6, 7, 4, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 4, 0, 4, 3, 6, 1, 6], 5) == [4, 3, 6, 1, 6, 7, 4, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004123", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([8, 0]) == [8, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([8, 0]) == [8, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004124", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbbbbbcccccc') == 'b7c6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbcccccc') == 'b7c6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004125", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'cherry', 'banana', 'berry', 'cherry', 'coconut', 'avocado', 'date']) == {'d': ['date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'banana', 'berry', 'cherry', 'coconut', 'avocado', 'date']) == {'d': ['date', 'date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004126", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 1, 1, 3, 5, 4, 5]) == [3, 1, 5, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 1, 3, 5, 4, 5]) == [3, 1, 5, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004127", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([4, 15, 10, 27, 10, 10]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 15, 10, 27, 10, 10]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004128", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([16, 21, 16, 4, 4]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 21, 16, 4, 4]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004129", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(109) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(109) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004130", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 4, 1, 5, 0]) == [3, 4, 1, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 1, 5, 0]) == [3, 4, 1, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004131", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['', 'xx', 'z']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['', 'xx', 'z']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004132", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2747) == 'MMDCCXLVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2747) == 'MMDCCXLVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004133", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-4, 7, 6], [8, 8, -8]], [[9, -4, 7], [-6, 5, 7]]) == [[5, 3, 13], [2, 13, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 7, 6], [8, 8, -8]], [[9, -4, 7], [-6, 5, 7]]) == [[5, 3, 13], [2, 13, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004134", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(49, 48) == 2352\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(49, 48) == 2352\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004135", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat sat ran, sat the dog. dog ran') == {'sat': 3, 'ran': 2, 'the': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sat ran, sat the dog. dog ran') == {'sat': 3, 'ran': 2, 'the': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004136", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(388) == [2, 2, 97]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(388) == [2, 2, 97]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004137", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('35m46s') == 2146\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('35m46s') == 2146\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004138", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[5, 6], [6, 8], [-5, 7], [8, -4]], [[-2, 8], [2, 8], [9, -2], [4, 2]]) == [[3, 14], [8, 16], [4, 5], [12, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 6], [6, 8], [-5, 7], [8, -4]], [[-2, 8], [2, 8], [9, -2], [4, 2]]) == [[3, 14], [8, 16], [4, 5], [12, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004139", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[0, 9, 8, 5], 4, 0]) == [0, 9, 8, 5, 4, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 9, 8, 5], 4, 0]) == [0, 9, 8, 5, 4, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004140", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-4, 3, 4], [-1, 4, -3]], [[-8, -4, -7], [3, -6, 2]]) == [[-12, -1, -3], [2, -2, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 3, 4], [-1, 4, -3]], [[-8, -4, -7], [3, -6, 2]]) == [[-12, -1, -3], [2, -2, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004141", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 85, 'c': 99, 'f': 43}) == {85: 'e', 99: 'c', 43: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 85, 'c': 99, 'f': 43}) == {85: 'e', 99: 'c', 43: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004142", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 1, 'c': 8, 'e': 10, 'a': 8}, 5) == {'c': 8, 'e': 10, 'a': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 1, 'c': 8, 'e': 10, 'a': 8}, 5) == {'c': 8, 'e': 10, 'a': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004143", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(59, 4) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 4) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004144", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMDLXIII') == 2563\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDLXIII') == 2563\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004145", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('62,b,ecb,aacd,\",,,ab\"') == ['62', 'b', 'ecb', 'aacd', ',,,ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('62,b,ecb,aacd,\",,,ab\"') == ['62', 'b', 'ecb', 'aacd', ',,,ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004146", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 6, 6], 5) == [6, 6, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 6], 5) == [6, 6, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004147", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['a', 'b', 'c', 'e', 'd', 'c', 'e', 'b', 'd', 'a']) == {'a': 2, 'b': 2, 'c': 2, 'e': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'b', 'c', 'e', 'd', 'c', 'e', 'b', 'd', 'a']) == {'a': 2, 'b': 2, 'c': 2, 'e': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004148", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(902) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(902) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004149", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('aa,ddcb,\",ba,\",ab,d') == ['aa', 'ddcb', ',ba,', 'ab', 'd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aa,ddcb,\",ba,\",ab,d') == ['aa', 'ddcb', ',ba,', 'ab', 'd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004150", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(60); s.push(18); s.push(32)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(60); s.push(18); s.push(32)\nassert s.peek() == 32\nassert s.pop() == 32\nassert s.pop() == 18\nassert s.is_empty() == False\nassert s.pop() == 60\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004151", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 6, 5, 8, 3, 9, 8], 3) == [[8, 6, 5], [8, 3, 9], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 6, 5, 8, 3, 9, 8], 3) == [[8, 6, 5], [8, 3, 9], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004152", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=84; user=471; port=auto; host=512') == {'path': '84', 'user': '471', 'port': 'auto', 'host': '512'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=84; user=471; port=auto; host=512') == {'path': '84', 'user': '471', 'port': 'auto', 'host': '512'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004153", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([3, 0, 2], [1, 8, 8, 1, 9]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 0, 2], [1, 8, 8, 1, 9]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004154", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(27) == [3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(27) == [3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004155", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eddedb') == 'edb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eddedb') == 'edb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004156", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(487) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(487) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004157", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'date', 'banana', 'apple', 'cherry', 'coconut']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'coconut'], 'd': ['date'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'date', 'banana', 'apple', 'cherry', 'coconut']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'coconut'], 'd': ['date'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004158", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ddabe bdddd cccca ebdabe') == 'Ddabe Bdddd Cccca Ebdabe'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ddabe bdddd cccca ebdabe') == 'Ddabe Bdddd Cccca Ebdabe'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004159", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([28, 43, 16, 25, 10, 31]) == [10, 16, 25, 28, 31, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([28, 43, 16, 25, 10, 31]) == [10, 16, 25, 28, 31, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004160", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(402622) == 634\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(402622) == 634\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004161", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(108654) == 329\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(108654) == 329\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004162", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([3, 6, 2], 2) == [6, 2, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 6, 2], 2) == [6, 2, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004163", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 2, 'z': 5, 'x': 4}, {'y': 7, 'w': 6}) == {'y': 9, 'z': 5, 'x': 4, 'w': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2, 'z': 5, 'x': 4}, {'y': 7, 'w': 6}) == {'y': 9, 'z': 5, 'x': 4, 'w': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004164", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(67) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(67) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004165", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 2, 4, 2, 5, 2, 1, 5, 4]) == [2, 4, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 4, 2, 5, 2, 1, 5, 4]) == [2, 4, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004166", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 2, 0, 7, 2, 2, 6, 8, 7], 7) == [0, 7, 2, 2, 6, 8, 7, 4, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 2, 0, 7, 2, 2, 6, 8, 7], 7) == [0, 7, 2, 2, 6, 8, 7, 4, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004167", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 84, 'a': 22}) == {84: 'b', 22: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 84, 'a': 22}) == {84: 'b', 22: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004168", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([27, 11, 42, 11, 27, 0]) == [0, 11, 11, 27, 27, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([27, 11, 42, 11, 27, 0]) == [0, 11, 11, 27, 27, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004169", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Code', 25) == 'Bncd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 25) == 'Bncd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004170", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('The ran. ran sun ran the,') == {'the': 2, 'ran': 3, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The ran. ran sun ran the,') == {'the': 2, 'ran': 3, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004171", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'cherry', 'cherry', 'apple', 'apple', 'coconut', 'coconut']) == {'c': ['coconut', 'cherry', 'cherry', 'coconut', 'coconut'], 'b': ['berry'], 'a': ['apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'cherry', 'cherry', 'apple', 'apple', 'coconut', 'coconut']) == {'c': ['coconut', 'cherry', 'cherry', 'coconut', 'coconut'], 'b': ['berry'], 'a': ['apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004172", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(14, 19) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(14, 19) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004173", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'berry', 'date', 'date', 'avocado', 'avocado', 'cherry']) == {'b': ['banana', 'berry'], 'c': ['coconut', 'cherry'], 'd': ['date', 'date'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'berry', 'date', 'date', 'avocado', 'avocado', 'cherry']) == {'b': ['banana', 'berry'], 'c': ['coconut', 'cherry'], 'd': ['date', 'date'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004174", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('amdxvbyjlccig') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('amdxvbyjlccig') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004175", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[3, 5, 6, 5], [2, 8, 7, 9], [9, 4, 5, 3]]) == [[3, 2, 9], [5, 8, 4], [6, 7, 5], [5, 9, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 5, 6, 5], [2, 8, 7, 9], [9, 4, 5, 3]]) == [[3, 2, 9], [5, 8, 4], [6, 7, 5], [5, 9, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004176", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 36, 'f': 8, 'a': 43, 'b': 42}) == {36: 'd', 8: 'f', 43: 'a', 42: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 36, 'f': 8, 'a': 43, 'b': 42}) == {36: 'd', 8: 'f', 43: 'a', 42: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004177", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h35m16s') == 20116\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h35m16s') == 20116\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004178", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(57) == 'LVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(57) == 'LVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004179", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([12, 31, 56, 60], 117) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([12, 31, 56, 60], 117) == -1\nassert binary_search([12, 31, 56, 60], 12) == 0\nassert binary_search([12, 31, 56, 60], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004180", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the cat Sun ran, sat cat cat sat') == {'the': 1, 'cat': 3, 'sun': 1, 'ran': 1, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the cat Sun ran, sat cat cat sat') == {'the': 1, 'cat': 3, 'sun': 1, 'ran': 1, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004181", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(374) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(374) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004182", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 3, 7, 2, 1, 3, 1, 0, 1, 5], 15) == [3, 1, 0, 1, 5, 4, 3, 7, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 3, 7, 2, 1, 3, 1, 0, 1, 5], 15) == [3, 1, 0, 1, 5, 4, 3, 7, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004183", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMLXX') == 2070\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMLXX') == 2070\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004184", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([20, 14, 9, 21, 13]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 14, 9, 21, 13]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004185", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([2, -17, 6, 8, -17]) == -18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, -17, 6, 8, -17]) == -18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004186", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('6m47s') == 407\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('6m47s') == 407\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004187", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCXXXIX') == 239\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXXXIX') == 239\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004188", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(335) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(335) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004189", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaccbbbbbb') == 'a2c2b6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaccbbbbbb') == 'a2c2b6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004190", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([0, 9, 2], 4) == [2, 0, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 9, 2], 4) == [2, 0, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004191", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 2, 3, 13, 14, 17], [2, 8, 13, 20]) == [0, 2, 2, 3, 8, 13, 13, 14, 17, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 2, 3, 13, 14, 17], [2, 8, 13, 20]) == [0, 2, 2, 3, 8, 13, 13, 14, 17, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004192", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[3, -9, 1], [4, -9, -3], [5, -6, 8]], [[7, 0, 7], [4, 9, 6], [2, -5, 8]]) == [[10, -9, 8], [8, 0, 3], [7, -11, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, -9, 1], [4, -9, -3], [5, -6, 8]], [[7, 0, 7], [4, 9, 6], [2, -5, 8]]) == [[10, -9, 8], [8, 0, 3], [7, -11, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004193", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fd fcbcdcb') == 'fcbcdcb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fd fcbcdcb') == 'fcbcdcb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004194", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[2, 7, 2, 3], [5, 9, 3, 1], [9, 8, 8, 4], [6, 7, 2, 2]]) == [[2, 5, 9, 6], [7, 9, 8, 7], [2, 3, 8, 2], [3, 1, 4, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 7, 2, 3], [5, 9, 3, 1], [9, 8, 8, 4], [6, 7, 2, 2]]) == [[2, 5, 9, 6], [7, 9, 8, 7], [2, 3, 8, 2], [3, 1, 4, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004195", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 4, 5, 8, 3, 6, 6], 2) == [6, 6, 4, 4, 5, 8, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 4, 5, 8, 3, 6, 6], 2) == [6, 6, 4, 4, 5, 8, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004196", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('LXVIII') == 68\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXVIII') == 68\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004197", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(1735) == 16\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1735) == 16\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004198", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(198, 122) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(198, 122) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004199", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(25, 8) == 200\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(25, 8) == 200\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004200", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('ebzb') == 'bzbe'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ebzb') == 'bzbe'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004201", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat. sun cat Cat dog sun sat sun, Sat cat') == {'sat': 3, 'sun': 3, 'cat': 3, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat. sun cat Cat dog sun sat sun, Sat cat') == {'sat': 3, 'sun': 3, 'cat': 3, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004202", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('bc cecdca de') == 'Bc Cecdca De'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bc cecdca de') == 'Bc Cecdca De'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004203", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dbeb e b abeb') == 'Dbeb E B Abeb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dbeb e b abeb') == 'Dbeb E B Abeb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004204", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens(']]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004205", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('ebaccc') == 'Ebaccc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ebaccc') == 'Ebaccc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004206", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 2, 'w': 2, 'x': 6}, {'y': 2}) == {'y': 4, 'w': 2, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2, 'w': 2, 'x': 6}, {'y': 2}) == {'y': 4, 'w': 2, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004207", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('edccb') == 'edcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edccb') == 'edcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004208", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[5, 9, 3, 2], [3], [1]]) == [5, 9, 3, 2, 3, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 9, 3, 2], [3], [1]]) == [5, 9, 3, 2, 3, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004209", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 1, 1, 0, 2, 3]) == [3, 1, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 1, 0, 2, 3]) == [3, 1, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004210", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=auto; path=624; host=43') == {'mode': 'auto', 'path': '624', 'host': '43'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=auto; path=624; host=43') == {'mode': 'auto', 'path': '624', 'host': '43'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004211", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'a': 1, 'b': 10, 'c': 4, 'd': 0}, 6) == {'b': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 1, 'b': 10, 'c': 4, 'd': 0}, 6) == {'b': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004212", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([27, 18, 9, 33, 8, 47, 43, 38, 14, 36, 19]) == [8, 9, 14, 18, 19, 27, 33, 36, 38, 43, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([27, 18, 9, 33, 8, 47, 43, 38, 14, 36, 19]) == [8, 9, 14, 18, 19, 27, 33, 36, 38, 43, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004213", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('eeaccda') == 'eacd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeaccda') == 'eacd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004214", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(4) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(4) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004215", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('93,e,92') == ['93', 'e', '92']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('93,e,92') == ['93', 'e', '92']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004216", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(24, 22) == 264\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 22) == 264\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004217", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('3') == 3\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('3') == 3\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004218", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(229) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(229) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004219", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(50, 157) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(50, 157) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004220", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCCLV') == 355\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLV') == 355\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004221", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(2107) == 45\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2107) == 45\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004222", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('b])[)))') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b])[)))') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004223", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(98) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(98) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004224", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(347) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(347) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004225", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCLII') == 252\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLII') == 252\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004226", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([13, 44, 36, 30, 36, 4, 5, 18, 39]) == [4, 5, 13, 18, 30, 36, 36, 39, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([13, 44, 36, 30, 36, 4, 5, 18, 39]) == [4, 5, 13, 18, 30, 36, 36, 39, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004227", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([0, 6, 3, 1, 9], 5) == [[0, 6, 3, 1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 6, 3, 1, 9], 5) == [[0, 6, 3, 1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004228", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 1, 1, 9, 9, 8, 8], 3) == [9, 8, 8, 4, 1, 1, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 1, 1, 9, 9, 8, 8], 3) == [9, 8, 8, 4, 1, 1, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004229", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 2, 4, 3, 3], 4) == [2, 4, 3, 3, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 2, 4, 3, 3], 4) == [2, 4, 3, 3, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004230", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 3}, {'x': 5, 'z': 5, 'w': 2}) == {'z': 8, 'x': 5, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3}, {'x': 5, 'z': 5, 'w': 2}) == {'z': 8, 'x': 5, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004231", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(337)\nacc.deposit(42)\nacc.withdraw(323)\nacc.withdraw(421)\nassert acc.get_balance() == 379\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(337)\nacc.deposit(42)\nassert acc.get_balance() == 379\nacc.withdraw(323)\nassert acc.get_balance() == 56\nacc.withdraw(421)\nassert acc.get_balance() == 56\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004232", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 1], [4, 2], [4, 1]], [[5, 1, 4], [0, 0, 3]]) == [[5, 1, 7], [20, 4, 22], [20, 4, 19]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1], [4, 2], [4, 1]], [[5, 1, 4], [0, 0, 3]]) == [[5, 1, 7], [20, 4, 22], [20, 4, 19]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004233", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 90, 'a': 9, 'f': 85, 'e': 20, 'b': 96}) == {90: 'd', 9: 'a', 85: 'f', 20: 'e', 96: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 90, 'a': 9, 'f': 85, 'e': 20, 'b': 96}) == {90: 'd', 9: 'a', 85: 'f', 20: 'e', 96: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004234", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(179) == 31\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(179) == 31\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004235", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5, 7], [3], [7], [3, 9, 7], [9, 7, 9, 0]]) == [5, 7, 3, 7, 3, 9, 7, 9, 7, 9, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 7], [3], [7], [3, 9, 7], [9, 7, 9, 0]]) == [5, 7, 3, 7, 3, 9, 7, 9, 7, 9, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004236", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(5 - 4 * 17)') == -63\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(5 - 4 * 17)') == -63\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004237", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([4, 23, 2, 24, 0, 24]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 23, 2, 24, 0, 24]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004238", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(29); s.push(88); s.push(71)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(29); s.push(88); s.push(71)\nassert s.peek() == 71\nassert s.pop() == 71\nassert s.pop() == 88\nassert s.is_empty() == False\nassert s.pop() == 29\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004239", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the the the! dog Cat dog cat sat') == {'the': 3, 'dog': 2, 'cat': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the the! dog Cat dog cat sat') == {'the': 3, 'dog': 2, 'cat': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004240", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaaaaa') == 'a11'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaaa') == 'a11'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004241", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(43, 9) == 387\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(43, 9) == 387\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004242", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CLX') == 160\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLX') == 160\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004243", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([50, -29, -24, 46, -38, 46]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, -29, -24, 46, -38, 46]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004244", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([10, 26, 19, 19, 27, 10]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 26, 19, 19, 27, 10]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004245", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('aacaba', 'aacabab') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aacaba', 'aacabab') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004246", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('eb g') == 'eb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('eb g') == 'eb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004247", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'coconut', 'cherry', 'berry']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'coconut', 'cherry', 'berry']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004248", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(69); s.push(3); s.push(89)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(69); s.push(3); s.push(89)\nassert s.peek() == 89\nassert s.pop() == 89\nassert s.pop() == 3\nassert s.is_empty() == False\nassert s.pop() == 69\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004249", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 25, 'b': 87, 'f': 48, 'e': 62}) == {25: 'a', 87: 'b', 48: 'f', 62: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 25, 'b': 87, 'f': 48, 'e': 62}) == {25: 'a', 87: 'b', 48: 'f', 62: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004250", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 3, 6, 3, 0], [5, 6, 2, 9, 7]) == [7, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 3, 6, 3, 0], [5, 6, 2, 9, 7]) == [7, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004251", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 15, 'c': 12, 'd': 17}) == {15: 'a', 12: 'c', 17: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 15, 'c': 12, 'd': 17}) == {15: 'a', 12: 'c', 17: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004252", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([27, 23, 33, 4]) == [4, 23, 27, 33]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([27, 23, 33, 4]) == [4, 23, 27, 33]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004253", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([0, [7, 9], [8]]) == 24\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, [7, 9], [8]]) == 24\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004254", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[4, 1, 1], [3, 0, 5]], [[0, 1], [2, 1], [5, 5]]) == [[7, 10], [25, 28]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 1, 1], [3, 0, 5]], [[0, 1], [2, 1], [5, 5]]) == [[7, 10], [25, 28]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004255", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abbbaaaaaba', 'aa') == 4\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbaaaaaba', 'aa') == 4\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004256", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[5], [2, 6, 9]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5], [2, 6, 9]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004257", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=auto; path=auto; user=985') == {'port': 'auto', 'path': 'auto', 'user': '985'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; path=auto; user=985') == {'port': 'auto', 'path': 'auto', 'user': '985'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004258", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([0, 4, 7, 9, 7, 3, 5, 6, 6, 8, 1, 0], 2) == [[0, 4], [7, 9], [7, 3], [5, 6], [6, 8], [1, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 4, 7, 9, 7, 3, 5, 6, 6, 8, 1, 0], 2) == [[0, 4], [7, 9], [7, 3], [5, 6], [6, 8], [1, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004259", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 9, 'w': 4}, {'x': 5}) == {'y': 9, 'w': 4, 'x': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9, 'w': 4}, {'x': 5}) == {'y': 9, 'w': 4, 'x': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004260", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'berry']) == {'a': ['avocado'], 'c': ['cherry'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'berry']) == {'a': ['avocado'], 'c': ['cherry'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004261", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('20') == 20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20') == 20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004262", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([17, 18, 4]) == 39\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([17, 18, 4]) == 39\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004263", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([30, 18, 17, 12]) == [12, 17, 18, 30]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 18, 17, 12]) == [12, 17, 18, 30]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004264", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(97)\nacc.deposit(216)\nacc.withdraw(224)\nacc.withdraw(327)\nassert acc.get_balance() == 313\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(97)\nacc.deposit(216)\nassert acc.get_balance() == 313\nacc.withdraw(224)\nassert acc.get_balance() == 89\nacc.withdraw(327)\nassert acc.get_balance() == 89\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004265", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'a', 'a', 'e', 'b', 'd', 'e', 'c', 'e', 'c']) == {'c': 3, 'a': 2, 'e': 3, 'b': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'a', 'e', 'b', 'd', 'e', 'c', 'e', 'c']) == {'c': 3, 'a': 2, 'e': 3, 'b': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004266", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CCLXXX') == 280\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXX') == 280\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004267", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([15, 44, 10, 42, 29]) == [10, 15, 29, 42, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([15, 44, 10, 42, 29]) == [10, 15, 29, 42, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004268", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(74) == 'LXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(74) == 'LXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004269", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1974) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1974) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004270", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([24, 37, 24, 29]) == [24, 24, 29, 37]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([24, 37, 24, 29]) == [24, 24, 29, 37]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004271", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(319) == 'CCCXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(319) == 'CCCXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004272", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('babbaaaaaabbaabb', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbaaaaaabbaabb', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004273", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-14, -15, -12, -3]) == -44\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, -15, -12, -3]) == -44\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004274", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 9, 1, 7, 0, 9], [2, 0, 7, 9, 8, 5, 6, 1]) == [0, 9, 1, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 9, 1, 7, 0, 9], [2, 0, 7, 9, 8, 5, 6, 1]) == [0, 9, 1, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004275", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([29, 26, 12, 16, 7, 25]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 26, 12, 16, 7, 25]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004276", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(445)\nacc.deposit(270)\nacc.withdraw(521)\nacc.withdraw(828)\nassert acc.get_balance() == 715\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(445)\nacc.deposit(270)\nassert acc.get_balance() == 715\nacc.withdraw(521)\nassert acc.get_balance() == 194\nacc.withdraw(828)\nassert acc.get_balance() == 194\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004277", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([8, 13, 10, 8, 8, 0, 10, 21]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 13, 10, 8, 8, 0, 10, 21]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004278", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([3, 8, 5, 2], [4, 9, 4, 2, 0, 2, 0, 5]) == [5, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 8, 5, 2], [4, 9, 4, 2, 0, 2, 0, 5]) == [5, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004279", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[1, 1, 9], [0, 9, 6]]) == [1, 1, 9, 0, 9, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1, 1, 9], [0, 9, 6]]) == [1, 1, 9, 0, 9, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004280", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(6, 55) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(6, 55) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004281", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(13, 23) == 299\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 23) == 299\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004282", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('abc', 11) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 11) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004283", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 3, 3, 17], [19]) == [1, 3, 3, 17, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 3, 3, 17], [19]) == [1, 3, 3, 17, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004284", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(337)\nacc.deposit(180)\nacc.withdraw(500)\nacc.withdraw(657)\nassert acc.get_balance() == 517\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(337)\nacc.deposit(180)\nassert acc.get_balance() == 517\nacc.withdraw(500)\nassert acc.get_balance() == 17\nacc.withdraw(657)\nassert acc.get_balance() == 17\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004285", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('xyz', 11) == 'ijk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 11) == 'ijk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004286", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(81) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(81) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004287", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 4, 2, 0, 0]) == [3, 4, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 2, 0, 0]) == [3, 4, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004288", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([34, 50, 29, 11]) == [11, 29, 34, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([34, 50, 29, 11]) == [11, 29, 34, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004289", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 45, 'a': 73, 'f': 29, 'c': 82, 'e': 36}) == {45: 'b', 73: 'a', 29: 'f', 82: 'c', 36: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 45, 'a': 73, 'f': 29, 'c': 82, 'e': 36}) == {45: 'b', 73: 'a', 29: 'f', 82: 'c', 36: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004290", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(15); s.push(22); s.push(10)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(15); s.push(22); s.push(10)\nassert s.peek() == 10\nassert s.pop() == 10\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 15\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004291", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXLIV') == 444\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXLIV') == 444\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004292", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[]{[]}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{[]}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004293", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 8, 3, 5], [5, 4, 0, 7, 9]) == [5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 8, 3, 5], [5, 4, 0, 7, 9]) == [5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004294", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(58); s.push(77); s.push(86)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(58); s.push(77); s.push(86)\nassert s.peek() == 86\nassert s.pop() == 86\nassert s.pop() == 77\nassert s.is_empty() == False\nassert s.pop() == 58\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004295", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(328) == 'CCCXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(328) == 'CCCXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004296", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 2, 2, 9, 6, 3, 3, 5], 6) == [2, 9, 6, 3, 3, 5, 9, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 2, 2, 9, 6, 3, 3, 5], 6) == [2, 9, 6, 3, 3, 5, 9, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004297", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=719; mode=on; user=438') == {'host': '719', 'mode': 'on', 'user': '438'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=719; mode=on; user=438') == {'host': '719', 'mode': 'on', 'user': '438'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004298", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([13, 46, 29, 17, 12, 5, 3, 43, 50, 10, 46, 47, 42]) == [3, 5, 10, 12, 13, 17, 29, 42, 43, 46, 46, 47, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([13, 46, 29, 17, 12, 5, 3, 43, 50, 10, 46, 47, 42]) == [3, 5, 10, 12, 13, 17, 29, 42, 43, 46, 46, 47, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004299", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([17, -42, -32]) == 17\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([17, -42, -32]) == 17\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004300", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[8, 2, 7], 5, [1]]) == [8, 2, 7, 5, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8, 2, 7], 5, [1]]) == [8, 2, 7, 5, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004301", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([8, 5, 0, 7, 2, 9], [8, 1, 2, 0, 0]) == [8, 0, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 5, 0, 7, 2, 9], [8, 1, 2, 0, 0]) == [8, 0, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004302", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(4, 9) == 262144\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 9) == 262144\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004303", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(60, 17) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(60, 17) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004304", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('cabcbabacbcac', 'abaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cabcbabacbcac', 'abaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004305", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([20, 0, 11, 25, 11, 20]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 0, 11, 25, 11, 20]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004306", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([7, 0, 8, 1, 6, 0, 2, 3], 7) == [0, 8, 1, 6, 0, 2, 3, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 0, 8, 1, 6, 0, 2, 3], 7) == [0, 8, 1, 6, 0, 2, 3, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004307", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-20, -46, -43, 43, -24, -20, -13]) == 43\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-20, -46, -43, 43, -24, -20, -13]) == 43\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004308", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('Cat Cat Cat ran ran cat') == {'cat': 4, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat Cat Cat ran ran cat') == {'cat': 4, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004309", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=388; port=935') == {'host': '388', 'port': '935'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=388; port=935') == {'host': '388', 'port': '935'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004310", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([15, -1, 7, -3]) == 18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([15, -1, 7, -3]) == 18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004311", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bbcbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbcbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004312", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([36, 41, 10, 29, 34]) == [10, 29, 34, 36, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 41, 10, 29, 34]) == [10, 29, 34, 36, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004313", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('cccbbaaacccc') == 'c3b2a3c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccbbaaacccc') == 'c3b2a3c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004314", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(388) == [2, 2, 97]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(388) == [2, 2, 97]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004315", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([5, 36, 36, 48, 22, 4, 1]) == [1, 4, 5, 22, 36, 36, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([5, 36, 36, 48, 22, 4, 1]) == [1, 4, 5, 22, 36, 36, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004316", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(7193) == 84\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7193) == 84\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004317", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(267) == 'CCLXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(267) == 'CCLXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004318", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbbab', 'bbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbab', 'bbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004319", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(132) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(132) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004320", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('cbeace') == 'Cbeace'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cbeace') == 'Cbeace'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004321", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([50, 26, 24, 28, 40, 44]) == [24, 26, 28, 40, 44, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([50, 26, 24, 28, 40, 44]) == [24, 26, 28, 40, 44, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004322", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([1, 17, 24, 6]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 17, 24, 6]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004323", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([5, 8, 11, 49, 57, 87, 92], 164) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 8, 11, 49, 57, 87, 92], 164) == -1\nassert binary_search([5, 8, 11, 49, 57, 87, 92], 5) == 0\nassert binary_search([5, 8, 11, 49, 57, 87, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004324", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(337) == [337]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(337) == [337]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004325", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('cfacc') == 'ccafc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cfacc') == 'ccafc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004326", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([36, 46, 12, 33, 1]) == [1, 12, 33, 36, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 46, 12, 33, 1]) == [1, 12, 33, 36, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004327", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([24, 7, 7, 8, 0, 0]) == 8\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([24, 7, 7, 8, 0, 0]) == 8\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004328", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 5, 4, 3, 0, 1, 4, 0, 5]) == [5, 4, 3, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 4, 3, 0, 1, 4, 0, 5]) == [5, 4, 3, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004329", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([3, 2, 8]) == [3, 5, 13]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 2, 8]) == [3, 5, 13]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004330", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([22, 27, 15, 22, 12, 22]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 27, 15, 22, 12, 22]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004331", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 0, 4, 3, 0]) == [4, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 0, 4, 3, 0]) == [4, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004332", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([19, 14, -6, -13, -9]) == 5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([19, 14, -6, -13, -9]) == 5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004333", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(89) == 'LXXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(89) == 'LXXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004334", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(88350) == 297\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(88350) == 297\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004335", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('cbbbbbbbbb') == 'c1b9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cbbbbbbbbb') == 'c1b9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004336", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h26m32s') == 12392\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h26m32s') == 12392\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004337", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['d', 'c', 'b', 'c', 'd', 'e', 'c', 'd']) == {'d': 3, 'c': 3, 'b': 1, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'c', 'b', 'c', 'd', 'e', 'c', 'd']) == {'d': 3, 'c': 3, 'b': 1, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004338", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 5, 5], [3, 4, 4], [2, 5, 5]], [[4, 3], [1, 5], [1, 5]]) == [[26, 62], [20, 49], [18, 56]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 5, 5], [3, 4, 4], [2, 5, 5]], [[4, 3], [1, 5], [1, 5]]) == [[26, 62], [20, 49], [18, 56]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004339", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{}{}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}{}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004340", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['acyx', 'acyy']) == 'acy'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acyx', 'acyy']) == 'acy'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004341", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(61) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(61) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004342", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(77); s.push(36); s.push(7)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(77); s.push(36); s.push(7)\nassert s.peek() == 7\nassert s.pop() == 7\nassert s.pop() == 36\nassert s.is_empty() == False\nassert s.pop() == 77\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004343", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('13 + 16 - 15 - 13') == 1\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13 + 16 - 15 - 13') == 1\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004344", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('2h46m43s') == 10003\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h46m43s') == 10003\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004345", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(72); s.push(20); s.push(93)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(72); s.push(20); s.push(93)\nassert s.peek() == 93\nassert s.pop() == 93\nassert s.pop() == 20\nassert s.is_empty() == False\nassert s.pop() == 72\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004346", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(4523) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4523) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004347", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([2, 5, 11, 18, 18], [1, 3, 3, 3, 17]) == [1, 2, 3, 3, 3, 5, 11, 17, 18, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 5, 11, 18, 18], [1, 3, 3, 3, 17]) == [1, 2, 3, 3, 3, 5, 11, 17, 18, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004348", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(284) == 104\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(284) == 104\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004349", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 3, 2, 4, 1, 4, 4, 3]) == [4, 3, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 3, 2, 4, 1, 4, 4, 3]) == [4, 3, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004350", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('axfxece') == 'ecexfxa'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('axfxece') == 'ecexfxa'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004351", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([8, 9, 10, 16], [1, 4, 12, 17, 19, 20]) == [1, 4, 8, 9, 10, 12, 16, 17, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([8, 9, 10, 16], [1, 4, 12, 17, 19, 20]) == [1, 4, 8, 9, 10, 12, 16, 17, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004352", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 25) == 'wxy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 25) == 'wxy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004353", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-8, 0], [0, 9], [2, 1]], [[-8, 3], [8, 1], [9, -3]]) == [[-16, 3], [8, 10], [11, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 0], [0, 9], [2, 1]], [[-8, 3], [8, 1], [9, -3]]) == [[-16, 3], [8, 10], [11, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004354", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(485)\nacc.deposit(224)\nacc.withdraw(109)\nacc.withdraw(866)\nassert acc.get_balance() == 709\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(485)\nacc.deposit(224)\nassert acc.get_balance() == 709\nacc.withdraw(109)\nassert acc.get_balance() == 600\nacc.withdraw(866)\nassert acc.get_balance() == 600\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004355", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 0, 4, 9], [6, 6, 7, 0, 9, 8]) == [6, 0, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 0, 4, 9], [6, 6, 7, 0, 9, 8]) == [6, 0, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004356", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(19, 48) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 48) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004357", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 97, 'd': 10}) == {97: 'a', 10: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 97, 'd': 10}) == {97: 'a', 10: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004358", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([7, 2, [1], [1], [5]]) == [7, 2, 1, 1, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([7, 2, [1], [1], [5]]) == [7, 2, 1, 1, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004359", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sat! dog the ran sat.') == {'sat': 2, 'dog': 1, 'the': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat! dog the ran sat.') == {'sat': 2, 'dog': 1, 'the': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004360", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([15, 36, 34, 26, 12, 42, 15, 2, 24]) == [2, 12, 15, 15, 24, 26, 34, 36, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([15, 36, 34, 26, 12, 42, 15, 2, 24]) == [2, 12, 15, 15, 24, 26, 34, 36, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004361", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(23, 24) == 552\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 24) == 552\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004362", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'e', 'e', 'a']) == {'e': 3, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'e', 'a']) == {'e': 3, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004363", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([3, 42, 2, 19, 43, 44, 5, 21, 8, 3, 44, 1]) == [1, 2, 3, 3, 5, 8, 19, 21, 42, 43, 44, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([3, 42, 2, 19, 43, 44, 5, 21, 8, 3, 44, 1]) == [1, 2, 3, 3, 5, 8, 19, 21, 42, 43, 44, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004364", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([2, 22, 56, 87, 98], 103) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 22, 56, 87, 98], 103) == -1\nassert binary_search([2, 22, 56, 87, 98], 2) == 0\nassert binary_search([2, 22, 56, 87, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004365", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(18, 3, 655) == 592\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 3, 655) == 592\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004366", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 43, 'd': 85, 'b': 1, 'a': 54, 'c': 67}) == {43: 'e', 85: 'd', 1: 'b', 54: 'a', 67: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 43, 'd': 85, 'b': 1, 'a': 54, 'c': 67}) == {43: 'e', 85: 'd', 1: 'b', 54: 'a', 67: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004367", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(67) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(67) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004368", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(42, 59) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(42, 59) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004369", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[5, 6, -1, -5], [-8, 4, 3, 6], [4, 1, -5, 7]], [[-6, -2, 2, 4], [0, -1, 6, 4], [-9, 1, 8, 6]]) == [[-1, 4, 1, -1], [-8, 3, 9, 10], [-5, 2, 3, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 6, -1, -5], [-8, 4, 3, 6], [4, 1, -5, 7]], [[-6, -2, 2, 4], [0, -1, 6, 4], [-9, 1, 8, 6]]) == [[-1, 4, 1, -1], [-8, 3, 9, 10], [-5, 2, 3, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004370", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'berry']) == {'c': ['cherry'], 'b': ['berry', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'berry']) == {'c': ['cherry'], 'b': ['berry', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004371", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([2, 2, 4, 5, 6, 12, 14], [7, 7, 8, 9, 10, 14, 15]) == [2, 2, 4, 5, 6, 7, 7, 8, 9, 10, 12, 14, 14, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 2, 4, 5, 6, 12, 14], [7, 7, 8, 9, 10, 14, 15]) == [2, 2, 4, 5, 6, 7, 7, 8, 9, 10, 12, 14, 14, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004372", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('baaacc') == 'Baaacc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('baaacc') == 'Baaacc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004373", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-1, -1, -1], [7, -4, 8]], [[5, -3, 4], [1, -1, 7]]) == [[4, -4, 3], [8, -5, 15]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -1, -1], [7, -4, 8]], [[5, -3, 4], [1, -1, 7]]) == [[4, -4, 3], [8, -5, 15]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004374", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"ab,\",aa,c') == ['ab,', 'aa', 'c']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"ab,\",aa,c') == ['ab,', 'aa', 'c']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004375", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([6, -19, -3, -19, 20]) == -15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([6, -19, -3, -19, 20]) == -15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004376", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([2, 0, 7, 4, 2, 2, 7], [7, 8, 9, 1, 8, 0]) == [0, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 0, 7, 4, 2, 2, 7], [7, 8, 9, 1, 8, 0]) == [0, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004377", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-13, -8, 19, 15, -8, -6]) == -1\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-13, -8, 19, 15, -8, -6]) == -1\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004378", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h39m33s') == 20373\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h39m33s') == 20373\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004379", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(28, 142, 513) == 460\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(28, 142, 513) == 460\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004380", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(780) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(780) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004381", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([34, 48, 67, 89, 96], 67) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([34, 48, 67, 89, 96], 67) == 2\nassert binary_search([34, 48, 67, 89, 96], 34) == 0\nassert binary_search([34, 48, 67, 89, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004382", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 6, 5], 3) == [1, 6, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 5], 3) == [1, 6, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004383", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(7119) == 84\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7119) == 84\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004384", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'y': 7, 'x': 3, 'w': 1}) == {'z': 8, 'y': 7, 'x': 3, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'y': 7, 'x': 3, 'w': 1}) == {'z': 8, 'y': 7, 'x': 3, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004385", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbbbbbb', 'aba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbbb', 'aba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004386", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('15') == 15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('15') == 15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004387", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(302)\nacc.deposit(240)\nacc.withdraw(458)\nacc.withdraw(589)\nassert acc.get_balance() == 542\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(302)\nacc.deposit(240)\nassert acc.get_balance() == 542\nacc.withdraw(458)\nassert acc.get_balance() == 84\nacc.withdraw(589)\nassert acc.get_balance() == 84\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004388", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 2, 3, 2, 4, 3, 2]) == [1, 2, 3, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 3, 2, 4, 3, 2]) == [1, 2, 3, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004389", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 6, 8, 0, 9, 7], 1) == [7, 2, 6, 8, 0, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 6, 8, 0, 9, 7], 1) == [7, 2, 6, 8, 0, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004390", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('abc', 15) == 'pqr'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 15) == 'pqr'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004391", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(1, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004392", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{}()()()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}()()()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004393", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('()((()))') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()((()))') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004394", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['banana', 'date', 'banana', 'apple', 'cherry']) == {'b': ['banana', 'banana'], 'd': ['date'], 'a': ['apple'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'date', 'banana', 'apple', 'cherry']) == {'b': ['banana', 'banana'], 'd': ['date'], 'a': ['apple'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004395", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'c': 1, 'e': 5, 'd': 10, 'b': 9}, 6) == {'d': 10, 'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 1, 'e': 5, 'd': 10, 'b': 9}, 6) == {'d': 10, 'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004396", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 23, 'e': 66, 'a': 1, 'c': 84}) == {23: 'd', 66: 'e', 1: 'a', 84: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 23, 'e': 66, 'a': 1, 'c': 84}) == {23: 'd', 66: 'e', 1: 'a', 84: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004397", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(3285) == 'MMMCCLXXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3285) == 'MMMCCLXXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004398", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(24, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(24, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004399", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[2, 8, 1, 8], [0, 5, 9], 2, [9, 2], [2, 3]]) == [2, 8, 1, 8, 0, 5, 9, 2, 9, 2, 2, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 8, 1, 8], [0, 5, 9], 2, [9, 2], [2, 3]]) == [2, 8, 1, 8, 0, 5, 9, 2, 9, 2, 2, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004400", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('c cdee aed') == 'C Cdee Aed'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('c cdee aed') == 'C Cdee Aed'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004401", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(51); s.push(70); s.push(47)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(51); s.push(70); s.push(47)\nassert s.peek() == 47\nassert s.pop() == 47\nassert s.pop() == 70\nassert s.is_empty() == False\nassert s.pop() == 51\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004402", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(307) == 37\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(307) == 37\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004403", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(74); s.push(94); s.push(81)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(74); s.push(94); s.push(81)\nassert s.peek() == 81\nassert s.pop() == 81\nassert s.pop() == 94\nassert s.is_empty() == False\nassert s.pop() == 74\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004404", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[2], [0, 7, [3, 9, 8]]]) == [2, 0, 7, 3, 9, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2], [0, 7, [3, 9, 8]]]) == [2, 0, 7, 3, 9, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004405", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(6599) == 9956\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6599) == 9956\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004406", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dcea') == 'dcea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcea') == 'dcea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004407", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(373) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(373) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004408", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[3, 0, 1], [3, 0, 3]], [[4, 4], [4, 0], [5, 3]]) == [[17, 15], [27, 21]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 0, 1], [3, 0, 3]], [[4, 4], [4, 0], [5, 3]]) == [[17, 15], [27, 21]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004409", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello Python', 10) == 'Rovvy Zidryx'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Python', 10) == 'Rovvy Zidryx'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004410", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(487) == 141\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(487) == 141\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004411", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'a': 4, 'd': 6, 'e': 10}, 4) == {'d': 6, 'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 4, 'd': 6, 'e': 10}, 4) == {'d': 6, 'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004412", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(190) == [2, 5, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(190) == [2, 5, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004413", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(2 * 1 * 18)') == 36\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(2 * 1 * 18)') == 36\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004414", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCXL') == 240\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXL') == 240\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004415", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(832) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(832) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004416", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([12, 16, 18, 31, 22, 25, 29, 34, 7, 5, 18, 38]) == [5, 7, 12, 16, 18, 18, 22, 25, 29, 31, 34, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([12, 16, 18, 31, 22, 25, 29, 34, 7, 5, 18, 38]) == [5, 7, 12, 16, 18, 18, 22, 25, 29, 31, 34, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004417", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CLXI') == 161\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLXI') == 161\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004418", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([36, 38, 14, 39, 7, 13, 45, 20, 35, 30, 24, 1]) == [1, 7, 13, 14, 20, 24, 30, 35, 36, 38, 39, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([36, 38, 14, 39, 7, 13, 45, 20, 35, 30, 24, 1]) == [1, 7, 13, 14, 20, 24, 30, 35, 36, 38, 39, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004419", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, -3, -2, 5], [0, -8, -7, 9], [-2, 8, -1, 8], [9, 8, 5, 1]], [[-7, -6, 3, 3], [4, -9, -6, -5], [-8, 6, 9, -3], [0, -2, -9, -4]]) == [[1, -9, 1, 8], [4, -17, -13, 4], [-10, 14, 8, 5], [9, 6, -4, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -3, -2, 5], [0, -8, -7, 9], [-2, 8, -1, 8], [9, 8, 5, 1]], [[-7, -6, 3, 3], [4, -9, -6, -5], [-8, 6, 9, -3], [0, -2, -9, -4]]) == [[1, -9, 1, 8], [4, -17, -13, 4], [-10, 14, 8, 5], [9, 6, -4, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004420", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([4, -1, 8, 1]) == [4, 3, 11, 12]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([4, -1, 8, 1]) == [4, 3, 11, 12]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004421", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('gdg g ecce') == 'ecce'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gdg g ecce') == 'ecce'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004422", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 60, 'a': 4, 'e': 13, 'c': 48}) == {60: 'f', 4: 'a', 13: 'e', 48: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 60, 'a': 4, 'e': 13, 'c': 48}) == {60: 'f', 4: 'a', 13: 'e', 48: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004423", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 5, 3, 4, 2]) == [5, 3, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 3, 4, 2]) == [5, 3, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004424", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 7, 'b': 0, 'e': 10, 'd': 8}, 3) == {'c': 7, 'e': 10, 'd': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 7, 'b': 0, 'e': 10, 'd': 8}, 3) == {'c': 7, 'e': 10, 'd': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004425", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[[9, 5, 5]], [2, [1, 8]], [[7], [3, 2, 1]]]) == [9, 5, 5, 2, 1, 8, 7, 3, 2, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[9, 5, 5]], [2, [1, 8]], [[7], [3, 2, 1]]]) == [9, 5, 5, 2, 1, 8, 7, 3, 2, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004426", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran the Sun the the cat Sat') == {'ran': 1, 'the': 3, 'sun': 1, 'cat': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran the Sun the the cat Sat') == {'ran': 1, 'the': 3, 'sun': 1, 'cat': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004427", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('bbbbcccc') == 'b4c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbcccc') == 'b4c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004428", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 1, 5], [5, 2, 1]], [[4, 1, 4], [5, 1, 5], [1, 5, 0]]) == [[14, 27, 9], [31, 12, 30]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 5], [5, 2, 1]], [[4, 1, 4], [5, 1, 5], [1, 5, 0]]) == [[14, 27, 9], [31, 12, 30]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004429", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(381) == [3, 127]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(381) == [3, 127]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004430", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'coconut', 'cherry']) == {'b': ['berry'], 'c': ['coconut', 'coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'coconut', 'cherry']) == {'b': ['berry'], 'c': ['coconut', 'coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004431", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([2, 3], [3, 11, 12, 16, 17, 20]) == [2, 3, 3, 11, 12, 16, 17, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 3], [3, 11, 12, 16, 17, 20]) == [2, 3, 3, 11, 12, 16, 17, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004432", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[6, -6], [7, -9]], [[-7, -6], [1, -7]]) == [[-1, -12], [8, -16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -6], [7, -9]], [[-7, -6], [1, -7]]) == [[-1, -12], [8, -16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004433", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('debcaeab') == 'debca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('debcaeab') == 'debca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004434", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-6, -2, -9, -3, 0]) == [-6, -8, -17, -20, -20]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-6, -2, -9, -3, 0]) == [-6, -8, -17, -20, -20]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004435", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-2, -1], [8, -3], [7, 8]], [[-1, -2], [-6, -5], [1, -9]]) == [[-3, -3], [2, -8], [8, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, -1], [8, -3], [7, 8]], [[-1, -2], [-6, -5], [1, -9]]) == [[-3, -3], [2, -8], [8, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004436", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([29, 0, 10, 27, 28, 28, 11, 10, 6]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 0, 10, 27, 28, 28, 11, 10, 6]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004437", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(51); s.push(69); s.push(67)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(51); s.push(69); s.push(67)\nassert s.peek() == 67\nassert s.pop() == 67\nassert s.pop() == 69\nassert s.is_empty() == False\nassert s.pop() == 51\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004438", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[5, 0, 1], 2, [9, 4]]) == 21\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5, 0, 1], 2, [9, 4]]) == 21\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004439", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(14); s.push(76); s.push(13)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(14); s.push(76); s.push(13)\nassert s.peek() == 13\nassert s.pop() == 13\nassert s.pop() == 76\nassert s.is_empty() == False\nassert s.pop() == 14\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004440", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(28); s.push(29); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(28); s.push(29); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 29\nassert s.is_empty() == False\nassert s.pop() == 28\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004441", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(474) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(474) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004442", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('dddcccc') == 'd3c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddcccc') == 'd3c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004443", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'x': 4, 'w': 6}, {'w': 7, 'y': 7}) == {'y': 13, 'x': 4, 'w': 13}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'x': 4, 'w': 6}, {'w': 7, 'y': 7}) == {'y': 13, 'x': 4, 'w': 13}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004444", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 2, 1, 0]) == [5, 2, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 1, 0]) == [5, 2, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004445", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([49, 5, 43, 34]) == [5, 34, 43, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([49, 5, 43, 34]) == [5, 34, 43, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004446", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 3, 5, 0, 0, 4, 2, 3, 4, 5]) == [2, 3, 5, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 5, 0, 0, 4, 2, 3, 4, 5]) == [2, 3, 5, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004447", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baabaabaaabbaa', 'aa') == 5\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabaabaaabbaa', 'aa') == 5\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004448", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([14, 46, 29, 33, 31, 20, 18, 21]) == [14, 18, 20, 21, 29, 31, 33, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([14, 46, 29, 33, 31, 20, 18, 21]) == [14, 18, 20, 21, 29, 31, 33, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004449", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([15, 24, 29, 28, 8]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 24, 29, 28, 8]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004450", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[5, 7], [0, 8, 0, 8], 0, 1, [6, 3, 6]]) == [5, 7, 0, 8, 0, 8, 0, 1, 6, 3, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 7], [0, 8, 0, 8], 0, 1, [6, 3, 6]]) == [5, 7, 0, 8, 0, 8, 0, 1, 6, 3, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004451", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([1, 3, 12, 24, 24, 12, 1]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 3, 12, 24, 24, 12, 1]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004452", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([1, 3, 4, 1, 9, 4], 5) == [[1, 3, 4, 1, 9], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 4, 1, 9, 4], 5) == [[1, 3, 4, 1, 9], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004453", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=783; path=926; mode=699; port=387') == {'user': '783', 'path': '926', 'mode': '699', 'port': '387'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=783; path=926; mode=699; port=387') == {'user': '783', 'path': '926', 'mode': '699', 'port': '387'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004454", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMMDCXXXV') == 3635\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCXXXV') == 3635\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004455", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(367)\nacc.deposit(33)\nacc.withdraw(334)\nacc.withdraw(406)\nassert acc.get_balance() == 400\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(367)\nacc.deposit(33)\nassert acc.get_balance() == 400\nacc.withdraw(334)\nassert acc.get_balance() == 66\nacc.withdraw(406)\nassert acc.get_balance() == 66\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004456", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('acfaedf', 'acfaedfe') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acfaedf', 'acfaedfe') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004457", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([2, 5, 2, 3, 3, 6, 0], 2) == [6, 0, 2, 5, 2, 3, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 5, 2, 3, 3, 6, 0], 2) == [6, 0, 2, 5, 2, 3, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004458", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(238) == 'CCXXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(238) == 'CCXXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004459", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMCCXVII') == 2217\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCCXVII') == 2217\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004460", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(13, 2) == 26\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 2) == 26\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004461", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(38) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(38) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004462", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('ran Sat the sun dog') == {'ran': 1, 'sat': 1, 'the': 1, 'sun': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran Sat the sun dog') == {'ran': 1, 'sat': 1, 'the': 1, 'sun': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004463", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('zyaabaaczy') == 'yzcaabaayz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zyaabaaczy') == 'yzcaabaayz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004464", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([5, 15]) == 20\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([5, 15]) == 20\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004465", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(134, 165) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(134, 165) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004466", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('3h55m34s') == 14134\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h55m34s') == 14134\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004467", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[][][]()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][][]()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004468", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'a': 0, 'd': 3}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 0, 'd': 3}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004469", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 0, 'e': 6, 'a': 8, 'b': 6}, 5) == {'e': 6, 'a': 8, 'b': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 0, 'e': 6, 'a': 8, 'b': 6}, 5) == {'e': 6, 'a': 8, 'b': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004470", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[3], [5, 2]]) == 10\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[3], [5, 2]]) == 10\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004471", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'date', 'berry', 'coconut', 'cherry', 'cherry']) == {'c': ['coconut', 'cherry', 'coconut', 'cherry', 'cherry'], 'd': ['date'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'date', 'berry', 'coconut', 'cherry', 'cherry']) == {'c': ['coconut', 'cherry', 'coconut', 'cherry', 'cherry'], 'd': ['date'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004472", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[9, -2, 0], [-4, 6, -6], [-6, -5, 7]], [[-5, -3, 0], [0, 3, -5], [1, -9, 3]]) == [[4, -5, 0], [-4, 9, -11], [-5, -14, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, -2, 0], [-4, 6, -6], [-6, -5, 7]], [[-5, -3, 0], [0, 3, -5], [1, -9, 3]]) == [[4, -5, 0], [-4, 9, -11], [-5, -14, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004473", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 6, 5, 1, 5, 1], 2) == [[8, 6], [5, 1], [5, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 6, 5, 1, 5, 1], 2) == [[8, 6], [5, 1], [5, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004474", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([24, 13, 42, 14, 3, 35, 2]) == [2, 3, 13, 14, 24, 35, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([24, 13, 42, 14, 3, 35, 2]) == [2, 3, 13, 14, 24, 35, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004475", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(135) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(135) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004476", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(70) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(70) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004477", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=off; mode=950; user=807; port=on') == {'path': 'off', 'mode': '950', 'user': '807', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; mode=950; user=807; port=on') == {'path': 'off', 'mode': '950', 'user': '807', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004478", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 7, 'y': 7, 'x': 3}, {'y': 4, 'w': 3}) == {'z': 7, 'y': 11, 'x': 3, 'w': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7, 'y': 7, 'x': 3}, {'y': 4, 'w': 3}) == {'z': 7, 'y': 11, 'x': 3, 'w': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004479", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(14, 25) == 350\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 25) == 350\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004480", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([2, -14]) == -12\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, -14]) == -12\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004481", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(61); s.push(24); s.push(15)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(61); s.push(24); s.push(15)\nassert s.peek() == 15\nassert s.pop() == 15\nassert s.pop() == 24\nassert s.is_empty() == False\nassert s.pop() == 61\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004482", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-15, 17, -5, -10, -6, 41, 41, -33]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-15, 17, -5, -10, -6, 41, 41, -33]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004483", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 4, 0, 2]) == [2, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 0, 2]) == [2, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004484", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('13') == 13\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13') == 13\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004485", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-4, -5], [-2, 3], [-4, 7], [5, 7]], [[-8, 8], [-2, 5], [-1, 8], [-5, 2]]) == [[-12, 3], [-4, 8], [-5, 15], [0, 9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -5], [-2, 3], [-4, 7], [5, 7]], [[-8, 8], [-2, 5], [-1, 8], [-5, 2]]) == [[-12, 3], [-4, 8], [-5, 15], [0, 9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004486", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('caacacbbbab', 'ba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caacacbbbab', 'ba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004487", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['d', 'd', 'a', 'a', 'a', 'e', 'd']) == {'d': 3, 'a': 3, 'e': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'a', 'a', 'a', 'e', 'd']) == {'d': 3, 'a': 3, 'e': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004488", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('zefzdfb') == 'bfdzfez'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zefzdfb') == 'bfdzfez'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004489", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(56); s.push(2); s.push(21)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(56); s.push(2); s.push(21)\nassert s.peek() == 21\nassert s.pop() == 21\nassert s.pop() == 2\nassert s.is_empty() == False\nassert s.pop() == 56\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004490", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('e cab ceb') == 'E Cab Ceb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('e cab ceb') == 'E Cab Ceb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004491", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'date', 'coconut', 'avocado']) == {'c': ['coconut', 'coconut'], 'd': ['date'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'date', 'coconut', 'avocado']) == {'c': ['coconut', 'coconut'], 'd': ['date'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004492", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(18, 14) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(18, 14) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004493", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'a', 'a', 'd', 'c', 'a', 'c']) == {'c': 3, 'a': 3, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'a', 'd', 'c', 'a', 'c']) == {'c': 3, 'a': 3, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004494", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(86) == 30\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(86) == 30\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004495", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(142) == [2, 71]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(142) == [2, 71]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004496", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[2, 1, 3, 4], [8, 4, 8], [7, 9, 4]]) == [2, 1, 3, 4, 8, 4, 8, 7, 9, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 1, 3, 4], [8, 4, 8], [7, 9, 4]]) == [2, 1, 3, 4, 8, 4, 8, 7, 9, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004497", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('hf ehhg bffcca eacf') == 'bffcca'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hf ehhg bffcca eacf') == 'bffcca'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004498", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 2, 0, 3]) == [2, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 0, 3]) == [2, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004499", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('eaeb') == 'eab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eaeb') == 'eab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004500", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('5h29m37s') == 19777\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h29m37s') == 19777\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004501", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(6133) == 3316\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6133) == 3316\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004502", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 1, 2, 4, 3, 3, 0, 5, 2, 5, 0, 3]) == [1, 2, 4, 3, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 2, 4, 3, 3, 0, 5, 2, 5, 0, 3]) == [1, 2, 4, 3, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004503", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('World Code', 20) == 'Qilfx Wixy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Code', 20) == 'Qilfx Wixy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004504", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 8, 8, 0, 3, 1, 7], 2) == [[9, 8], [8, 0], [3, 1], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 8, 8, 0, 3, 1, 7], 2) == [[9, 8], [8, 0], [3, 1], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004505", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([9, 35, 53, 71, 73, 74, 80], 100) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([9, 35, 53, 71, 73, 74, 80], 100) == -1\nassert binary_search([9, 35, 53, 71, 73, 74, 80], 9) == 0\nassert binary_search([9, 35, 53, 71, 73, 74, 80], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004506", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(5, 15) == 15\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 15) == 15\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004507", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('decdad') == 'deca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('decdad') == 'deca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004508", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(66); s.push(3); s.push(39)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(66); s.push(3); s.push(39)\nassert s.peek() == 39\nassert s.pop() == 39\nassert s.pop() == 3\nassert s.is_empty() == False\nassert s.pop() == 66\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004509", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[4, 1, 2], [4, 6, 0]]) == [[4, 4], [1, 6], [2, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 1, 2], [4, 6, 0]]) == [[4, 4], [1, 6], [2, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004510", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([1, -20, 4]) == -15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([1, -20, 4]) == -15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004511", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([3, [4, 4], [1, 7, 4, 3], [5]]) == [3, 4, 4, 1, 7, 4, 3, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [4, 4], [1, 7, 4, 3], [5]]) == [3, 4, 4, 1, 7, 4, 3, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004512", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(69) == [3, 23]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(69) == [3, 23]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004513", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-5, 2], [6, 2]], [[0, -7], [-7, -8]]) == [[-5, -5], [-1, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, 2], [6, 2]], [[0, -7], [-7, -8]]) == [[-5, -5], [-1, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004514", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-10, -4, 16, -16, 10, -14]) == -18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-10, -4, 16, -16, 10, -14]) == -18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004515", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('cccccccbbbbbbbbbccccccccccccccccc') == 'c7b9c17'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccccbbbbbbbbbccccccccccccccccc') == 'c7b9c17'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004516", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'a': 8, 'd': 5, 'b': 2}, 5) == {'a': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 8, 'd': 5, 'b': 2}, 5) == {'a': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004517", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(178) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(178) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004518", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'coconut', 'coconut', 'cherry', 'cherry']) == {'c': ['coconut', 'coconut', 'coconut', 'cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'coconut', 'coconut', 'cherry', 'cherry']) == {'c': ['coconut', 'coconut', 'coconut', 'cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004519", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([3, 5, 17], [0, 3, 5, 8, 11, 13, 18]) == [0, 3, 3, 5, 5, 8, 11, 13, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 5, 17], [0, 3, 5, 8, 11, 13, 18]) == [0, 3, 3, 5, 5, 8, 11, 13, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004520", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(378) == 107\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(378) == 107\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004521", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[[2, 8], 7, [1, 1, 0]], [[8, 4, 6], 1], 4]) == [2, 8, 7, 1, 1, 0, 8, 4, 6, 1, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[2, 8], 7, [1, 1, 0]], [[8, 4, 6], 1], 4]) == [2, 8, 7, 1, 1, 0, 8, 4, 6, 1, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004522", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(33) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(33) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004523", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(17, 8) == 136\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 8) == 136\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004524", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sun dog sun. ran dog sat Dog dog') == {'sun': 2, 'dog': 4, 'ran': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun dog sun. ran dog sat Dog dog') == {'sun': 2, 'dog': 4, 'ran': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004525", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 5, 3, 1, 8, 6, 4, 3], [1, 8, 2, 7]) == [2, 1, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 5, 3, 1, 8, 6, 4, 3], [1, 8, 2, 7]) == [2, 1, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004526", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ddacccccccaaaaa') == 'd2a1c7a5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddacccccccaaaaa') == 'd2a1c7a5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004527", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccdbbbb') == 'c2d1b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccdbbbb') == 'c2d1b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004528", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 0, 7, 2, 9, 8, 6], [3, 0, 8, 6, 4, 5, 6]) == [4, 0, 8, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 0, 7, 2, 9, 8, 6], [3, 0, 8, 6, 4, 5, 6]) == [4, 0, 8, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004529", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(99); s.push(74); s.push(12)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(74); s.push(12)\nassert s.peek() == 12\nassert s.pop() == 12\nassert s.pop() == 74\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004530", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{[){(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{[){(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004531", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 3, 4], [0, 3, 3]], [[5, 0, 0], [2, 2, 1], [3, 2, 0]]) == [[43, 14, 3], [15, 12, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3, 4], [0, 3, 3]], [[5, 0, 0], [2, 2, 1], [3, 2, 0]]) == [[43, 14, 3], [15, 12, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004532", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['yxz', 'xzy', 'xxx', 'y']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['yxz', 'xzy', 'xxx', 'y']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004533", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog the, sun, cat cat sat the sat sat the!') == {'dog': 1, 'the': 3, 'sun': 1, 'cat': 2, 'sat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog the, sun, cat cat sat the sat sat the!') == {'dog': 1, 'the': 3, 'sun': 1, 'cat': 2, 'sat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004534", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([13, 24, 19, 19]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 24, 19, 19]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004535", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 1, 4, 0, 5, 0, 2, 5, 1]) == [3, 1, 4, 0, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 4, 0, 5, 0, 2, 5, 1]) == [3, 1, 4, 0, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004536", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CXLVII') == 147\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXLVII') == 147\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004537", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('bdbffc', 'bdbffcf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bdbffc', 'bdbffcf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004538", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([3, 1, 0, 4, 1, 2, 8], [7, 8, 0, 0, 9, 8, 0]) == [0, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 1, 0, 4, 1, 2, 8], [7, 8, 0, 0, 9, 8, 0]) == [0, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004539", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 1, 'c': 6, 'a': 8}, 4) == {'c': 6, 'a': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 1, 'c': 6, 'a': 8}, 4) == {'c': 6, 'a': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004540", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([5, [1], 1, [3, 4, 4, 3]]) == [5, 1, 1, 3, 4, 4, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [1], 1, [3, 4, 4, 3]]) == [5, 1, 1, 3, 4, 4, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004541", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([17, 14, 5, 17, 10, 23, 3, 25, 14, 2]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 14, 5, 17, 10, 23, 3, 25, 14, 2]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004542", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 3, 'b': 56}) == {3: 'e', 56: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 3, 'b': 56}) == {3: 'e', 56: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004543", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(113, 198) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(113, 198) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004544", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([4, 45, 52, 74, 84, 85, 86, 90, 96], 173) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 45, 52, 74, 84, 85, 86, 90, 96], 173) == -1\nassert binary_search([4, 45, 52, 74, 84, 85, 86, 90, 96], 4) == 0\nassert binary_search([4, 45, 52, 74, 84, 85, 86, 90, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004545", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('d ebc') == 'D Ebc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('d ebc') == 'D Ebc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004546", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'a': 5, 'c': 2, 'b': 9}, 7) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 5, 'c': 2, 'b': 9}, 7) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004547", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=off; port=off; host=719; mode=821') == {'user': 'off', 'port': 'off', 'host': '719', 'mode': '821'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; port=off; host=719; mode=821') == {'user': 'off', 'port': 'off', 'host': '719', 'mode': '821'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004548", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cbeaeeeb') == 'cbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbeaeeeb') == 'cbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004549", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([35, 29, 38, 50, 37, 33, 7]) == [7, 29, 33, 35, 37, 38, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([35, 29, 38, 50, 37, 33, 7]) == [7, 29, 33, 35, 37, 38, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004550", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[9, 3], [9, 6], [2, 3], [9, 2]]) == [[9, 9, 2, 9], [3, 6, 3, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 3], [9, 6], [2, 3], [9, 2]]) == [[9, 9, 2, 9], [3, 6, 3, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004551", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([1, 7, 4], 3) == [1, 7, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 7, 4], 3) == [1, 7, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004552", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 7, 8, 6], 4) == [[6, 7, 8, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 7, 8, 6], 4) == [[6, 7, 8, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004553", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(')[]([([}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')[]([([}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004554", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['cherry', 'date', 'banana', 'apple', 'berry']) == {'c': ['cherry'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'date', 'banana', 'apple', 'berry']) == {'c': ['cherry'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004555", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('acacae cabb d') == 'Acacae Cabb D'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('acacae cabb d') == 'Acacae Cabb D'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004556", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 1, 4, 2, 4, 0, 3], 4) == [[8, 1, 4, 2], [4, 0, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 4, 2, 4, 0, 3], 4) == [[8, 1, 4, 2], [4, 0, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004557", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(44, 37, 474) == 2\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(44, 37, 474) == 2\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004558", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog sat dog cat, sun the cat sun ran!') == {'dog': 2, 'sat': 1, 'cat': 2, 'sun': 2, 'the': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat dog cat, sun the cat sun ran!') == {'dog': 2, 'sat': 1, 'cat': 2, 'sun': 2, 'the': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004559", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 3, 3, 1, 5, 4]) == [1, 3, 5, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 3, 1, 5, 4]) == [1, 3, 5, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004560", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([7, [9], [0, 5]]) == 21\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([7, [9], [0, 5]]) == 21\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004561", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(44); s.push(34); s.push(70)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(44); s.push(34); s.push(70)\nassert s.peek() == 70\nassert s.pop() == 70\nassert s.pop() == 34\nassert s.is_empty() == False\nassert s.pop() == 44\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004562", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(15, 23, 641) == 237\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(15, 23, 641) == 237\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004563", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(162)\nacc.deposit(128)\nacc.withdraw(174)\nacc.withdraw(300)\nassert acc.get_balance() == 290\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(162)\nacc.deposit(128)\nassert acc.get_balance() == 290\nacc.withdraw(174)\nassert acc.get_balance() == 116\nacc.withdraw(300)\nassert acc.get_balance() == 116\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004564", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 3, 0, 4, 3]) == [5, 3, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 3, 0, 4, 3]) == [5, 3, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004565", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('cbbbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbbbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004566", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['bab', 'babzy']) == 'bab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bab', 'babzy']) == 'bab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004567", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([5, 8, 22, 31, 31]) == [5, 8, 22, 31, 31]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([5, 8, 22, 31, 31]) == [5, 8, 22, 31, 31]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004568", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([4, 0, 4, 9]) == 4\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 0, 4, 9]) == 4\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004569", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Cat cat sat dog Sat dog') == {'cat': 2, 'sat': 2, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat cat sat dog Sat dog') == {'cat': 2, 'sat': 2, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004570", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 5, 1, 1, 0]) == [0, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 1, 1, 0]) == [0, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004571", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'c': 3, 'b': 10, 'd': 9, 'a': 2}, 2) == {'c': 3, 'b': 10, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 3, 'b': 10, 'd': 9, 'a': 2}, 2) == {'c': 3, 'b': 10, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004572", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(522233) == 722\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(522233) == 722\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004573", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(5, 16) == 80\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 16) == 80\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004574", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[1, 0], [8, 4]]) == [[1, 8], [0, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 0], [8, 4]]) == [[1, 8], [0, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004575", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(71); s.push(35); s.push(42)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(71); s.push(35); s.push(42)\nassert s.peek() == 42\nassert s.pop() == 42\nassert s.pop() == 35\nassert s.is_empty() == False\nassert s.pop() == 71\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004576", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aacbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aacbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004577", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 1, 2, 8, 6], 3) == [2, 8, 6, 1, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 1, 2, 8, 6], 3) == [2, 8, 6, 1, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004578", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 4, 5, 3, 4, 2, 5, 5, 5]) == [3, 4, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 5, 3, 4, 2, 5, 5, 5]) == [3, 4, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004579", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(87) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(87) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004580", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(8468) == 26\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8468) == 26\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004581", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ccca') == 'ca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ccca') == 'ca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004582", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([3, 2, 21, 9, 15, 9, 15, 2]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 2, 21, 9, 15, 9, 15, 2]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004583", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(22, 31) == 682\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 31) == 682\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004584", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 1, 'y': 4, 'z': 4}, {'z': 4, 'x': 7}) == {'x': 8, 'y': 4, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1, 'y': 4, 'z': 4}, {'z': 4, 'x': 7}) == {'x': 8, 'y': 4, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004585", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([9, 6, 4, 8, 23]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 6, 4, 8, 23]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004586", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 7, 9, 5, 8, 7, 6, 3, 6], 3) == [6, 3, 6, 2, 7, 9, 5, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 7, 9, 5, 8, 7, 6, 3, 6], 3) == [6, 3, 6, 2, 7, 9, 5, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004587", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 70, 'd': 88, 'c': 97, 'a': 78, 'e': 98}) == {70: 'f', 88: 'd', 97: 'c', 78: 'a', 98: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 70, 'd': 88, 'c': 97, 'a': 78, 'e': 98}) == {70: 'f', 88: 'd', 97: 'c', 78: 'a', 98: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004588", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([34, 31, 23, 48, 9, 47]) == [9, 23, 31, 34, 47, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 31, 23, 48, 9, 47]) == [9, 23, 31, 34, 47, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004589", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(5133) == 3315\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5133) == 3315\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004590", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3548) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3548) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004591", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[7, 6], 2, [3, 5, 1], [6, 5, 0], [2, 5, 5, 1]]) == [7, 6, 2, 3, 5, 1, 6, 5, 0, 2, 5, 5, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 6], 2, [3, 5, 1], [6, 5, 0], [2, 5, 5, 1]]) == [7, 6, 2, 3, 5, 1, 6, 5, 0, 2, 5, 5, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004592", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(162, 168) == 6\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(162, 168) == 6\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004593", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran. the Sun the') == {'ran': 1, 'the': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran. the Sun the') == {'ran': 1, 'the': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004594", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(20 * 17) - 3') == 337\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(20 * 17) - 3') == 337\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004595", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(12, 19, 21) == 12\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(12, 19, 21) == 12\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004596", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(58, 13) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(58, 13) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004597", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 2, 3, 1]) == [1, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 3, 1]) == [1, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004598", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(7)\nacc.deposit(143)\nacc.withdraw(37)\nacc.withdraw(215)\nassert acc.get_balance() == 150\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(7)\nacc.deposit(143)\nassert acc.get_balance() == 150\nacc.withdraw(37)\nassert acc.get_balance() == 113\nacc.withdraw(215)\nassert acc.get_balance() == 113\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004599", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([50, 88, 93, 97], 117) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([50, 88, 93, 97], 117) == -1\nassert binary_search([50, 88, 93, 97], 50) == 0\nassert binary_search([50, 88, 93, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004600", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'cherry', 'banana', 'coconut']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'cherry', 'banana', 'coconut']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004601", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-14, -4, 12, -8]) == -14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, -4, 12, -8]) == -14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004602", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 0, 0], 1) == [0, 0, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 0, 0], 1) == [0, 0, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004603", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(6, 4) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(6, 4) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004604", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[2], 3, [3, 8, 7]], 5]) == 28\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[2], 3, [3, 8, 7]], 5]) == 28\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004605", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 5, 3, 5, 3, 4, 3, 1, 0, 3, 1, 4]) == [0, 5, 3, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 3, 5, 3, 4, 3, 1, 0, 3, 1, 4]) == [0, 5, 3, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004606", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'avocado']) == {'c': ['coconut'], 'b': ['berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'avocado']) == {'c': ['coconut'], 'b': ['berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004607", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(25, 48) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(25, 48) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004608", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([1, 6, 31, 69, 77, 78, 87, 95], 31) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 6, 31, 69, 77, 78, 87, 95], 31) == 2\nassert binary_search([1, 6, 31, 69, 77, 78, 87, 95], 1) == 0\nassert binary_search([1, 6, 31, 69, 77, 78, 87, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004609", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('21m6s') == 1266\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('21m6s') == 1266\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004610", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(21, 30) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(21, 30) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004611", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('bfcfbfa', 'bfcfbfac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bfcfbfa', 'bfcfbfac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004612", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(5, 35) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(5, 35) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004613", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 0, 5, 7, 1, 4, 5], 5) == [[6, 0, 5, 7, 1], [4, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 0, 5, 7, 1, 4, 5], 5) == [[6, 0, 5, 7, 1], [4, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004614", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(5270) == 72\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5270) == 72\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004615", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-6, -5], [0, 6]], [[-8, -4], [0, 1]]) == [[-14, -9], [0, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -5], [0, 6]], [[-8, -4], [0, 1]]) == [[-14, -9], [0, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004616", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(3530) == 11\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3530) == 11\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004617", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('{}()({})') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}()({})') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004618", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h54m7s') == 17647\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h54m7s') == 17647\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004619", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([42, 50, 43, 26, 19, 42, 40, 9, 8, 1, 13, 9, 4]) == [1, 4, 8, 9, 9, 13, 19, 26, 40, 42, 42, 43, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([42, 50, 43, 26, 19, 42, 40, 9, 8, 1, 13, 9, 4]) == [1, 4, 8, 9, 9, 13, 19, 26, 40, 42, 42, 43, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004620", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('cbaaaabc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbaaaabc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004621", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['b', 'a', 'd', 'd', 'b']) == {'b': 2, 'a': 1, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'a', 'd', 'd', 'b']) == {'b': 2, 'a': 1, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004622", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('1h10m23s') == 4223\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h10m23s') == 4223\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004623", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 4, 1, 8, 1], [5, 7, 6, 3, 5]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 4, 1, 8, 1], [5, 7, 6, 3, 5]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004624", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 5, 0, 3]) == [4, 5, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 0, 3]) == [4, 5, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004625", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([32, 28, 3, 3, 33, 2, 8, 30, 42, 9, 25, 39]) == [2, 3, 3, 8, 9, 25, 28, 30, 32, 33, 39, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([32, 28, 3, 3, 33, 2, 8, 30, 42, 9, 25, 39]) == [2, 3, 3, 8, 9, 25, 28, 30, 32, 33, 39, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004626", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran cat Dog ran sat') == {'ran': 2, 'cat': 1, 'dog': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran cat Dog ran sat') == {'ran': 2, 'cat': 1, 'dog': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004627", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('efbd', 'efbde') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efbd', 'efbde') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004628", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(615213) == 784\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(615213) == 784\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004629", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([7, 9, 9, 7, 1], 5) == [[7, 9, 9, 7, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 9, 9, 7, 1], 5) == [[7, 9, 9, 7, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004630", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([46, 48, 44, 32]) == [32, 44, 46, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 48, 44, 32]) == [32, 44, 46, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004631", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([0, 1, 18, 14, 14, 7, 0, 1]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 1, 18, 14, 14, 7, 0, 1]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004632", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens(')}(a}b)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')}(a}b)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004633", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([7, 43, 17, 5, 27, 22, 13, 39]) == [5, 7, 13, 17, 22, 27, 39, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 43, 17, 5, 27, 22, 13, 39]) == [5, 7, 13, 17, 22, 27, 39, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004634", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'d': 0, 'e': 10, 'b': 8}, 3) == {'e': 10, 'b': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 0, 'e': 10, 'b': 8}, 3) == {'e': 10, 'b': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004635", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 19, 'd': 4, 'c': 50}) == {19: 'e', 4: 'd', 50: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 19, 'd': 4, 'c': 50}) == {19: 'e', 4: 'd', 50: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004636", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('db,aaab,\"ab,a\",38') == ['db', 'aaab', 'ab,a', '38']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('db,aaab,\"ab,a\",38') == ['db', 'aaab', 'ab,a', '38']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004637", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran sat! dog dog dog sat, the sun, sat. The') == {'ran': 1, 'sat': 3, 'dog': 3, 'the': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat! dog dog dog sat, the sun, sat. The') == {'ran': 1, 'sat': 3, 'dog': 3, 'the': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004638", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(416) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(416) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004639", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'d': 4, 'e': 5, 'b': 3}, 6) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 4, 'e': 5, 'b': 3}, 6) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004640", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(790) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(790) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004641", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('DLXIV') == 564\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DLXIV') == 564\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004642", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[9, -8, 2], [-3, -8, -2], [-9, -4, 8]], [[3, 8, 2], [1, -9, -1], [-7, 4, -9]]) == [[12, 0, 4], [-2, -17, -3], [-16, 0, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, -8, 2], [-3, -8, -2], [-9, -4, 8]], [[3, 8, 2], [1, -9, -1], [-7, 4, -9]]) == [[12, 0, 4], [-2, -17, -3], [-16, 0, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004643", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'banana', 'berry', 'berry', 'date', 'cherry']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'banana', 'berry', 'berry', 'date', 'cherry']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004644", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(371) == [7, 53]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(371) == [7, 53]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004645", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 4, 2, 0, 1, 3, 1, 5]) == [5, 4, 2, 0, 1, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 2, 0, 1, 3, 1, 5]) == [5, 4, 2, 0, 1, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004646", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(243) == 'CCXLIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(243) == 'CCXLIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004647", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=370; user=off; path=off') == {'port': '370', 'user': 'off', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=370; user=off; path=off') == {'port': '370', 'user': 'off', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004648", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 1, 0, 4, 2, 0, 4, 0]) == [3, 1, 0, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 0, 4, 2, 0, 4, 0]) == [3, 1, 0, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004649", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babababaabbaabaa', 'babb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babababaabbaabaa', 'babb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004650", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cbaacbcaabbab', 'ac') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbaacbcaabbab', 'ac') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004651", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 5, 2, 4, 4, 5, 1, 2]) == [0, 5, 2, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 2, 4, 4, 5, 1, 2]) == [0, 5, 2, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004652", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=807; user=480') == {'port': '807', 'user': '480'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=807; user=480') == {'port': '807', 'user': '480'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004653", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(167)\nacc.deposit(161)\nacc.withdraw(58)\nacc.withdraw(384)\nassert acc.get_balance() == 328\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(167)\nacc.deposit(161)\nassert acc.get_balance() == 328\nacc.withdraw(58)\nassert acc.get_balance() == 270\nacc.withdraw(384)\nassert acc.get_balance() == 270\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004654", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(68, 25) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(68, 25) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004655", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 6, 5, 1, 1, 8, 7, 6], 2) == [[4, 6], [5, 1], [1, 8], [7, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 6, 5, 1, 1, 8, 7, 6], 2) == [[4, 6], [5, 1], [1, 8], [7, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004656", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(87); s.push(57); s.push(56)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(87); s.push(57); s.push(56)\nassert s.peek() == 56\nassert s.pop() == 56\nassert s.pop() == 57\nassert s.is_empty() == False\nassert s.pop() == 87\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004657", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([17, 18, 54, 70, 73, 82], 82) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 18, 54, 70, 73, 82], 82) == 5\nassert binary_search([17, 18, 54, 70, 73, 82], 17) == 0\nassert binary_search([17, 18, 54, 70, 73, 82], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004658", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['', 'x']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['', 'x']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004659", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(928) == 'CMXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(928) == 'CMXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004660", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('ab,36,24') == ['ab', '36', '24']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ab,36,24') == ['ab', '36', '24']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004661", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([2, 7, 19, 50, 59, 69, 86], 123) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 7, 19, 50, 59, 69, 86], 123) == -1\nassert binary_search([2, 7, 19, 50, 59, 69, 86], 2) == 0\nassert binary_search([2, 7, 19, 50, 59, 69, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004662", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(48); s.push(93); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(48); s.push(93); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 93\nassert s.is_empty() == False\nassert s.pop() == 48\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004663", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(821) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(821) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004664", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(264) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(264) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004665", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([20, 4, 10, 16, 4, 10, 4]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 4, 10, 16, 4, 10, 4]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004666", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([26, 9, 7, 12, 9, 1, 26, 12]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 9, 7, 12, 9, 1, 26, 12]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004667", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([2, 20, 41, 45, 65, 69, 80], 170) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 20, 41, 45, 65, 69, 80], 170) == -1\nassert binary_search([2, 20, 41, 45, 65, 69, 80], 2) == 0\nassert binary_search([2, 20, 41, 45, 65, 69, 80], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004668", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'a', 'd', 'd', 'e', 'b', 'c']) == {'e': 2, 'a': 1, 'd': 2, 'b': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'd', 'd', 'e', 'b', 'c']) == {'e': 2, 'a': 1, 'd': 2, 'b': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004669", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([2, [1], 0, [7], 6]) == [2, 1, 0, 7, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, [1], 0, [7], 6]) == [2, 1, 0, 7, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004670", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(32, 48) == 96\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(32, 48) == 96\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004671", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'z': 6, 'w': 8, 'x': 2}) == {'y': 6, 'z': 6, 'w': 8, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'z': 6, 'w': 8, 'x': 2}) == {'y': 6, 'z': 6, 'w': 8, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004672", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([49, 41, 32, 5, 39, 4, 1, 44]) == [1, 4, 5, 32, 39, 41, 44, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([49, 41, 32, 5, 39, 4, 1, 44]) == [1, 4, 5, 32, 39, 41, 44, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004673", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 41, 'b': 0, 'f': 12, 'd': 94}) == {41: 'c', 0: 'b', 12: 'f', 94: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 41, 'b': 0, 'f': 12, 'd': 94}) == {41: 'c', 0: 'b', 12: 'f', 94: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004674", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabaaba', 'acbc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaaba', 'acbc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004675", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([46, 11, 41]) == [11, 41, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 11, 41]) == [11, 41, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004676", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(620) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(620) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004677", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'date', 'cherry']) == {'b': ['berry'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'cherry']) == {'b': ['berry'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004678", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(27, 53) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(27, 53) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004679", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['d', 'd', 'c', 'd', 'e', 'a', 'e', 'a', 'c']) == {'d': 3, 'c': 2, 'e': 2, 'a': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'c', 'd', 'e', 'a', 'e', 'a', 'c']) == {'d': 3, 'c': 2, 'e': 2, 'a': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004680", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(333) == 'CCCXXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(333) == 'CCCXXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004681", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(3); s.push(44); s.push(6)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(3); s.push(44); s.push(6)\nassert s.peek() == 6\nassert s.pop() == 6\nassert s.pop() == 44\nassert s.is_empty() == False\nassert s.pop() == 3\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004682", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('5h18m54s') == 19134\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h18m54s') == 19134\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004683", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('uynvjtihd') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('uynvjtihd') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004684", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(86, 196) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(86, 196) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004685", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(60); s.push(89); s.push(90)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(60); s.push(89); s.push(90)\nassert s.peek() == 90\nassert s.pop() == 90\nassert s.pop() == 89\nassert s.is_empty() == False\nassert s.pop() == 60\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004686", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(3013) == 'MMMXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3013) == 'MMMXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004687", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 33, 'f': 95, 'e': 16, 'a': 66, 'b': 41}) == {33: 'd', 95: 'f', 16: 'e', 66: 'a', 41: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 33, 'f': 95, 'e': 16, 'a': 66, 'b': 41}) == {33: 'd', 95: 'f', 16: 'e', 66: 'a', 41: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004688", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([41, 0, 25]) == [0, 25, 41]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([41, 0, 25]) == [0, 25, 41]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004689", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(139)\nacc.deposit(47)\nacc.withdraw(107)\nacc.withdraw(358)\nassert acc.get_balance() == 186\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(139)\nacc.deposit(47)\nassert acc.get_balance() == 186\nacc.withdraw(107)\nassert acc.get_balance() == 79\nacc.withdraw(358)\nassert acc.get_balance() == 79\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004690", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=566; path=off') == {'port': '566', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=566; path=off') == {'port': '566', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004691", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[9, 1, 6], [9, 5, 0], [0, 5, 8]]) == [[9, 9, 0], [1, 5, 5], [6, 0, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 1, 6], [9, 5, 0], [0, 5, 8]]) == [[9, 9, 0], [1, 5, 5], [6, 0, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004692", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 9, 7], 3) == [4, 9, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 9, 7], 3) == [4, 9, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004693", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 52, 'c': 17, 'b': 48, 'd': 44, 'f': 72}) == {52: 'e', 17: 'c', 48: 'b', 44: 'd', 72: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 52, 'c': 17, 'b': 48, 'd': 44, 'f': 72}) == {52: 'e', 17: 'c', 48: 'b', 44: 'd', 72: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004694", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-3, -7, -42]) == -3\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-3, -7, -42]) == -3\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004695", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([12, 10, 12, 13, 8, 8, 13]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 10, 12, 13, 8, 8, 13]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004696", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([3, 9, 7, 1, 3, 9, 9, 8, 9, 9, 7, 4, 1], 4) == [[3, 9, 7, 1], [3, 9, 9, 8], [9, 9, 7, 4], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 9, 7, 1, 3, 9, 9, 8, 9, 9, 7, 4, 1], 4) == [[3, 9, 7, 1], [3, 9, 9, 8], [9, 9, 7, 4], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004697", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'a', 'a', 'a', 'c', 'e', 'a', 'a', 'b', 'a']) == {'d': 1, 'a': 6, 'c': 1, 'e': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'a', 'a', 'a', 'c', 'e', 'a', 'a', 'b', 'a']) == {'d': 1, 'a': 6, 'c': 1, 'e': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004698", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(4501) == 67\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4501) == 67\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004699", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('cccbbccc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cccbbccc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004700", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2334) == 'MMCCCXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2334) == 'MMCCCXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004701", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 7, 6, 8, 1, 3], 9) == [8, 1, 3, 2, 7, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 7, 6, 8, 1, 3], 9) == [8, 1, 3, 2, 7, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004702", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 10, 39, 86, 91, 95, 96], 39) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 10, 39, 86, 91, 95, 96], 39) == 2\nassert binary_search([5, 10, 39, 86, 91, 95, 96], 5) == 0\nassert binary_search([5, 10, 39, 86, 91, 95, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004703", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat ran ran the cat') == {'cat': 2, 'ran': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat ran ran the cat') == {'cat': 2, 'ran': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004704", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(7705) == 87\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7705) == 87\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004705", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(753) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(753) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004706", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('LIX') == 59\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LIX') == 59\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004707", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([21, 13, 3, 12, 13, 3]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 13, 3, 12, 13, 3]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004708", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 3, 5, 4, 8, 5, 8, 6, 5], 1) == [5, 2, 3, 5, 4, 8, 5, 8, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 3, 5, 4, 8, 5, 8, 6, 5], 1) == [5, 2, 3, 5, 4, 8, 5, 8, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004709", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aaaaaabaabb', 'aaab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaaaabaabb', 'aaab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004710", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 14, 'e': 7}) == {14: 'a', 7: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 14, 'e': 7}) == {14: 'a', 7: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004711", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(4007) == 7004\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4007) == 7004\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004712", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'apple', 'banana', 'berry']) == {'c': ['cherry'], 'a': ['apple'], 'b': ['banana', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'apple', 'banana', 'berry']) == {'c': ['cherry'], 'a': ['apple'], 'b': ['banana', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004713", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(1, 8) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 8) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004714", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('abbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('abbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004715", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([28, 39, 0, 3, 10, 9]) == [0, 3, 9, 10, 28, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([28, 39, 0, 3, 10, 9]) == [0, 3, 9, 10, 28, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004716", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aaaaaaaaaddddddddddddddddddddddddd') == 'a9d25'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaddddddddddddddddddddddddd') == 'a9d25'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004717", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('xfxcafdd') == 'ddfacxfx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xfxcafdd') == 'ddfacxfx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004718", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 2, 1], [8, 3, 3, 8, 5, 4, 9, 2]) == [2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 2, 1], [8, 3, 3, 8, 5, 4, 9, 2]) == [2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004719", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[9, -8], [6, -5], [-9, -9]], [[5, 0], [9, 0], [3, -1]]) == [[14, -8], [15, -5], [-6, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, -8], [6, -5], [-9, -9]], [[5, 0], [9, 0], [3, -1]]) == [[14, -8], [15, -5], [-6, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004720", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([1, 5, 1, 7], 3) == [[1, 5, 1], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 5, 1, 7], 3) == [[1, 5, 1], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004721", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(90); s.push(14); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(14); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 14\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004722", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(100) == 25\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(100) == 25\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004723", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 3, 6, 6, 0, 1, 0], 4) == [6, 0, 1, 0, 0, 3, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 3, 6, 6, 0, 1, 0], 4) == [6, 0, 1, 0, 0, 3, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004724", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 51, 'b': 11}) == {51: 'e', 11: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 51, 'b': 11}) == {51: 'e', 11: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004725", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(35, 45) == 315\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(35, 45) == 315\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004726", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ecaaada') == 'ecad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecaaada') == 'ecad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004727", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(64); s.push(70); s.push(0)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(64); s.push(70); s.push(0)\nassert s.peek() == 0\nassert s.pop() == 0\nassert s.pop() == 70\nassert s.is_empty() == False\nassert s.pop() == 64\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004728", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MCDXX') == 1420\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCDXX') == 1420\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004729", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('World Code', 5) == 'Btwqi Htij'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Code', 5) == 'Btwqi Htij'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004730", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 2], [2, 5], [1, 1]], [[0, 3, 4], [2, 2, 0]]) == [[4, 4, 0], [10, 16, 8], [2, 5, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2], [2, 5], [1, 1]], [[0, 3, 4], [2, 2, 0]]) == [[4, 4, 0], [10, 16, 8], [2, 5, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004731", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([14, 29, 41, 52, 57, 68, 81, 84], 41) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 29, 41, 52, 57, 68, 81, 84], 41) == 2\nassert binary_search([14, 29, 41, 52, 57, 68, 81, 84], 14) == 0\nassert binary_search([14, 29, 41, 52, 57, 68, 81, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004732", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[1, 6, 7]]) == 14\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[1, 6, 7]]) == 14\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004733", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 4, 'a': 4, 'b': 9, 'c': 4}, 6) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 4, 'a': 4, 'b': 9, 'c': 4}, 6) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004734", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('ddbbbbbb') == 'd2b6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddbbbbbb') == 'd2b6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004735", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('ccbbaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccbbaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004736", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[7, 7, 6], [4, 5]]) == [7, 7, 6, 4, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 7, 6], [4, 5]]) == [7, 7, 6, 4, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004737", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5m24s') == 324\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5m24s') == 324\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004738", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([36, 44, 40, 48, 36, 47, 22]) == [22, 36, 36, 40, 44, 47, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([36, 44, 40, 48, 36, 47, 22]) == [22, 36, 36, 40, 44, 47, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004739", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(29) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(29) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004740", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'e': 20, 'c': 79, 'a': 11}) == {20: 'e', 79: 'c', 11: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 20, 'c': 79, 'a': 11}) == {20: 'e', 79: 'c', 11: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004741", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'b', 'c', 'b', 'c', 'e', 'a', 'b', 'a']) == {'d': 1, 'b': 3, 'c': 2, 'e': 1, 'a': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'b', 'c', 'b', 'c', 'e', 'a', 'b', 'a']) == {'d': 1, 'b': 3, 'c': 2, 'e': 1, 'a': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004742", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bcbaabcb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcbaabcb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004743", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(1886) == 43\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1886) == 43\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004744", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(89) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(89) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004745", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCCXXI') == 321\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXXI') == 321\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004746", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([42, 48, 29, 22, 48]) == [22, 29, 42, 48, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([42, 48, 29, 22, 48]) == [22, 29, 42, 48, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004747", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('edcb') == 'Edcb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('edcb') == 'Edcb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004748", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babcaacccccc', 'cbba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babcaacccccc', 'cbba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004749", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 2, 1, 0, 2, 5, 3, 3]) == [4, 2, 1, 0, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 1, 0, 2, 5, 3, 3]) == [4, 2, 1, 0, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004750", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([1, 2, 0, 0, 5, 2]) == [1, 2, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 2, 0, 0, 5, 2]) == [1, 2, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004751", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([14, 1, 9, 14, 17, 49, 18, 29]) == [1, 9, 14, 14, 17, 18, 29, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([14, 1, 9, 14, 17, 49, 18, 29]) == [1, 9, 14, 14, 17, 18, 29, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004752", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 59, 'c': 85, 'd': 64, 'e': 28}) == {59: 'a', 85: 'c', 64: 'd', 28: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 59, 'c': 85, 'd': 64, 'e': 28}) == {59: 'a', 85: 'c', 64: 'd', 28: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004753", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('babzz') == 'zzbab'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('babzz') == 'zzbab'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004754", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(4986) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4986) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004755", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([2, 16], [4, 12, 13]) == [2, 4, 12, 13, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 16], [4, 12, 13]) == [2, 4, 12, 13, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004756", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('10 + 2 + 1') == 13\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10 + 2 + 1') == 13\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004757", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([43, 44, 32, 41, 42]) == [32, 41, 42, 43, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([43, 44, 32, 41, 42]) == [32, 41, 42, 43, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004758", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-3, 2, 8]) == [-3, -1, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-3, 2, 8]) == [-3, -1, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004759", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('b,26,cd,b') == ['b', '26', 'cd', 'b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('b,26,cd,b') == ['b', '26', 'cd', 'b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004760", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[1, -8], [-9, 9], [6, 5]], [[6, 7], [6, 3], [-1, 2]]) == [[7, -1], [-3, 12], [5, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -8], [-9, 9], [6, 5]], [[6, 7], [6, 3], [-1, 2]]) == [[7, -1], [-3, 12], [5, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004761", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, 7], [-2, -6]], [[-9, 5], [-3, 8]]) == [[-3, 12], [-5, 2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, 7], [-2, -6]], [[-9, 5], [-3, 8]]) == [[-3, 12], [-5, 2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004762", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([2, 19], [6, 7, 9, 13, 15, 19, 20]) == [2, 6, 7, 9, 13, 15, 19, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 19], [6, 7, 9, 13, 15, 19, 20]) == [2, 6, 7, 9, 13, 15, 19, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004763", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(7906) == 88\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7906) == 88\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004764", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([1, 0, 0], 3) == [1, 0, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 0, 0], 3) == [1, 0, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004765", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(9, 11) == 99\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 11) == 99\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004766", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(2, 1) == 2\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 1) == 2\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004767", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['abbzy', 'abb', 'abb']) == 'abb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abbzy', 'abb', 'abb']) == 'abb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004768", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('5 + 9 - 7') == 7\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('5 + 9 - 7') == 7\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004769", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([1, 6, 1, 8, 1, 2, 8, 2], 1) == [2, 1, 6, 1, 8, 1, 2, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 1, 8, 1, 2, 8, 2], 1) == [2, 1, 6, 1, 8, 1, 2, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004770", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('((1 - 20) + 17 - 13)') == -15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((1 - 20) + 17 - 13)') == -15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004771", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aaabbbbaaaabaaa', 'bb') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabbbbaaaabaaa', 'bb') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004772", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([25, 16, 26, 40, 38, 19, 20, 24, 37]) == [16, 19, 20, 24, 25, 26, 37, 38, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([25, 16, 26, 40, 38, 19, 20, 24, 37]) == [16, 19, 20, 24, 25, 26, 37, 38, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004773", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9], 5]) == [9, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9], 5]) == [9, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004774", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('bfbdb e') == 'bfbdb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bfbdb e') == 'bfbdb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004775", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 8}, {'x': 3, 'w': 3}) == {'z': 8, 'x': 3, 'w': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8}, {'x': 3, 'w': 3}) == {'z': 8, 'x': 3, 'w': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004776", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([11, 25, 12, 1, 19, 41]) == [1, 11, 12, 19, 25, 41]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([11, 25, 12, 1, 19, 41]) == [1, 11, 12, 19, 25, 41]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004777", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('57m2s') == 3422\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('57m2s') == 3422\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004778", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 9, 1, 0], 1) == [0, 0, 9, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 9, 1, 0], 1) == [0, 0, 9, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004779", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('a({') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a({') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004780", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('cedbdda') == 'addbdec'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cedbdda') == 'addbdec'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004781", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([4, 3, 5, 0, 1, 8], [3, 9, 5, 7, 3, 0, 8, 2]) == [3, 5, 0, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 3, 5, 0, 1, 8], [3, 9, 5, 7, 3, 0, 8, 2]) == [3, 5, 0, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004782", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(4, 9) == 36\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 9) == 36\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004783", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('}b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004784", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[4], 6, 7, [2, 5]]) == [4, 6, 7, 2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], 6, 7, [2, 5]]) == [4, 6, 7, 2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004785", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 1, 'x': 2, 'z': 4}, {'y': 4}) == {'w': 1, 'x': 2, 'z': 4, 'y': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 1, 'x': 2, 'z': 4}, {'y': 4}) == {'w': 1, 'x': 2, 'z': 4, 'y': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004786", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 5, 'b': 3, 'e': 10}, 3) == {'d': 5, 'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 5, 'b': 3, 'e': 10}, 3) == {'d': 5, 'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004787", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['ac', 'acx', 'acy', 'acy']) == 'ac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ac', 'acx', 'acy', 'acy']) == 'ac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004788", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(1730) == 41\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1730) == 41\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004789", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['cacxzx', 'cacxxy', 'cac']) == 'cac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cacxzx', 'cacxxy', 'cac']) == 'cac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004790", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 9, 'b': 1}, 2) == {'d': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 9, 'b': 1}, 2) == {'d': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004791", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 4, 8, 5, 7, 9, 5, 4, 4], 8) == [4, 8, 5, 7, 9, 5, 4, 4, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 4, 8, 5, 7, 9, 5, 4, 4], 8) == [4, 8, 5, 7, 9, 5, 4, 4, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004792", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('20') == 20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20') == 20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004793", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(95); s.push(37); s.push(75)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(95); s.push(37); s.push(75)\nassert s.peek() == 75\nassert s.pop() == 75\nassert s.pop() == 37\nassert s.is_empty() == False\nassert s.pop() == 95\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004794", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h51m42s') == 10302\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h51m42s') == 10302\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004795", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(3815) == 61\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3815) == 61\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004796", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 8, 1, 0, 7, 3, 0, 2], 4) == [7, 3, 0, 2, 4, 8, 1, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 8, 1, 0, 7, 3, 0, 2], 4) == [7, 3, 0, 2, 4, 8, 1, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004797", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([9, 1, 7], 2) == [1, 7, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 1, 7], 2) == [1, 7, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004798", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([9, 3, [9, 4, 0]]) == 25\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9, 3, [9, 4, 0]]) == 25\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004799", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1470) == 741\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1470) == 741\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004800", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('cceb') == 'ceb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cceb') == 'ceb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004801", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 8, 'x': 6, 'w': 6}, {'x': 3, 'y': 5}) == {'z': 8, 'x': 9, 'w': 6, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8, 'x': 6, 'w': 6}, {'x': 3, 'y': 5}) == {'z': 8, 'x': 9, 'w': 6, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004802", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'berry', 'cherry', 'cherry', 'apple']) == {'a': ['avocado', 'apple'], 'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'berry', 'cherry', 'cherry', 'apple']) == {'a': ['avocado', 'apple'], 'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004803", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(22, 3) == 66\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 3) == 66\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004804", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('a}b[{]}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a}b[{]}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004805", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([1, -1, 2]) == [1, 0, 2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, -1, 2]) == [1, 0, 2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004806", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'berry', 'date']) == {'b': ['berry', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'date']) == {'b': ['berry', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004807", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('ed gacbaabb') == 'gacbaabb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ed gacbaabb') == 'gacbaabb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004808", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([10, 43, 11, 9]) == [9, 10, 11, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([10, 43, 11, 9]) == [9, 10, 11, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004809", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 9}, {'y': 2, 'x': 7}) == {'x': 16, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9}, {'y': 2, 'x': 7}) == {'x': 16, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004810", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CXXXIV') == 134\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXXIV') == 134\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004811", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-9, 5, -4, -2, -6, 5, 3]) == [-9, -4, -8, -10, -16, -11, -8]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-9, 5, -4, -2, -6, 5, 3]) == [-9, -4, -8, -10, -16, -11, -8]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004812", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('ababbbbabbbbbaab', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbbbabbbbbaab', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004813", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(46, 72) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(46, 72) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004814", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('xyz', 24) == 'vwx'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 24) == 'vwx'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004815", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[8, 5, 9], [3, 7, 4]]) == [[8, 3], [5, 7], [9, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 5, 9], [3, 7, 4]]) == [[8, 3], [5, 7], [9, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004816", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(18, 15, 368) == 96\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 15, 368) == 96\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004817", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([3, 0, 2, 4, 9, 3, 0, 6, 0, 2, 2, 7, 9, 8], 5) == [[3, 0, 2, 4, 9], [3, 0, 6, 0, 2], [2, 7, 9, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 0, 2, 4, 9, 3, 0, 6, 0, 2, 2, 7, 9, 8], 5) == [[3, 0, 2, 4, 9], [3, 0, 6, 0, 2], [2, 7, 9, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004818", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(46) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(46) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004819", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(8694) == 27\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8694) == 27\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004820", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('dbc cbabac bcbc bd') == 'Dbc Cbabac Bcbc Bd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dbc cbabac bcbc bd') == 'Dbc Cbabac Bcbc Bd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004821", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXII') == 262\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXII') == 262\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004822", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('([])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('([])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004823", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('eeheaab fdbbaca ch hhbhd') == 'eeheaab'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('eeheaab fdbbaca ch hhbhd') == 'eeheaab'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004824", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(327) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(327) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004825", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([11, 13, 10]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 13, 10]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004826", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat ran sun Sun the') == {'cat': 1, 'ran': 1, 'sun': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat ran sun Sun the') == {'cat': 1, 'ran': 1, 'sun': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004827", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 56, 'c': 17, 'e': 16, 'b': 30}) == {56: 'a', 17: 'c', 16: 'e', 30: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 56, 'c': 17, 'e': 16, 'b': 30}) == {56: 'a', 17: 'c', 16: 'e', 30: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004828", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 61, 'd': 70, 'b': 45}) == {61: 'c', 70: 'd', 45: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 61, 'd': 70, 'b': 45}) == {61: 'c', 70: 'd', 45: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004829", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'banana', 'cherry', 'banana', 'avocado', 'berry', 'cherry']) == {'c': ['cherry', 'cherry', 'cherry'], 'b': ['berry', 'banana', 'banana', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'banana', 'cherry', 'banana', 'avocado', 'berry', 'cherry']) == {'c': ['cherry', 'cherry', 'cherry'], 'b': ['berry', 'banana', 'banana', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004830", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(117) == [3, 3, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(117) == [3, 3, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004831", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(15, 13) == 195\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(15, 13) == 195\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004832", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['coconut', 'avocado', 'coconut', 'cherry']) == {'c': ['coconut', 'coconut', 'cherry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'avocado', 'coconut', 'cherry']) == {'c': ['coconut', 'coconut', 'cherry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004833", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('caeed') == 'caed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caeed') == 'caed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004834", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['cbyyx', 'cb']) == 'cb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cbyyx', 'cb']) == 'cb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004835", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 56, 'c': 28, 'e': 75, 'b': 71}) == {56: 'd', 28: 'c', 75: 'e', 71: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 56, 'c': 28, 'e': 75, 'b': 71}) == {56: 'd', 28: 'c', 75: 'e', 71: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004836", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([32, 4, 7, 47, 34, 42, 2]) == [2, 4, 7, 32, 34, 42, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 4, 7, 47, 34, 42, 2]) == [2, 4, 7, 32, 34, 42, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004837", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([0, 28, 27, 28]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 28, 27, 28]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004838", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'a', 'a', 'e', 'b', 'c']) == {'e': 2, 'a': 2, 'b': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'a', 'e', 'b', 'c']) == {'e': 2, 'a': 2, 'b': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004839", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-6, 4, 7, 9], [5, 3, 8, -2], [-7, 1, -2, 9]], [[7, -7, 3, 2], [5, -3, 3, 4], [-4, -5, 0, 1]]) == [[1, -3, 10, 11], [10, 0, 11, 2], [-11, -4, -2, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, 4, 7, 9], [5, 3, 8, -2], [-7, 1, -2, 9]], [[7, -7, 3, 2], [5, -3, 3, 4], [-4, -5, 0, 1]]) == [[1, -3, 10, 11], [10, 0, 11, 2], [-11, -4, -2, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004840", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(13, 193, 444) == 241\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(13, 193, 444) == 241\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004841", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(6554) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6554) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004842", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([19, -5]) == 14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([19, -5]) == 14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004843", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([7, 26, 48, 13]) == [7, 13, 26, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([7, 26, 48, 13]) == [7, 13, 26, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004844", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('smfq') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('smfq') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004845", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 14) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 14) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004846", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(437)\nacc.deposit(144)\nacc.withdraw(442)\nacc.withdraw(720)\nassert acc.get_balance() == 581\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(437)\nacc.deposit(144)\nassert acc.get_balance() == 581\nacc.withdraw(442)\nassert acc.get_balance() == 139\nacc.withdraw(720)\nassert acc.get_balance() == 139\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004847", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ccccdddd') == 'c4d4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccdddd') == 'c4d4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004848", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(18); s.push(36); s.push(10)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(18); s.push(36); s.push(10)\nassert s.peek() == 10\nassert s.pop() == 10\nassert s.pop() == 36\nassert s.is_empty() == False\nassert s.pop() == 18\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004849", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(883) == 29\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(883) == 29\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004850", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('aahdaa ghdfh') == 'aahdaa'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('aahdaa ghdfh') == 'aahdaa'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004851", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-4, 7, -1], [-2, 8, 2], [5, 9, -7]], [[9, -7, 8], [7, -1, 3], [-5, -8, -2]]) == [[5, 0, 7], [5, 7, 5], [0, 1, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 7, -1], [-2, 8, 2], [5, 9, -7]], [[9, -7, 8], [7, -1, 3], [-5, -8, -2]]) == [[5, 0, 7], [5, 7, 5], [0, 1, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004852", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=209; path=152; user=565') == {'host': '209', 'path': '152', 'user': '565'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=209; path=152; user=565') == {'host': '209', 'path': '152', 'user': '565'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004853", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h12m53s') == 15173\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h12m53s') == 15173\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004854", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(31, 46) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(31, 46) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004855", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(177) == 'CLXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(177) == 'CLXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004856", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([15, 21, 15, 15, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 21, 15, 15, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004857", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 0, 1, 0, 0, 8, 0, 9], 3) == [[6, 0, 1], [0, 0, 8], [0, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 0, 1, 0, 0, 8, 0, 9], 3) == [[6, 0, 1], [0, 0, 8], [0, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004858", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('zzdbya') == 'aybdzz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zzdbya') == 'aybdzz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004859", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('1,abb,49,\",,bbb\",\",,,bb\"') == ['1', 'abb', '49', ',,bbb', ',,,bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('1,abb,49,\",,bbb\",\",,,bb\"') == ['1', 'abb', '49', ',,bbb', ',,,bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004860", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[4], [1, 2, 0, 0], 2, 3, 0]) == [4, 1, 2, 0, 0, 2, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], [1, 2, 0, 0], 2, 3, 0]) == [4, 1, 2, 0, 0, 2, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004861", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('zbyzxyaa') == 'aayxzybz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zbyzxyaa') == 'aayxzybz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004862", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([34, 19, 35, 13, 31, 21]) == [13, 19, 21, 31, 34, 35]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([34, 19, 35, 13, 31, 21]) == [13, 19, 21, 31, 34, 35]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004863", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 7, 'w': 5}, {'x': 6}) == {'x': 13, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7, 'w': 5}, {'x': 6}) == {'x': 13, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004864", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([1, 1, 2, 3], [6, 9, 5, 6, 4, 0, 0, 0]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 1, 2, 3], [6, 9, 5, 6, 4, 0, 0, 0]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004865", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'apple']) == {'c': ['coconut'], 'a': ['apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'apple']) == {'c': ['coconut'], 'a': ['apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004866", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(86); s.push(72); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(86); s.push(72); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 72\nassert s.is_empty() == False\nassert s.pop() == 86\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004867", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('bbbcdaaaa') == 'b3c1d1a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbcdaaaa') == 'b3c1d1a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004868", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([2, 11, 8]) == 8\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 11, 8]) == 8\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004869", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cfe', 'cfee') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cfe', 'cfee') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004870", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('ac,46,ae') == ['ac', '46', 'ae']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ac,46,ae') == ['ac', '46', 'ae']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004871", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(182) == 'CLXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(182) == 'CLXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004872", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(94) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(94) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_004873", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('efdbecb', 'efbcdbe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efdbecb', 'efbcdbe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004874", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[5, 5], [1, 5], [0, 1]], [[0, 5], [0, 1]]) == [[0, 30], [0, 10], [0, 1]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 5], [1, 5], [0, 1]], [[0, 5], [0, 1]]) == [[0, 30], [0, 10], [0, 1]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004875", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h58m25s') == 17905\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h58m25s') == 17905\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004876", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 1, 2, 7, 13], [6, 17, 19]) == [1, 1, 2, 6, 7, 13, 17, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 1, 2, 7, 13], [6, 17, 19]) == [1, 1, 2, 6, 7, 13, 17, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004877", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(9397) == 28\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9397) == 28\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004878", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 6, 17], [2, 6, 10, 12, 14, 14, 17]) == [1, 2, 6, 6, 10, 12, 14, 14, 17, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 6, 17], [2, 6, 10, 12, 14, 14, 17]) == [1, 2, 6, 6, 10, 12, 14, 14, 17, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004879", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([23, 7, 15, 31]) == [7, 15, 23, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 7, 15, 31]) == [7, 15, 23, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004880", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([9, 3, 4, 29, 3, 29, 3]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 3, 4, 29, 3, 29, 3]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004881", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 0, 6, 1], [3, 9, 4, 8, 0, 2, 9, 1]) == [4, 0, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 0, 6, 1], [3, 9, 4, 8, 0, 2, 9, 1]) == [4, 0, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004882", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 43, 'c': 36, 'b': 54, 'e': 14, 'a': 0}) == {43: 'f', 36: 'c', 54: 'b', 14: 'e', 0: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 43, 'c': 36, 'b': 54, 'e': 14, 'a': 0}) == {43: 'f', 36: 'c', 54: 'b', 14: 'e', 0: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004883", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('dfdx') == 'xdfd'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('dfdx') == 'xdfd'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004884", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-44, -38, 18, 19]) == 19\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-44, -38, 18, 19]) == 19\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004885", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([31, 43, 64, 68, 85, 90], 129) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([31, 43, 64, 68, 85, 90], 129) == -1\nassert binary_search([31, 43, 64, 68, 85, 90], 31) == 0\nassert binary_search([31, 43, 64, 68, 85, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004886", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('baa,63') == ['baa', '63']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('baa,63') == ['baa', '63']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004887", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 0, 0, 4, 4, 2]) == [0, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 0, 4, 4, 2]) == [0, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004888", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('znyh') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('znyh') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004889", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[5]]) == 5\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5]]) == 5\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004890", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[1, 5]]) == 6\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[1, 5]]) == 6\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004891", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=off; port=597') == {'user': 'off', 'port': '597'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; port=597') == {'user': 'off', 'port': '597'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004892", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(1569) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1569) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004893", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'berry', 'apple']) == {'b': ['berry', 'berry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'apple']) == {'b': ['berry', 'berry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004894", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 83, 'f': 31, 'd': 27, 'a': 16, 'b': 79}) == {83: 'e', 31: 'f', 27: 'd', 16: 'a', 79: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 83, 'f': 31, 'd': 27, 'a': 16, 'b': 79}) == {83: 'e', 31: 'f', 27: 'd', 16: 'a', 79: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004895", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abbbbbabbb', 'bab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbbbabbb', 'bab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_004896", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Hello', 6) == 'Nkrru'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 6) == 'Nkrru'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004897", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([7, [9, 4, 6]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([7, [9, 4, 6]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004898", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 3, 'y': 2}, {'x': 6, 'w': 1}) == {'w': 4, 'y': 2, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 3, 'y': 2}, {'x': 6, 'w': 1}) == {'w': 4, 'y': 2, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004899", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 3, 'z': 7}, {'y': 7}) == {'w': 3, 'z': 7, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 3, 'z': 7}, {'y': 7}) == {'w': 3, 'z': 7, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004900", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('faafcca', 'faafccaa') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('faafcca', 'faafccaa') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004901", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=742; user=753; port=778; path=600') == {'mode': '742', 'user': '753', 'port': '778', 'path': '600'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=742; user=753; port=778; path=600') == {'mode': '742', 'user': '753', 'port': '778', 'path': '600'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004902", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{()(]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{()(]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004903", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[2, 5, 4], [4, 2, 3]], [[3, 4, 0], [5, 2, 2], [0, 5, 2]]) == [[31, 38, 18], [22, 35, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 5, 4], [4, 2, 3]], [[3, 4, 0], [5, 2, 2], [0, 5, 2]]) == [[31, 38, 18], [22, 35, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004904", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([25, 29, 51, 66, 77], 143) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([25, 29, 51, 66, 77], 143) == -1\nassert binary_search([25, 29, 51, 66, 77], 25) == 0\nassert binary_search([25, 29, 51, 66, 77], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004905", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'date', 'coconut', 'cherry', 'avocado', 'banana', 'coconut', 'date']) == {'b': ['banana', 'banana'], 'd': ['date', 'date'], 'c': ['coconut', 'cherry', 'coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'date', 'coconut', 'cherry', 'avocado', 'banana', 'coconut', 'date']) == {'b': ['banana', 'banana'], 'd': ['date', 'date'], 'c': ['coconut', 'cherry', 'coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004906", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 4, 3, 2, 5, 1, 0, 3]) == [2, 4, 3, 5, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 3, 2, 5, 1, 0, 3]) == [2, 4, 3, 5, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004907", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'c': 48, 'a': 29, 'e': 19, 'd': 37}) == {48: 'c', 29: 'a', 19: 'e', 37: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 48, 'a': 29, 'e': 19, 'd': 37}) == {48: 'c', 29: 'a', 19: 'e', 37: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004908", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 8, 6, 7, 4, 9, 1], [8, 9, 1, 4, 8, 3, 8]) == [8, 4, 9, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 8, 6, 7, 4, 9, 1], [8, 9, 1, 4, 8, 3, 8]) == [8, 4, 9, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004909", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 72, 'e': 96, 'a': 91}) == {72: 'c', 96: 'e', 91: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 72, 'e': 96, 'a': 91}) == {72: 'c', 96: 'e', 91: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004910", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([20, 18, 7, 7, 15, 15]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 18, 7, 7, 15, 15]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004911", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([2, 8]) == [2, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([2, 8]) == [2, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004912", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(53, 17) == 901\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(53, 17) == 901\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004913", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(17, 9) == 153\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 9) == 153\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004914", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([12, 5, 27, 17, 29, 48, 8, 16]) == [5, 8, 12, 16, 17, 27, 29, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([12, 5, 27, 17, 29, 48, 8, 16]) == [5, 8, 12, 16, 17, 27, 29, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004915", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 3, 6, 2, 5, 9, 2, 8, 3, 1], 10) == [0, 3, 6, 2, 5, 9, 2, 8, 3, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 3, 6, 2, 5, 9, 2, 8, 3, 1], 10) == [0, 3, 6, 2, 5, 9, 2, 8, 3, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004916", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([42, 4, 10, 23, 2, 19, 5, 6]) == [2, 4, 5, 6, 10, 19, 23, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 4, 10, 23, 2, 19, 5, 6]) == [2, 4, 5, 6, 10, 19, 23, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004917", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(186, 110) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(186, 110) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004918", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('ededegbf ebdecdd') == 'ededegbf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ededegbf ebdecdd') == 'ededegbf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004919", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([31, 42, 9, 29]) == [9, 29, 31, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([31, 42, 9, 29]) == [9, 29, 31, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004920", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('bbab,ab,de,cead,cc') == ['bbab', 'ab', 'de', 'cead', 'cc']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bbab,ab,de,cead,cc') == ['bbab', 'ab', 'de', 'cead', 'cc']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004921", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, 5, -4], [-1, 6, 9], [2, 1, -7]], [[2, 3, -3], [4, 8, -5], [7, 0, -7]]) == [[10, 8, -7], [3, 14, 4], [9, 1, -14]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 5, -4], [-1, 6, 9], [2, 1, -7]], [[2, 3, -3], [4, 8, -5], [7, 0, -7]]) == [[10, 8, -7], [3, 14, 4], [9, 1, -14]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004922", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([40, 4, 24, 39, 48, 19]) == [4, 19, 24, 39, 40, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([40, 4, 24, 39, 48, 19]) == [4, 19, 24, 39, 40, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004923", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('3h50m12s') == 13812\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h50m12s') == 13812\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004924", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'b': 1, 'c': 4, 'd': 9, 'e': 10}, 4) == {'d': 9, 'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 1, 'c': 4, 'd': 9, 'e': 10}, 4) == {'d': 9, 'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004925", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(94) == [2, 47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(94) == [2, 47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004926", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(60) == 19\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(60) == 19\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004927", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([7, 2, 2, 7, 2, 7, 8, 5], [7, 1, 7]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 2, 2, 7, 2, 7, 8, 5], [7, 1, 7]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004928", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('cabbaabbac') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cabbaabbac') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004929", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(651) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(651) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004930", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'cherry', 'cherry', 'date']) == {'c': ['cherry', 'cherry', 'cherry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'cherry', 'cherry', 'date']) == {'c': ['cherry', 'cherry', 'cherry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004931", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(564) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(564) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004932", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 2, 2, 5, 4, 1, 1]) == [2, 5, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 2, 5, 4, 1, 1]) == [2, 5, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004933", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('cxbxbycz') == 'zcybxbxc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cxbxbycz') == 'zcybxbxc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004934", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('}(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004935", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([12, 8, 45]) == [8, 12, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([12, 8, 45]) == [8, 12, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004936", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('{}()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004937", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(792) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(792) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004938", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('dea', 'deac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dea', 'deac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004939", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('bffbad', 'baffbd') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bffbad', 'baffbd') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004940", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('})(({]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('})(({]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004941", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([27, 50, 23, 2]) == [2, 23, 27, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 50, 23, 2]) == [2, 23, 27, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004942", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(1900) == 'MCM'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1900) == 'MCM'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004943", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([48, 14, 15, 12, 27]) == [12, 14, 15, 27, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([48, 14, 15, 12, 27]) == [12, 14, 15, 27, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004944", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(17, 24) == 408\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 24) == 408\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004945", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=379; port=786') == {'host': '379', 'port': '786'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=379; port=786') == {'host': '379', 'port': '786'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004946", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-7, 0, 5, -8], [-2, -3, 7, 6], [-3, 1, 7, -7]], [[5, -7, 2, 6], [-5, 6, -7, 5], [5, 4, -3, 7]]) == [[-2, -7, 7, -2], [-7, 3, 0, 11], [2, 5, 4, 0]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 0, 5, -8], [-2, -3, 7, 6], [-3, 1, 7, -7]], [[5, -7, 2, 6], [-5, 6, -7, 5], [5, 4, -3, 7]]) == [[-2, -7, 7, -2], [-7, 3, 0, 11], [2, 5, 4, 0]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004947", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([2, 15, 10, 7, 0, 6]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 15, 10, 7, 0, 6]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004948", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 1, 3], [3, 1, 5]], [[1, 3, 3], [3, 3, 0], [3, 3, 2]]) == [[15, 21, 15], [21, 27, 19]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1, 3], [3, 1, 5]], [[1, 3, 3], [3, 3, 0], [3, 3, 2]]) == [[15, 21, 15], [21, 27, 19]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004949", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(585) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(585) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004950", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('c,cb,79,43,95') == ['c', 'cb', '79', '43', '95']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,cb,79,43,95') == ['c', 'cb', '79', '43', '95']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004951", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(33, 32) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 32) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004952", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'e': 2, 'c': 1, 'b': 5}, 5) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 2, 'c': 1, 'b': 5}, 5) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004953", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 22) == 'wxy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 22) == 'wxy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004954", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 3, 'e': 4}, 4) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 3, 'e': 4}, 4) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004955", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=114; port=off') == {'user': '114', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=114; port=off') == {'user': '114', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004956", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(973896) == 986\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(973896) == 986\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004957", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(57); s.push(6); s.push(15)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(57); s.push(6); s.push(15)\nassert s.peek() == 15\nassert s.pop() == 15\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 57\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004958", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(71); s.push(73); s.push(91)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(71); s.push(73); s.push(91)\nassert s.peek() == 91\nassert s.pop() == 91\nassert s.pop() == 73\nassert s.is_empty() == False\nassert s.pop() == 71\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004959", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(3127) == 55\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3127) == 55\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004960", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['acbxxy', 'acbz', 'acbzz', 'acb']) == 'acb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acbxxy', 'acbz', 'acbzz', 'acb']) == 'acb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004961", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('c,cb') == ['c', 'cb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,cb') == ['c', 'cb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004962", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(322)\nacc.deposit(63)\nacc.withdraw(218)\nacc.withdraw(429)\nassert acc.get_balance() == 385\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(322)\nacc.deposit(63)\nassert acc.get_balance() == 385\nacc.withdraw(218)\nassert acc.get_balance() == 167\nacc.withdraw(429)\nassert acc.get_balance() == 167\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_004963", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([0, 16, 6, 7, 6, 21]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 16, 6, 7, 6, 21]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004964", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 28, 'c': 40, 'a': 73}) == {28: 'f', 40: 'c', 73: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 28, 'c': 40, 'a': 73}) == {28: 'f', 40: 'c', 73: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004965", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(2, 10) == 1024\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 10) == 1024\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004966", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(5794) == 76\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5794) == 76\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004967", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(27, 37, 44) == 3\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(27, 37, 44) == 3\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004968", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([36, 11, 48, 33, 35, 43, 28]) == [11, 28, 33, 35, 36, 43, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 11, 48, 33, 35, 43, 28]) == [11, 28, 33, 35, 36, 43, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004969", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, 3, 7], [3, 7, 6]], [[7, 5, -4], [-3, -5, -8]]) == [[15, 8, 3], [0, 2, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 3, 7], [3, 7, 6]], [[7, 5, -4], [-3, -5, -8]]) == [[15, 8, 3], [0, 2, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004970", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 8, 6, 7, 4, 3, 5, 6, 6, 3, 5], 3) == [[5, 8, 6], [7, 4, 3], [5, 6, 6], [3, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 8, 6, 7, 4, 3, 5, 6, 6, 3, 5], 3) == [[5, 8, 6], [7, 4, 3], [5, 6, 6], [3, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004971", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(119) == [7, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(119) == [7, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_004972", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ozxukawb') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ozxukawb') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004973", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['x', '', 'yz']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['x', '', 'yz']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004974", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Dog dog the Ran sun ran, cat Cat sat.') == {'dog': 2, 'the': 1, 'ran': 2, 'sun': 1, 'cat': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog dog the Ran sun ran, cat Cat sat.') == {'dog': 2, 'the': 1, 'ran': 2, 'sun': 1, 'cat': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004975", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(411) == 'CDXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(411) == 'CDXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004976", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-2, -4, 4], [-3, 9, 4], [4, 6, 3]], [[8, 9, 7], [-4, -2, -2], [1, 9, -5]]) == [[6, 5, 11], [-7, 7, 2], [5, 15, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, -4, 4], [-3, 9, 4], [4, 6, 3]], [[8, 9, 7], [-4, -2, -2], [1, 9, -5]]) == [[6, 5, 11], [-7, 7, 2], [5, 15, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004977", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([16, 33, 69], 16) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 33, 69], 16) == 0\nassert binary_search([16, 33, 69], 16) == 0\nassert binary_search([16, 33, 69], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004978", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([50, 5]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, 5]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004979", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cadbb') == 'cadb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cadbb') == 'cadb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004980", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([34, 40, 19]) == [19, 34, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([34, 40, 19]) == [19, 34, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004981", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([5, [5, 5, 5, 3], [9, 9], [1, 1, 6, 1]]) == [5, 5, 5, 5, 3, 9, 9, 1, 1, 6, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [5, 5, 5, 3], [9, 9], [1, 1, 6, 1]]) == [5, 5, 5, 5, 3, 9, 9, 1, 1, 6, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004982", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aacabxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aacabxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004983", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(59, 16) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 16) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004984", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=off; mode=18; host=149') == {'path': 'off', 'mode': '18', 'host': '149'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; mode=18; host=149') == {'path': 'off', 'mode': '18', 'host': '149'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004985", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([7, 0, 6, 1], 2) == [[7, 0], [6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 0, 6, 1], 2) == [[7, 0], [6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004986", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 5, 6, 9, 2, 0], [1, 2, 9, 6, 4, 4]) == [6, 9, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 5, 6, 9, 2, 0], [1, 2, 9, 6, 4, 4]) == [6, 9, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004987", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('1h29m25s') == 5365\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h29m25s') == 5365\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004988", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(6926) == 83\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6926) == 83\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004989", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[7, 7, 5], [1, 2, 8], [2, 5, 5], [6, 8, 6]]) == [[7, 1, 2, 6], [7, 2, 5, 8], [5, 8, 5, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 7, 5], [1, 2, 8], [2, 5, 5], [6, 8, 6]]) == [[7, 1, 2, 6], [7, 2, 5, 8], [5, 8, 5, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004990", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([4, 4, -5, 9, 2, 2, 1, -7]) == [4, 8, 3, 12, 14, 16, 17, 10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([4, 4, -5, 9, 2, 2, 1, -7]) == [4, 8, 3, 12, 14, 16, 17, 10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004991", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-8, -3], [6, -7], [-4, 6]], [[8, 3], [6, -7], [7, -5]]) == [[0, 0], [12, -14], [3, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -3], [6, -7], [-4, 6]], [[8, 3], [6, -7], [7, -5]]) == [[0, 0], [12, -14], [3, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004992", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 6, 3, 0], [5, 7, 9, 5]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 6, 3, 0], [5, 7, 9, 5]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004993", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(172, 31) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(172, 31) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004994", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('32m53s') == 1973\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('32m53s') == 1973\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004995", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004996", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[9, 1], [2, 9]]) == [[9, 2], [1, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 1], [2, 9]]) == [[9, 2], [1, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004997", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['x', 'y', '', 'xyx']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['x', 'y', '', 'xyx']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_004998", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[1, 0, 6]], [[5], [2], [0, 0]], [9]]) == 23\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[1, 0, 6]], [[5], [2], [0, 0]], [9]]) == 23\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_004999", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(4737) == 7374\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4737) == 7374\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005000", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([44, 48, 6, 12, 4, 16, 23, 19, 25, 16, 20, 12, 21]) == [4, 6, 12, 12, 16, 16, 19, 20, 21, 23, 25, 44, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([44, 48, 6, 12, 4, 16, 23, 19, 25, 16, 20, 12, 21]) == [4, 6, 12, 12, 16, 16, 19, 20, 21, 23, 25, 44, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005001", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-8, 5, 5, 1, -1, -2, 4, 3]) == [-8, -3, 2, 3, 2, 0, 4, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, 5, 5, 1, -1, -2, 4, 3]) == [-8, -3, 2, 3, 2, 0, 4, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005002", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dabaea bbcdd') == 'Dabaea Bbcdd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dabaea bbcdd') == 'Dabaea Bbcdd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005003", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([10, 39, 36, 46, 34, 23, 21, 7]) == [7, 10, 21, 23, 34, 36, 39, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([10, 39, 36, 46, 34, 23, 21, 7]) == [7, 10, 21, 23, 34, 36, 39, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005004", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 4, 4, 1, 3, 5]) == [4, 1, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 4, 1, 3, 5]) == [4, 1, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005005", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([42, 56, 58, 96], 96) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([42, 56, 58, 96], 96) == 3\nassert binary_search([42, 56, 58, 96], 42) == 0\nassert binary_search([42, 56, 58, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005006", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('zzezyxczx') == 'xzcxyzezz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zzezyxczx') == 'xzcxyzezz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005007", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([36, 5, 5, 10, 0, 34]) == [0, 5, 5, 10, 34, 36]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([36, 5, 5, 10, 0, 34]) == [0, 5, 5, 10, 34, 36]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005008", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=97; port=495') == {'path': '97', 'port': '495'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=97; port=495') == {'path': '97', 'port': '495'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005009", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(2, 33) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(2, 33) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005010", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(2037) == 7302\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2037) == 7302\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005011", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([2, 7, 1, 8, 6, 4, 5], 6) == [7, 1, 8, 6, 4, 5, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 7, 1, 8, 6, 4, 5], 6) == [7, 1, 8, 6, 4, 5, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005012", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[6, 2, 1, 6], [4, 0, 3, 5], [3, 5, 2, 2], [0, 4, 5, 9]]) == [[6, 4, 3, 0], [2, 0, 5, 4], [1, 3, 2, 5], [6, 5, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 2, 1, 6], [4, 0, 3, 5], [3, 5, 2, 2], [0, 4, 5, 9]]) == [[6, 4, 3, 0], [2, 0, 5, 4], [1, 3, 2, 5], [6, 5, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005013", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('3h45m11s') == 13511\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h45m11s') == 13511\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005014", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([5, [5, 9, 0, 5], [5, 1, 2, 5], 5]) == [5, 5, 9, 0, 5, 5, 1, 2, 5, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [5, 9, 0, 5], [5, 1, 2, 5], 5]) == [5, 5, 9, 0, 5, 5, 1, 2, 5, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005015", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 4, 8, 2, 2, 7, 9, 8, 3, 5], 3) == [8, 3, 5, 1, 4, 8, 2, 2, 7, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 4, 8, 2, 2, 7, 9, 8, 3, 5], 3) == [8, 3, 5, 1, 4, 8, 2, 2, 7, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005016", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('dcfb', 'dcfbd') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dcfb', 'dcfbd') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005017", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('mvibxq') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('mvibxq') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005018", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([21, 21, 12, 21, 25]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 21, 12, 21, 25]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005019", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('bbbbbb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbbbbb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005020", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[7, 1, 3, 5], 7, 3]) == [7, 1, 3, 5, 7, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 1, 3, 5], 7, 3]) == [7, 1, 3, 5, 7, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005021", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the the, sat the') == {'the': 3, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the, sat the') == {'the': 3, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005022", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-2, 7], [-7, 0]], [[-6, 3], [-4, -9]]) == [[-8, 10], [-11, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, 7], [-7, 0]], [[-6, 3], [-4, -9]]) == [[-8, 10], [-11, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005023", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 2, 8, 7], 3) == [[0, 2, 8], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 2, 8, 7], 3) == [[0, 2, 8], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005024", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ceecbeebebcde') == 'cebd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceecbeebebcde') == 'cebd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005025", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 4, 1, 0, 5]) == [5, 4, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 1, 0, 5]) == [5, 4, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005026", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['b', 'bx', 'byxx']) == 'b'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['b', 'bx', 'byxx']) == 'b'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005027", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 5, 'e': 6, 'b': 8}, 6) == {'b': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 5, 'e': 6, 'b': 8}, 6) == {'b': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005028", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 65, 'e': 73}) == {65: 'd', 73: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 65, 'e': 73}) == {65: 'd', 73: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005029", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([7, 42, 6, 9, 43, 5, 25, 26, 0, 47, 31, 26]) == [0, 5, 6, 7, 9, 25, 26, 26, 31, 42, 43, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([7, 42, 6, 9, 43, 5, 25, 26, 0, 47, 31, 26]) == [0, 5, 6, 7, 9, 25, 26, 26, 31, 42, 43, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005030", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-12, 4, 19]) == 11\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-12, 4, 19]) == 11\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005031", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=off; path=433; mode=799') == {'port': 'off', 'path': '433', 'mode': '799'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; path=433; mode=799') == {'port': 'off', 'path': '433', 'mode': '799'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005032", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXIV') == 264\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXIV') == 264\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005033", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 5, 1, 2, 2, 3, 5, 0, 1]) == [0, 5, 1, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 1, 2, 2, 3, 5, 0, 1]) == [0, 5, 1, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005034", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(245) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(245) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005035", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(512) == 22\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(512) == 22\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005036", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(626946) == 791\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(626946) == 791\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005037", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(72); s.push(41); s.push(22)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(72); s.push(41); s.push(22)\nassert s.peek() == 22\nassert s.pop() == 22\nassert s.pop() == 41\nassert s.is_empty() == False\nassert s.pop() == 72\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005038", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(37)\nacc.deposit(66)\nacc.withdraw(74)\nacc.withdraw(205)\nassert acc.get_balance() == 103\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(37)\nacc.deposit(66)\nassert acc.get_balance() == 103\nacc.withdraw(74)\nassert acc.get_balance() == 29\nacc.withdraw(205)\nassert acc.get_balance() == 29\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005039", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(289) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(289) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005040", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([8, 2, 3, 1, 3, 9, 8], 4) == [1, 3, 9, 8, 8, 2, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 2, 3, 1, 3, 9, 8], 4) == [1, 3, 9, 8, 8, 2, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005041", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('5h25m31s') == 19531\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h25m31s') == 19531\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005042", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([5, 1, 7, 5, -5, -2, -5, -3]) == [5, 6, 13, 18, 13, 11, 6, 3]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([5, 1, 7, 5, -5, -2, -5, -3]) == [5, 6, 13, 18, 13, 11, 6, 3]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005043", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=on; port=683; host=auto; user=957') == {'path': 'on', 'port': '683', 'host': 'auto', 'user': '957'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; port=683; host=auto; user=957') == {'path': 'on', 'port': '683', 'host': 'auto', 'user': '957'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005044", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(70); s.push(29); s.push(63)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(70); s.push(29); s.push(63)\nassert s.peek() == 63\nassert s.pop() == 63\nassert s.pop() == 29\nassert s.is_empty() == False\nassert s.pop() == 70\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005045", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 1, 0, 1]) == [2, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 0, 1]) == [2, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005046", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(83) == 'LXXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(83) == 'LXXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005047", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(2403) == 9\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2403) == 9\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005048", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CXXI') == 121\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXI') == 121\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005049", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(43, 18) == 774\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(43, 18) == 774\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005050", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(25); s.push(12); s.push(48)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(25); s.push(12); s.push(48)\nassert s.peek() == 48\nassert s.pop() == 48\nassert s.pop() == 12\nassert s.is_empty() == False\nassert s.pop() == 25\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005051", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(13, 42) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(13, 42) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005052", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(40) == 8\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(40) == 8\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005053", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 18, 'e': 11, 'a': 2, 'c': 40}) == {18: 'd', 11: 'e', 2: 'a', 40: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 18, 'e': 11, 'a': 2, 'c': 40}) == {18: 'd', 11: 'e', 2: 'a', 40: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005054", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['apple', 'coconut', 'cherry', 'date', 'date', 'banana']) == {'a': ['apple'], 'c': ['coconut', 'cherry'], 'd': ['date', 'date'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'coconut', 'cherry', 'date', 'date', 'banana']) == {'a': ['apple'], 'c': ['coconut', 'cherry'], 'd': ['date', 'date'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005055", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('cizkeay') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('cizkeay') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005056", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ccddccaaabbaaaaaaaaa') == 'c2d2c2a3b2a9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccddccaaabbaaaaaaaaa') == 'c2d2c2a3b2a9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005057", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('ysygu') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ysygu') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005058", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(7153) == 3517\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7153) == 3517\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005059", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['az', 'ayy']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['az', 'ayy']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005060", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[6, 4], 7, 3]) == [6, 4, 7, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[6, 4], 7, 3]) == [6, 4, 7, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005061", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-3, 0, -8, 1], [-8, -6, -1, -5], [1, -3, -2, -8]], [[-7, -8, -4, -5], [-5, 1, 8, -6], [-5, 1, -3, -9]]) == [[-10, -8, -12, -4], [-13, -5, 7, -11], [-4, -2, -5, -17]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 0, -8, 1], [-8, -6, -1, -5], [1, -3, -2, -8]], [[-7, -8, -4, -5], [-5, 1, 8, -6], [-5, 1, -3, -9]]) == [[-10, -8, -12, -4], [-13, -5, 7, -11], [-4, -2, -5, -17]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005062", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([34, -43, 4, 25, -28, -34]) == 34\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([34, -43, 4, 25, -28, -34]) == 34\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005063", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(54, 37) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(54, 37) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005064", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(33, 28) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 28) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005065", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bbcbbxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbcbbxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005066", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(3, 12) == 12\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(3, 12) == 12\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005067", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(2, 13) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(2, 13) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005068", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([24, 3, 8, 24]) == 8\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([24, 3, 8, 24]) == 8\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005069", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(173, 184) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(173, 184) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005070", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([2, 27, 37, 52, 63, 79, 81], 157) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 27, 37, 52, 63, 79, 81], 157) == -1\nassert binary_search([2, 27, 37, 52, 63, 79, 81], 2) == 0\nassert binary_search([2, 27, 37, 52, 63, 79, 81], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005071", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([17, 17], [1, 3, 7, 9, 11, 18, 19]) == [1, 3, 7, 9, 11, 17, 17, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([17, 17], [1, 3, 7, 9, 11, 18, 19]) == [1, 3, 7, 9, 11, 17, 17, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005072", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(7875) == 5787\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7875) == 5787\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005073", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 65, 'd': 81, 'e': 73, 'f': 40}) == {65: 'a', 81: 'd', 73: 'e', 40: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 65, 'd': 81, 'e': 73, 'f': 40}) == {65: 'a', 81: 'd', 73: 'e', 40: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005074", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 7, 7, 9, 9, 9, 8, 9, 9, 9, 9, 1], 5) == [[0, 7, 7, 9, 9], [9, 8, 9, 9, 9], [9, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 7, 7, 9, 9, 9, 8, 9, 9, 9, 9, 1], 5) == [[0, 7, 7, 9, 9], [9, 8, 9, 9, 9], [9, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005075", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('e,d,bbd,bb') == ['e', 'd', 'bbd', 'bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('e,d,bbd,bb') == ['e', 'd', 'bbd', 'bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005076", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([26, 9, 9, 26, 22, 16, 0]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 9, 9, 26, 22, 16, 0]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005077", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-3, 1, 9]) == [-3, -2, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-3, 1, 9]) == [-3, -2, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005078", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2295) == 'MMCCXCV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2295) == 'MMCCXCV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005079", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(74) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(74) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005080", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([1, 18, 19, 31, 34, 66, 84, 90, 93, 94], 160) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 18, 19, 31, 34, 66, 84, 90, 93, 94], 160) == -1\nassert binary_search([1, 18, 19, 31, 34, 66, 84, 90, 93, 94], 1) == 0\nassert binary_search([1, 18, 19, 31, 34, 66, 84, 90, 93, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005081", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['c', 'e', 'c', 'd']) == {'c': 2, 'e': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'e', 'c', 'd']) == {'c': 2, 'e': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005082", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('acdbdcdbaece') == 'acdbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acdbdcdbaece') == 'acdbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005083", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([2, 4, 6, 8, 38, 42, 46, 66, 78, 85, 99], 158) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 4, 6, 8, 38, 42, 46, 66, 78, 85, 99], 158) == -1\nassert binary_search([2, 4, 6, 8, 38, 42, 46, 66, 78, 85, 99], 2) == 0\nassert binary_search([2, 4, 6, 8, 38, 42, 46, 66, 78, 85, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005084", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(286501) == 535\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(286501) == 535\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005085", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[2, 3, 5], [0, 2, 3]], [[0, 5, 1], [2, 0, 1], [1, 2, 0]]) == [[11, 20, 5], [7, 6, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 3, 5], [0, 2, 3]], [[0, 5, 1], [2, 0, 1], [1, 2, 0]]) == [[11, 20, 5], [7, 6, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005086", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(326)\nacc.deposit(52)\nacc.withdraw(326)\nacc.withdraw(480)\nassert acc.get_balance() == 378\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(326)\nacc.deposit(52)\nassert acc.get_balance() == 378\nacc.withdraw(326)\nassert acc.get_balance() == 52\nacc.withdraw(480)\nassert acc.get_balance() == 52\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005087", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(5, 5) == 3125\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 5) == 3125\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005088", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[7, 8], [5, 9]], [[9, 4], [6, 6]]) == [[16, 12], [11, 15]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 8], [5, 9]], [[9, 4], [6, 6]]) == [[16, 12], [11, 15]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005089", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'd', 'b', 'e', 'e']) == {'e': 3, 'd': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'd', 'b', 'e', 'e']) == {'e': 3, 'd': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005090", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat sun sat sun cat! sun the ran ran,') == {'sat': 2, 'sun': 3, 'cat': 1, 'the': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun sat sun cat! sun the ran ran,') == {'sat': 2, 'sun': 3, 'cat': 1, 'the': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005091", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 6, 1, 7, 7], 1) == [7, 6, 6, 1, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 6, 1, 7, 7], 1) == [7, 6, 6, 1, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005092", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'berry', 'coconut', 'apple', 'date', 'date', 'avocado', 'banana']) == {'a': ['apple', 'apple', 'avocado'], 'b': ['berry', 'banana'], 'c': ['coconut'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'berry', 'coconut', 'apple', 'date', 'date', 'avocado', 'banana']) == {'a': ['apple', 'apple', 'avocado'], 'b': ['berry', 'banana'], 'c': ['coconut'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005093", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('World', 6) == 'Cuxrj'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World', 6) == 'Cuxrj'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005094", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=916; mode=354; port=540') == {'path': '916', 'mode': '354', 'port': '540'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=916; mode=354; port=540') == {'path': '916', 'mode': '354', 'port': '540'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005095", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(5896) == 76\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5896) == 76\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005096", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-2, -9, 20]) == 9\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-2, -9, 20]) == 9\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005097", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(85) == [5, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(85) == [5, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005098", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([34, 39, 12, 39, 11, 46, 49]) == [11, 12, 34, 39, 39, 46, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 39, 12, 39, 11, 46, 49]) == [11, 12, 34, 39, 39, 46, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005099", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([21, 29, 74, 83, 84], 29) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([21, 29, 74, 83, 84], 29) == 1\nassert binary_search([21, 29, 74, 83, 84], 21) == 0\nassert binary_search([21, 29, 74, 83, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005100", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 7], [4]) == [1, 4, 7]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 7], [4]) == [1, 4, 7]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005101", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([9, -16, -9, -9]) == -25\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([9, -16, -9, -9]) == -25\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005102", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(19, 132, 803) == 64\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 132, 803) == 64\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005103", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(4); s.push(91); s.push(72)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(4); s.push(91); s.push(72)\nassert s.peek() == 72\nassert s.pop() == 72\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 4\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005104", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[0, -1], [-3, 0]], [[5, -4], [-1, -2]]) == [[5, -5], [-4, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -1], [-3, 0]], [[5, -4], [-1, -2]]) == [[5, -5], [-4, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005105", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Ran dog sun dog, the the dog sat dog. cat,') == {'ran': 1, 'dog': 4, 'sun': 1, 'the': 2, 'sat': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran dog sun dog, the the dog sat dog. cat,') == {'ran': 1, 'dog': 4, 'sun': 1, 'the': 2, 'sat': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005106", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([1, 21, 20, 14, 29, 5, 17, 3]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([1, 21, 20, 14, 29, 5, 17, 3]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005107", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(999) == 31\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(999) == 31\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005108", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaaaaaaaaaaabbb') == 'a13b3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaaaaabbb') == 'a13b3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005109", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abbcccbbcbcabbc', 'cacb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbcccbbcbcabbc', 'cacb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005110", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(272) == 16\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(272) == 16\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005111", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([17, 8, 43, 41, 50, 23, 0, 13]) == [0, 8, 13, 17, 23, 41, 43, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([17, 8, 43, 41, 50, 23, 0, 13]) == [0, 8, 13, 17, 23, 41, 43, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005112", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3577) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3577) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005113", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h16m47s') == 4607\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h16m47s') == 4607\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005114", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[0, 5], [3, 2]], [[3, 5], [2, 0]]) == [[10, 0], [13, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 5], [3, 2]], [[3, 5], [2, 0]]) == [[10, 0], [13, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005115", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([3, 3, [8, 7, 7, 9], [6, 5], [5]]) == [3, 3, 8, 7, 7, 9, 6, 5, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, 3, [8, 7, 7, 9], [6, 5], [5]]) == [3, 3, 8, 7, 7, 9, 6, 5, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005116", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=691; mode=on; port=auto') == {'path': '691', 'mode': 'on', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=691; mode=on; port=auto') == {'path': '691', 'mode': 'on', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005117", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(14 * 3 + 7)') == 49\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(14 * 3 + 7)') == 49\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005118", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-7, 8, -9, -8], [-4, 8, 0, 1]], [[8, -4, 7, 4], [8, -3, 0, -2]]) == [[1, 4, -2, -4], [4, 5, 0, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 8, -9, -8], [-4, 8, 0, 1]], [[8, -4, 7, 4], [8, -3, 0, -2]]) == [[1, 4, -2, -4], [4, 5, 0, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005119", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(62); s.push(25); s.push(3)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(62); s.push(25); s.push(3)\nassert s.peek() == 3\nassert s.pop() == 3\nassert s.pop() == 25\nassert s.is_empty() == False\nassert s.pop() == 62\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005120", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(90) == 'XC'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(90) == 'XC'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005121", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(898514) == 947\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(898514) == 947\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005122", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=on; host=875; path=off') == {'port': 'on', 'host': '875', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; host=875; path=off') == {'port': 'on', 'host': '875', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005123", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(19) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(19) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005124", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(8165) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8165) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005125", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'apple', 'coconut', 'coconut', 'date', 'date']) == {'a': ['avocado', 'apple'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'apple', 'coconut', 'coconut', 'date', 'date']) == {'a': ['avocado', 'apple'], 'c': ['coconut', 'coconut'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005126", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([34, 30, 29, 4, 46, 2, 12, 46, 45, 5, 2, 33, 30]) == [2, 2, 4, 5, 12, 29, 30, 30, 33, 34, 45, 46, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([34, 30, 29, 4, 46, 2, 12, 46, 45, 5, 2, 33, 30]) == [2, 2, 4, 5, 12, 29, 30, 30, 33, 34, 45, 46, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005127", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[4, -8], [-2, -7], [3, 5], [6, -4]], [[9, 8], [3, -6], [0, -3], [-1, -1]]) == [[13, 0], [1, -13], [3, 2], [5, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, -8], [-2, -7], [3, 5], [6, -4]], [[9, 8], [3, -6], [0, -3], [-1, -1]]) == [[13, 0], [1, -13], [3, 2], [5, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005128", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 9) == 'ghi'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 9) == 'ghi'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005129", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 57, 'a': 95, 'c': 82, 'e': 48}) == {57: 'f', 95: 'a', 82: 'c', 48: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 57, 'a': 95, 'c': 82, 'e': 48}) == {57: 'f', 95: 'a', 82: 'c', 48: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005130", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([3, 3, 8, 9, 6, 6, 5, 5, 5, 7, 4], 2) == [[3, 3], [8, 9], [6, 6], [5, 5], [5, 7], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 3, 8, 9, 6, 6, 5, 5, 5, 7, 4], 2) == [[3, 3], [8, 9], [6, 6], [5, 5], [5, 7], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005131", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('{{a{{[]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{{a{{[]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005132", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([31, 49, 25, 46, 30, 25, 36]) == [25, 25, 30, 31, 36, 46, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 49, 25, 46, 30, 25, 36]) == [25, 25, 30, 31, 36, 46, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005133", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(6, 50) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(6, 50) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005134", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 14, 27, 49, 52, 53, 62, 80], 62) == 6\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 14, 27, 49, 52, 53, 62, 80], 62) == 6\nassert binary_search([4, 14, 27, 49, 52, 53, 62, 80], 4) == 0\nassert binary_search([4, 14, 27, 49, 52, 53, 62, 80], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005135", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([9, -8, -16, -16, 12, 1]) == -18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([9, -8, -16, -16, 12, 1]) == -18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005136", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(34); s.push(11); s.push(43)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(34); s.push(11); s.push(43)\nassert s.peek() == 43\nassert s.pop() == 43\nassert s.pop() == 11\nassert s.is_empty() == False\nassert s.pop() == 34\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005137", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(46, 20) == 460\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(46, 20) == 460\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005138", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('Ran sun ran Sun ran') == {'ran': 3, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran sun ran Sun ran') == {'ran': 3, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005139", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('()[]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()[]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005140", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([25, 2, 45]) == [2, 25, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([25, 2, 45]) == [2, 25, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005141", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'date', 'berry', 'banana', 'apple', 'apple']) == {'c': ['cherry'], 'a': ['avocado', 'apple', 'apple'], 'd': ['date'], 'b': ['berry', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'date', 'berry', 'banana', 'apple', 'apple']) == {'c': ['cherry'], 'a': ['avocado', 'apple', 'apple'], 'd': ['date'], 'b': ['berry', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005142", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h36m48s') == 9408\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h36m48s') == 9408\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005143", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(60, 11) == 660\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(60, 11) == 660\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005144", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([46, 35, 33, 30, 38, 23, 31, 28]) == [23, 28, 30, 31, 33, 35, 38, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 35, 33, 30, 38, 23, 31, 28]) == [23, 28, 30, 31, 33, 35, 38, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005145", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h42m25s') == 20545\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h42m25s') == 20545\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005146", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat cat. ran sun! sat dog the! sat ran the.') == {'sat': 3, 'cat': 1, 'ran': 2, 'sun': 1, 'dog': 1, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat cat. ran sun! sat dog the! sat ran the.') == {'sat': 3, 'cat': 1, 'ran': 2, 'sun': 1, 'dog': 1, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005147", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'date', 'date', 'date', 'coconut', 'coconut']) == {'c': ['coconut', 'coconut', 'coconut'], 'b': ['berry'], 'd': ['date', 'date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'date', 'date', 'date', 'coconut', 'coconut']) == {'c': ['coconut', 'coconut', 'coconut'], 'b': ['berry'], 'd': ['date', 'date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005148", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([34, 1, 40, 35, 44]) == [1, 34, 35, 40, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 1, 40, 35, 44]) == [1, 34, 35, 40, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005149", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(20, 3) == 60\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(20, 3) == 60\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005150", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(1579) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1579) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005151", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([7, 18, 47, 8, 47, 25]) == [7, 8, 18, 25, 47, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 18, 47, 8, 47, 25]) == [7, 8, 18, 25, 47, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005152", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(12, 169, 640) == 512\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(12, 169, 640) == 512\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005153", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CDLXXX') == 480\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXXX') == 480\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005154", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([45, 44, 10, 27, 18]) == [10, 18, 27, 44, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([45, 44, 10, 27, 18]) == [10, 18, 27, 44, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005155", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(5147) == 71\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5147) == 71\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005156", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(11, 31, 702) == 587\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(11, 31, 702) == 587\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005157", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('bababb', 'aaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bababb', 'aaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005158", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaabbddcccc') == 'a3b2d2c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaabbddcccc') == 'a3b2d2c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005159", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abababbbbbabb', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abababbbbbabb', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005160", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([9, [2, 5, 5, 5], 7, [0, 5], 2]) == [9, 2, 5, 5, 5, 7, 0, 5, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [2, 5, 5, 5], 7, [0, 5], 2]) == [9, 2, 5, 5, 5, 7, 0, 5, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005161", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(18, 22) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(18, 22) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005162", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaaaccccccccdddddaaaacccc') == 'a4c8d5a4c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaccccccccdddddaaaacccc') == 'a4c8d5a4c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005163", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 7, 1], [9, 8, 7, 7, 8]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 7, 1], [9, 8, 7, 7, 8]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005164", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 8, 'x': 8, 'y': 7}, {'x': 6, 'z': 7}) == {'w': 8, 'x': 14, 'y': 7, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 8, 'x': 8, 'y': 7}, {'x': 6, 'z': 7}) == {'w': 8, 'x': 14, 'y': 7, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005165", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('baababababa', 'ba') == 5\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baababababa', 'ba') == 5\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005166", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-9, 2, 8], [4, -7, -1], [-8, 7, -9]], [[0, -1, 8], [6, -5, 8], [1, 1, -9]]) == [[-9, 1, 16], [10, -12, 7], [-7, 8, -18]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 2, 8], [4, -7, -1], [-8, 7, -9]], [[0, -1, 8], [6, -5, 8], [1, 1, -9]]) == [[-9, 1, 16], [10, -12, 7], [-7, 8, -18]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005167", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h53m30s') == 10410\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h53m30s') == 10410\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005168", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(52) == 11\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(52) == 11\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005169", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('ptbxyhi') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ptbxyhi') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005170", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2426) == 'MMCDXXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2426) == 'MMCDXXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005171", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('hoqzacqdvhlmo') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hoqzacqdvhlmo') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005172", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['bx', 'b', 'byyx']) == 'b'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bx', 'b', 'byyx']) == 'b'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005173", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(17, 55) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(17, 55) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005174", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(214) == 101\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(214) == 101\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005175", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[4, 0, 7, 0], [2, 0, 7, 2], [8, 2, 9, 9]]) == [[4, 2, 8], [0, 0, 2], [7, 7, 9], [0, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 0, 7, 0], [2, 0, 7, 2], [8, 2, 9, 9]]) == [[4, 2, 8], [0, 0, 2], [7, 7, 9], [0, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005176", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(7192) == 2917\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7192) == 2917\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005177", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[5], [1, 2], [6]]]) == 14\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[5], [1, 2], [6]]]) == 14\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005178", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('hagcfd ag gcb fghbecd fahd hcdg') == 'fghbecd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hagcfd ag gcb fghbecd fahd hcdg') == 'fghbecd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005179", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(6 + 5 - 10)') == 1\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(6 + 5 - 10)') == 1\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005180", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('cccaaaaacc') == 'c3a5c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccaaaaacc') == 'c3a5c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005181", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(291) == 'CCXCI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(291) == 'CCXCI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005182", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 18, 'f': 67, 'd': 86, 'c': 6}) == {18: 'e', 67: 'f', 86: 'd', 6: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 18, 'f': 67, 'd': 86, 'c': 6}) == {18: 'e', 67: 'f', 86: 'd', 6: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005183", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 8}, {'w': 2, 'y': 2}) == {'y': 10, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8}, {'w': 2, 'y': 2}) == {'y': 10, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005184", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(98) == 'XCVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(98) == 'XCVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005185", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('abfaaad', 'abfdaaa') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('abfaaad', 'abfdaaa') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005186", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('The Sat dog dog dog! the Ran dog dog') == {'the': 2, 'sat': 1, 'dog': 5, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The Sat dog dog dog! the Ran dog dog') == {'the': 2, 'sat': 1, 'dog': 5, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005187", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([3, 6, 0, 0, 9, 3, 5], 5) == [0, 0, 9, 3, 5, 3, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 6, 0, 0, 9, 3, 5], 5) == [0, 0, 9, 3, 5, 3, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005188", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'avocado', 'banana', 'coconut', 'berry', 'berry']) == {'b': ['berry', 'banana', 'berry', 'berry'], 'c': ['coconut', 'coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'avocado', 'banana', 'coconut', 'berry', 'berry']) == {'b': ['berry', 'banana', 'berry', 'berry'], 'c': ['coconut', 'coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005189", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('dddddaaaaaaaaadddddbb') == 'd5a9d5b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddaaaaaaaaadddddbb') == 'd5a9d5b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005190", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-5, -5], [-7, -4]], [[2, 4], [3, 7]]) == [[-3, -1], [-4, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -5], [-7, -4]], [[2, 4], [3, 7]]) == [[-3, -1], [-4, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005191", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([4, 38, 21, 49, 13, 50, 24, 16, 22, 16]) == [4, 13, 16, 16, 21, 22, 24, 38, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 38, 21, 49, 13, 50, 24, 16, 22, 16]) == [4, 13, 16, 16, 21, 22, 24, 38, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005192", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('c,ec') == ['c', 'ec']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,ec') == ['c', 'ec']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005193", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([22, 18, 24, 1, 28, 18, 11, 22]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 18, 24, 1, 28, 18, 11, 22]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005194", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(444)\nacc.deposit(17)\nacc.withdraw(69)\nacc.withdraw(515)\nassert acc.get_balance() == 461\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(444)\nacc.deposit(17)\nassert acc.get_balance() == 461\nacc.withdraw(69)\nassert acc.get_balance() == 392\nacc.withdraw(515)\nassert acc.get_balance() == 392\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005195", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bccaaaabaaabc', 'bc') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bccaaaabaaabc', 'bc') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005196", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 1, 1, 1, 1, 4, 4, 1]) == [5, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 1, 1, 1, 4, 4, 1]) == [5, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005197", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(24) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(24) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005198", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(958) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(958) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005199", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('eabee', 'eabeec') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('eabee', 'eabeec') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005200", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog cat Sat ran! sun.') == {'dog': 1, 'cat': 1, 'sat': 1, 'ran': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog cat Sat ran! sun.') == {'dog': 1, 'cat': 1, 'sat': 1, 'ran': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005201", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(35); s.push(38); s.push(45)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(35); s.push(38); s.push(45)\nassert s.peek() == 45\nassert s.pop() == 45\nassert s.pop() == 38\nassert s.is_empty() == False\nassert s.pop() == 35\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005202", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([38, 42, 21, 39, 2, 47, 47]) == [2, 21, 38, 39, 42, 47, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([38, 42, 21, 39, 2, 47, 47]) == [2, 21, 38, 39, 42, 47, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005203", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(4572) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4572) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005204", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('LXXXI') == 81\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXXXI') == 81\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005205", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'date', 'apple', 'apple', 'apple', 'date', 'banana']) == {'c': ['coconut'], 'b': ['banana', 'banana'], 'd': ['date', 'date'], 'a': ['apple', 'apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'date', 'apple', 'apple', 'apple', 'date', 'banana']) == {'c': ['coconut'], 'b': ['banana', 'banana'], 'd': ['date', 'date'], 'a': ['apple', 'apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005206", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(108) == [2, 2, 3, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(108) == [2, 2, 3, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005207", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([8, 2, 8, 8, 6, 2, 9], [5, 6, 6, 8, 5]) == [8, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 2, 8, 8, 6, 2, 9], [5, 6, 6, 8, 5]) == [8, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005208", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(15, 56, 13) == 9\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(15, 56, 13) == 9\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005209", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[5, 3], [3, 3], [5, 3]], [[2, 2, 2], [4, 4, 5]]) == [[22, 22, 25], [18, 18, 21], [22, 22, 25]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3], [3, 3], [5, 3]], [[2, 2, 2], [4, 4, 5]]) == [[22, 22, 25], [18, 18, 21], [22, 22, 25]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005210", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(94) == [2, 47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(94) == [2, 47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005211", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([15, 0, 15, 22, 17, 20, 17]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 0, 15, 22, 17, 20, 17]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005212", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('cccccbbbbbbbbb') == 'c5b9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccbbbbbbbbb') == 'c5b9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005213", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([30, 50, 28, 33]) == [28, 30, 33, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 50, 28, 33]) == [28, 30, 33, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005214", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 4, 0, 0, 2]) == [1, 4, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 0, 0, 2]) == [1, 4, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005215", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 11, 'f': 50, 'd': 67, 'b': 21, 'a': 72}) == {11: 'c', 50: 'f', 67: 'd', 21: 'b', 72: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 11, 'f': 50, 'd': 67, 'b': 21, 'a': 72}) == {11: 'c', 50: 'f', 67: 'd', 21: 'b', 72: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005216", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('babbaaa', 'bab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbaaa', 'bab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005217", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('ddc,69,\"a,a\",61') == ['ddc', '69', 'a,a', '61']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ddc,69,\"a,a\",61') == ['ddc', '69', 'a,a', '61']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005218", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('d dee cdbea') == 'D Dee Cdbea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('d dee cdbea') == 'D Dee Cdbea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005219", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([6, 46, 15, 48, 46, 10, 36, 49, 28]) == [6, 10, 15, 28, 36, 46, 46, 48, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([6, 46, 15, 48, 46, 10, 36, 49, 28]) == [6, 10, 15, 28, 36, 46, 46, 48, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005220", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[5, 5], 8, 0]) == [5, 5, 8, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 5], 8, 0]) == [5, 5, 8, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005221", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(2764) == 19\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2764) == 19\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005222", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([7, 16, 26, 71, 90, 93], 16) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 16, 26, 71, 90, 93], 16) == 1\nassert binary_search([7, 16, 26, 71, 90, 93], 7) == 0\nassert binary_search([7, 16, 26, 71, 90, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005223", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(126, 49) == 7\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(126, 49) == 7\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005224", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('caaacaca', 'acb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caaacaca', 'acb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005225", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 2, 3], [0, 0, 5]], [[2, 0], [1, 4], [1, 2]]) == [[7, 14], [5, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2, 3], [0, 0, 5]], [[2, 0], [1, 4], [1, 2]]) == [[7, 14], [5, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005226", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([5, 6, 1, 2, 2, 3, 7, 2, 4, 0], 1) == [0, 5, 6, 1, 2, 2, 3, 7, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 6, 1, 2, 2, 3, 7, 2, 4, 0], 1) == [0, 5, 6, 1, 2, 2, 3, 7, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005227", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('lnvzgl') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('lnvzgl') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005228", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(456)\nacc.deposit(264)\nacc.withdraw(21)\nacc.withdraw(872)\nassert acc.get_balance() == 720\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(456)\nacc.deposit(264)\nassert acc.get_balance() == 720\nacc.withdraw(21)\nassert acc.get_balance() == 699\nacc.withdraw(872)\nassert acc.get_balance() == 699\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005229", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[2], [2, 0], [2, 3, 4], 1, [7, 1]]) == [2, 2, 0, 2, 3, 4, 1, 7, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2], [2, 0], [2, 3, 4], 1, [7, 1]]) == [2, 2, 0, 2, 3, 4, 1, 7, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005230", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['baaz', 'baay']) == 'baa'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['baaz', 'baay']) == 'baa'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005231", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('dhwhjejw') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('dhwhjejw') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005232", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('aqvgk') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('aqvgk') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005233", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('beacdbb') == 'beacd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beacdbb') == 'beacd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005234", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([10, 39, 45]) == [10, 39, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 39, 45]) == [10, 39, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005235", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(17); s.push(99); s.push(88)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(17); s.push(99); s.push(88)\nassert s.peek() == 88\nassert s.pop() == 88\nassert s.pop() == 99\nassert s.is_empty() == False\nassert s.pop() == 17\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005236", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(28) == [2, 2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(28) == [2, 2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005237", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(109) == 'CIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(109) == 'CIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005238", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[2, -5, -5], [8, -3, 3], [-1, -9, -1]], [[-6, -5, 4], [2, -2, 4], [-1, -1, 4]]) == [[-4, -10, -1], [10, -5, 7], [-2, -10, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -5, -5], [8, -3, 3], [-1, -9, -1]], [[-6, -5, 4], [2, -2, 4], [-1, -1, 4]]) == [[-4, -10, -1], [10, -5, 7], [-2, -10, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005239", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([17, 18, 12, 22, 1, 17]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 18, 12, 22, 1, 17]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005240", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('tosruhka') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('tosruhka') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005241", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ddddcc') == 'd4c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddcc') == 'd4c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005242", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([27, 28, 54, 87, 88, 97, 99], 132) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([27, 28, 54, 87, 88, 97, 99], 132) == -1\nassert binary_search([27, 28, 54, 87, 88, 97, 99], 27) == 0\nassert binary_search([27, 28, 54, 87, 88, 97, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005243", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('dddcc') == 'd3c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddcc') == 'd3c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005244", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=670; user=off; mode=17') == {'host': '670', 'user': 'off', 'mode': '17'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=670; user=off; mode=17') == {'host': '670', 'user': 'off', 'mode': '17'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005245", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[4, 0, 2], [2, 2, 2]], [[0, 3, 0], [1, 0, 2], [4, 3, 5]]) == [[8, 18, 10], [10, 12, 14]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 0, 2], [2, 2, 2]], [[0, 3, 0], [1, 0, 2], [4, 3, 5]]) == [[8, 18, 10], [10, 12, 14]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005246", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[6, 4], [5], 3, [6, 3, 1, 1], 4]) == [6, 4, 5, 3, 6, 3, 1, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 4], [5], 3, [6, 3, 1, 1], 4]) == [6, 4, 5, 3, 6, 3, 1, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005247", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('acacabbabccb', 'ab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acacabbabccb', 'ab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005248", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'z': 7}, {'w': 5}) == {'w': 11, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'z': 7}, {'w': 5}) == {'w': 11, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005249", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 5, 5, 0, 3, 5, 0]) == [3, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 5, 0, 3, 5, 0]) == [3, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005250", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 4, 2, 5, 4, 9], 5) == [[1, 4, 2, 5, 4], [9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 4, 2, 5, 4, 9], 5) == [[1, 4, 2, 5, 4], [9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005251", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('ehxwjsmukhel') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ehxwjsmukhel') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005252", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 8, 3, 2, 6, 3], [8, 9, 1, 6]) == [8, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 8, 3, 2, 6, 3], [8, 9, 1, 6]) == [8, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005253", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(942323) == 970\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(942323) == 970\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005254", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(96); s.push(93); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(96); s.push(93); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 93\nassert s.is_empty() == False\nassert s.pop() == 96\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005255", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 5, 5], 1) == [5, 8, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 5, 5], 1) == [5, 8, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005256", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('10') == 10\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10') == 10\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005257", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('caxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('caxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005258", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([13, -6, -19, 4, 19, -15]) == -4\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([13, -6, -19, 4, 19, -15]) == -4\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005259", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cyx', 'cx', 'cyzy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cyx', 'cx', 'cyzy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005260", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(6306) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6306) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005261", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('The dog! cat cat dog Cat cat! dog dog ran,') == {'the': 1, 'dog': 4, 'cat': 4, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The dog! cat cat dog Cat cat! dog dog ran,') == {'the': 1, 'dog': 4, 'cat': 4, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005262", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('b,16,d,ab,36') == ['b', '16', 'd', 'ab', '36']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('b,16,d,ab,36') == ['b', '16', 'd', 'ab', '36']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005263", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([11, 10, 49, 36, 14]) == [10, 11, 14, 36, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 10, 49, 36, 14]) == [10, 11, 14, 36, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005264", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(222) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(222) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005265", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h17s') == 7217\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h17s') == 7217\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005266", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(6, 2) == 6\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 2) == 6\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005267", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([7, 2, 38]) == [2, 7, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 2, 38]) == [2, 7, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005268", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=200; port=944') == {'mode': '200', 'port': '944'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=200; port=944') == {'mode': '200', 'port': '944'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005269", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-13, -31, -28, 45, -13, 24, -16, -47, 32]) == 45\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-13, -31, -28, 45, -13, 24, -16, -47, 32]) == 45\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005270", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([23, 33, 14, 3, 31, 27, 43]) == [3, 14, 23, 27, 31, 33, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([23, 33, 14, 3, 31, 27, 43]) == [3, 14, 23, 27, 31, 33, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005271", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([48, 42, -18]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([48, 42, -18]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005272", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[3, 7], 2]) == [3, 7, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 7], 2]) == [3, 7, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005273", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 4, 5, 3], [8, 2, 1, 4, 8, 1, 9]) == [4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 4, 5, 3], [8, 2, 1, 4, 8, 1, 9]) == [4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005274", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-37, 7, -23, 21]) == 21\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-37, 7, -23, 21]) == 21\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005275", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['az', 'ayx', 'a']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['az', 'ayx', 'a']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005276", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('([]{})') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('([]{})') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005277", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([19, 23, 29, 16, 29]) == [16, 19, 23, 29, 29]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([19, 23, 29, 16, 29]) == [16, 19, 23, 29, 29]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005278", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([6, 11, 13, 8, 9, 8, 3, 8, 27, 11]) == 13\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([6, 11, 13, 8, 9, 8, 3, 8, 27, 11]) == 13\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005279", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aababbbbbba', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aababbbbbba', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005280", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('eergwbrzn') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('eergwbrzn') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005281", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([1, 5, 34], 5) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 5, 34], 5) == 1\nassert binary_search([1, 5, 34], 1) == 0\nassert binary_search([1, 5, 34], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005282", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(243) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(243) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005283", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 8, 'w': 8}, {'w': 6, 'z': 6, 'y': 2}) == {'y': 10, 'w': 14, 'z': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8, 'w': 8}, {'w': 6, 'z': 6, 'y': 2}) == {'y': 10, 'w': 14, 'z': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005284", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([4, 8], [17, 18]) == [4, 8, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 8], [17, 18]) == [4, 8, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005285", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([28, 25, 5, 0, 14]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 25, 5, 0, 14]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005286", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('dog ran, sun. cat The sat dog the, the,') == {'dog': 2, 'ran': 1, 'sun': 1, 'cat': 1, 'the': 3, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog ran, sun. cat The sat dog the, the,') == {'dog': 2, 'ran': 1, 'sun': 1, 'cat': 1, 'the': 3, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005287", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=off; port=on') == {'path': 'off', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; port=on') == {'path': 'off', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005288", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([46, 58, 67, 71, 83], 83) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([46, 58, 67, 71, 83], 83) == 4\nassert binary_search([46, 58, 67, 71, 83], 46) == 0\nassert binary_search([46, 58, 67, 71, 83], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005289", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(46, 166, 708) == 616\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(46, 166, 708) == 616\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005290", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 3, 7, 7, 4, 8, 1, 4, 2], 1) == [2, 8, 3, 7, 7, 4, 8, 1, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 3, 7, 7, 4, 8, 1, 4, 2], 1) == [2, 8, 3, 7, 7, 4, 8, 1, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005291", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(73) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(73) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005292", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(4416) == 6144\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4416) == 6144\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005293", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([10, 3, 22, 3]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 3, 22, 3]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005294", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('1h28m30s') == 5310\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h28m30s') == 5310\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005295", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(6909) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6909) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005296", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'a', 'a', 'a']) == {'a': 4}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'a', 'a', 'a']) == {'a': 4}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005297", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(256) == 'CCLVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(256) == 'CCLVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005298", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([32, 20, 1, 40, 34]) == [1, 20, 32, 34, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 20, 1, 40, 34]) == [1, 20, 32, 34, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005299", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(3); s.push(24); s.push(66)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(3); s.push(24); s.push(66)\nassert s.peek() == 66\nassert s.pop() == 66\nassert s.pop() == 24\nassert s.is_empty() == False\nassert s.pop() == 3\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005300", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 1, 0, 0, 0, 5, 0]) == [1, 0, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 0, 0, 0, 5, 0]) == [1, 0, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005301", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(4042) == 10\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4042) == 10\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005302", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([1, 5, 6, 42, 12]) == [1, 5, 6, 12, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 5, 6, 42, 12]) == [1, 5, 6, 12, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005303", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 7, 2, 8, 6], [8, 4, 3, 7, 6, 3]) == [3, 7, 8, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 7, 2, 8, 6], [8, 4, 3, 7, 6, 3]) == [3, 7, 8, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005304", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([39, 18, 40, 0, 26, 0, 11, 44]) == [0, 0, 11, 18, 26, 39, 40, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([39, 18, 40, 0, 26, 0, 11, 44]) == [0, 0, 11, 18, 26, 39, 40, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005305", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(380) == [2, 2, 5, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(380) == [2, 2, 5, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005306", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([8, 15, 21, 45, 61, 62, 63], 8) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 15, 21, 45, 61, 62, 63], 8) == 0\nassert binary_search([8, 15, 21, 45, 61, 62, 63], 8) == 0\nassert binary_search([8, 15, 21, 45, 61, 62, 63], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005307", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 23) == 'uvw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 23) == 'uvw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005308", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 4, 8, 6, 5, 0], 6) == [4, 4, 8, 6, 5, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 4, 8, 6, 5, 0], 6) == [4, 4, 8, 6, 5, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005309", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(229) == 'CCXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(229) == 'CCXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005310", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[4, 3, 9, 3], [7]]) == [4, 3, 9, 3, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 3, 9, 3], [7]]) == [4, 3, 9, 3, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005311", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(338)\nacc.deposit(237)\nacc.withdraw(477)\nacc.withdraw(744)\nassert acc.get_balance() == 575\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(338)\nacc.deposit(237)\nassert acc.get_balance() == 575\nacc.withdraw(477)\nassert acc.get_balance() == 98\nacc.withdraw(744)\nassert acc.get_balance() == 98\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005312", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(10); s.push(30); s.push(82)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(10); s.push(30); s.push(82)\nassert s.peek() == 82\nassert s.pop() == 82\nassert s.pop() == 30\nassert s.is_empty() == False\nassert s.pop() == 10\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005313", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[0, 6], [5, 9], [1, 1]]) == [[0, 5, 1], [6, 9, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 6], [5, 9], [1, 1]]) == [[0, 5, 1], [6, 9, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005314", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([2, 49, 43, 42, 30, 43, 6, 29, 18, 23]) == [2, 6, 18, 23, 29, 30, 42, 43, 43, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 49, 43, 42, 30, 43, 6, 29, 18, 23]) == [2, 6, 18, 23, 29, 30, 42, 43, 43, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005315", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 4, 1, 5]) == [3, 4, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 1, 5]) == [3, 4, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005316", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dcddddd') == 'd1c1d5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dcddddd') == 'd1c1d5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005317", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[6]], [[1]], 5]) == 12\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[6]], [[1]], 5]) == 12\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005318", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([0, 20, 49, 61, 63, 64, 84, 86], 170) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 20, 49, 61, 63, 64, 84, 86], 170) == -1\nassert binary_search([0, 20, 49, 61, 63, 64, 84, 86], 0) == 0\nassert binary_search([0, 20, 49, 61, 63, 64, 84, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005319", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(33, 111) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 111) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005320", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=119; mode=609; user=off; port=on') == {'host': '119', 'mode': '609', 'user': 'off', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=119; mode=609; user=off; port=on') == {'host': '119', 'mode': '609', 'user': 'off', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005321", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['ba', 'baxyz', 'bayzx', 'baxxz']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ba', 'baxyz', 'bayzx', 'baxxz']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005322", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([3, 5, 7], [4, 0, 1, 1]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 5, 7], [4, 0, 1, 1]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005323", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ceeeecc') == 'ce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceeeecc') == 'ce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005324", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([3, 6, 0], 1) == [0, 3, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 6, 0], 1) == [0, 3, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005325", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(434) == 'CDXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(434) == 'CDXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005326", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('eeba') == 'eba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeba') == 'eba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005327", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([20, 7, 48, 37, 29]) == [7, 20, 29, 37, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 7, 48, 37, 29]) == [7, 20, 29, 37, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005328", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(48)\nacc.deposit(24)\nacc.withdraw(14)\nacc.withdraw(269)\nassert acc.get_balance() == 72\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(48)\nacc.deposit(24)\nassert acc.get_balance() == 72\nacc.withdraw(14)\nassert acc.get_balance() == 58\nacc.withdraw(269)\nassert acc.get_balance() == 58\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005329", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([7, 9, 7, 2, 4], [6, 9, 6, 3, 9, 9]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 9, 7, 2, 4], [6, 9, 6, 3, 9, 9]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005330", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([2, 40, 36, 48, 45, 15]) == [2, 15, 36, 40, 45, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([2, 40, 36, 48, 45, 15]) == [2, 15, 36, 40, 45, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005331", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([3, 1, 2, 2], 4) == [3, 1, 2, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 1, 2, 2], 4) == [3, 1, 2, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005332", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbabaabbaaba', 'aaab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbabaabbaaba', 'aaab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005333", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([24, 16, 8, 8, 35, 40, 23, 20]) == [8, 8, 16, 20, 23, 24, 35, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 16, 8, 8, 35, 40, 23, 20]) == [8, 8, 16, 20, 23, 24, 35, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005334", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 3) == 'def'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 3) == 'def'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005335", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(59) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(59) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005336", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([20, 21, 21, 19, 16, 21]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 21, 21, 19, 16, 21]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005337", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([10, 20, 20, 14, 23, 20, 14, 3]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 20, 20, 14, 23, 20, 14, 3]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005338", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1670) == 'MDCLXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1670) == 'MDCLXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005339", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([2, 38, 35, 38, 44, 35, 2]) == [2, 2, 35, 35, 38, 38, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 38, 35, 38, 44, 35, 2]) == [2, 2, 35, 35, 38, 38, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005340", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[4, 1], [0, 0], [3, 5]], [[0, 5], [2, 2]]) == [[2, 22], [0, 0], [10, 25]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 1], [0, 0], [3, 5]], [[0, 5], [2, 2]]) == [[2, 22], [0, 0], [10, 25]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005341", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('baxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('baxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005342", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(56, 14) == 14\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(56, 14) == 14\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005343", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 1], [1, 5]], [[2, 5, 5], [5, 2, 1]]) == [[11, 17, 16], [27, 15, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1], [1, 5]], [[2, 5, 5], [5, 2, 1]]) == [[11, 17, 16], [27, 15, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005344", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([1, 6, 1, 1, 3, 8, 6, 2, 3], 5) == [[1, 6, 1, 1, 3], [8, 6, 2, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 6, 1, 1, 3, 8, 6, 2, 3], 5) == [[1, 6, 1, 1, 3], [8, 6, 2, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005345", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 7, 3, 4, 8, 3], 2) == [[9, 7], [3, 4], [8, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 7, 3, 4, 8, 3], 2) == [[9, 7], [3, 4], [8, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005346", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(59, 22) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 22) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005347", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(361) == 'CCCLXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(361) == 'CCCLXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005348", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(20, 20) == 20\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(20, 20) == 20\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005349", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 6, 1, 6, 8, 2, 8], 4) == [[9, 6, 1, 6], [8, 2, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 6, 1, 6, 8, 2, 8], 4) == [[9, 6, 1, 6], [8, 2, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005350", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(423) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(423) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005351", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([44, 35, 22, -3, -39, -42, 29, 41]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([44, 35, 22, -3, -39, -42, 29, 41]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005352", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat Sat Cat the') == {'cat': 2, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat Sat Cat the') == {'cat': 2, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005353", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 2, 4, 4, 5, 0, 0, 3, 5]) == [0, 2, 4, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 4, 4, 5, 0, 0, 3, 5]) == [0, 2, 4, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005354", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 85, 'c': 34, 'd': 84, 'b': 4, 'a': 21}) == {85: 'e', 34: 'c', 84: 'd', 4: 'b', 21: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 85, 'c': 34, 'd': 84, 'b': 4, 'a': 21}) == {85: 'e', 34: 'c', 84: 'd', 4: 'b', 21: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005355", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([0, 9, -7, 9, -7, -8, 4]) == [0, 9, 2, 11, 4, -4, 0]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([0, 9, -7, 9, -7, -8, 4]) == [0, 9, 2, 11, 4, -4, 0]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005356", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('bba[}()[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('bba[}()[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005357", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([8, 14, 18, 53, 59, 80, 92], 124) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 14, 18, 53, 59, 80, 92], 124) == -1\nassert binary_search([8, 14, 18, 53, 59, 80, 92], 8) == 0\nassert binary_search([8, 14, 18, 53, 59, 80, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005358", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-1, 9]) == [-1, 8]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-1, 9]) == [-1, 8]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005359", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=158; path=694; user=on; mode=481') == {'port': '158', 'path': '694', 'user': 'on', 'mode': '481'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=158; path=694; user=on; mode=481') == {'port': '158', 'path': '694', 'user': 'on', 'mode': '481'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005360", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([5, 2, 3, 0, 5, 7, 4, 3, 6, 6, 4, 4, 9, 0, 9], 5) == [[5, 2, 3, 0, 5], [7, 4, 3, 6, 6], [4, 4, 9, 0, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 2, 3, 0, 5, 7, 4, 3, 6, 6, 4, 4, 9, 0, 9], 5) == [[5, 2, 3, 0, 5], [7, 4, 3, 6, 6], [4, 4, 9, 0, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005361", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([4, [3, 7], 7]) == 21\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, [3, 7], 7]) == 21\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005362", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(384) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(384) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005363", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('ccabxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccabxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005364", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cffdda', 'afcddf') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cffdda', 'afcddf') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005365", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[[2]], [[2, 0]], 9]) == [2, 2, 0, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[2]], [[2, 0]], 9]) == [2, 2, 0, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005366", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-6, 7, 9, -3], [-6, 4, 9, 1]], [[-7, -7, 2, 0], [-6, -9, 4, 8]]) == [[-13, 0, 11, -3], [-12, -5, 13, 9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, 7, 9, -3], [-6, 4, 9, 1]], [[-7, -7, 2, 0], [-6, -9, 4, 8]]) == [[-13, 0, 11, -3], [-12, -5, 13, 9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005367", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(8761) == 93\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8761) == 93\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005368", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([15], [11, 18]) == [11, 15, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([15], [11, 18]) == [11, 15, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005369", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[2, 5], [8, 5], [3, 7]]) == [[2, 8, 3], [5, 5, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 5], [8, 5], [3, 7]]) == [[2, 8, 3], [5, 5, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005370", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3861) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3861) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005371", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('d,baaa,\"a,aba\"') == ['d', 'baaa', 'a,aba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,baaa,\"a,aba\"') == ['d', 'baaa', 'a,aba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005372", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'apple', 'berry', 'date', 'berry', 'berry', 'berry', 'date']) == {'b': ['banana', 'berry', 'berry', 'berry', 'berry'], 'a': ['apple'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'berry', 'date', 'berry', 'berry', 'berry', 'date']) == {'b': ['banana', 'berry', 'berry', 'berry', 'berry'], 'a': ['apple'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005373", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(50, 33) == 1650\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(50, 33) == 1650\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005374", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(33) == 26\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(33) == 26\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005375", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=672; host=914; user=off; port=299') == {'path': '672', 'host': '914', 'user': 'off', 'port': '299'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=672; host=914; user=off; port=299') == {'path': '672', 'host': '914', 'user': 'off', 'port': '299'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005376", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(4926) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4926) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005377", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'date', 'coconut', 'date', 'date', 'banana', 'avocado']) == {'c': ['cherry', 'coconut'], 'd': ['date', 'date', 'date'], 'b': ['banana'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'date', 'coconut', 'date', 'date', 'banana', 'avocado']) == {'c': ['cherry', 'coconut'], 'd': ['date', 'date', 'date'], 'b': ['banana'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005378", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 4, 1, 2, 4, 3]) == [4, 1, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 1, 2, 4, 3]) == [4, 1, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005379", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([3, [0, 0]]) == 3\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3, [0, 0]]) == 3\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005380", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([27, 34]) == 34\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([27, 34]) == 34\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005381", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(180) == 'CLXXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(180) == 'CLXXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005382", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(5184) == 72\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5184) == 72\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005383", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([38, 31, 34, 35, 2, 38, 37, 29]) == [2, 29, 31, 34, 35, 37, 38, 38]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([38, 31, 34, 35, 2, 38, 37, 29]) == [2, 29, 31, 34, 35, 37, 38, 38]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005384", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-7, -8, -2, -4]) == [-7, -15, -17, -21]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -8, -2, -4]) == [-7, -15, -17, -21]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005385", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(69) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(69) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005386", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([1, 14, 3, 31, -35, -22, 27, 30]) == 31\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([1, 14, 3, 31, -35, -22, 27, 30]) == 31\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005387", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 3, 0, 1, 3, 1]) == [1, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 0, 1, 3, 1]) == [1, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005388", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 1, 0, 2]) == [2, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 0, 2]) == [2, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005389", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([2, 22, 48, 52, 53, 57, 62, 73], 22) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 22, 48, 52, 53, 57, 62, 73], 22) == 1\nassert binary_search([2, 22, 48, 52, 53, 57, 62, 73], 2) == 0\nassert binary_search([2, 22, 48, 52, 53, 57, 62, 73], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005390", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('1h44m44s') == 6284\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h44m44s') == 6284\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005391", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([10, -5]) == 5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([10, -5]) == 5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005392", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['aaz', 'aa', 'aaxy', 'aa']) == 'aa'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['aaz', 'aa', 'aaxy', 'aa']) == 'aa'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005393", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('abfc', 'fbac') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('abfc', 'fbac') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005394", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 10, 12, 20], [0, 4, 4, 16, 18]) == [0, 0, 4, 4, 10, 12, 16, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 10, 12, 20], [0, 4, 4, 16, 18]) == [0, 0, 4, 4, 10, 12, 16, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005395", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(47) == 104\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(47) == 104\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005396", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([1, 17, 7, 12, -20]) == 17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([1, 17, 7, 12, -20]) == 17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005397", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([1, 5, 6, 1, 5, 6, 1, 8], 4) == [[1, 5, 6, 1], [5, 6, 1, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 5, 6, 1, 5, 6, 1, 8], 4) == [[1, 5, 6, 1], [5, 6, 1, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005398", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(363) == 'CCCLXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(363) == 'CCCLXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005399", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(410963) == 641\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(410963) == 641\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005400", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['date', 'apple', 'berry', 'apple', 'cherry']) == {'d': ['date'], 'a': ['apple', 'apple'], 'b': ['berry'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'berry', 'apple', 'cherry']) == {'d': ['date'], 'a': ['apple', 'apple'], 'b': ['berry'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005401", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'date', 'coconut', 'date']) == {'c': ['coconut', 'cherry', 'coconut'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'date', 'coconut', 'date']) == {'c': ['coconut', 'cherry', 'coconut'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005402", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([7, 10, 10]) == 27\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([7, 10, 10]) == 27\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005403", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(44); s.push(25); s.push(44)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(44); s.push(25); s.push(44)\nassert s.peek() == 44\nassert s.pop() == 44\nassert s.pop() == 25\nassert s.is_empty() == False\nassert s.pop() == 44\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 0.857} {"id": "stagec_005404", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([0, -38, 28, -44]) == 28\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([0, -38, 28, -44]) == 28\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005405", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('1h51m52s') == 6712\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h51m52s') == 6712\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005406", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 3, 6, 6, 7], [7, 1, 3, 3, 5, 8, 2, 0]) == [5, 3, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 3, 6, 6, 7], [7, 1, 3, 3, 5, 8, 2, 0]) == [5, 3, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005407", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 4, 5, 4, 4, 0, 5, 1, 2]) == [2, 4, 5, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 5, 4, 4, 0, 5, 1, 2]) == [2, 4, 5, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005408", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 1, 'e': 1, 'b': 2, 'a': 5}, 2) == {'a': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 1, 'e': 1, 'b': 2, 'a': 5}, 2) == {'a': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005409", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('cbdaceb') == 'cbdae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbdaceb') == 'cbdae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005410", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([7, -7, 0, -4]) == [7, 0, 0, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([7, -7, 0, -4]) == [7, 0, 0, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005411", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(72) == 'LXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(72) == 'LXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005412", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'apple', 'avocado']) == {'a': ['avocado', 'apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'apple', 'avocado']) == {'a': ['avocado', 'apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005413", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('dgdc bdhfb gfbef') == 'bdhfb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dgdc bdhfb gfbef') == 'bdhfb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005414", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbddd') == 'b4d3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbddd') == 'b4d3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005415", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('rqxcuhziq') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('rqxcuhziq') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005416", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbbcbaba', 'cab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbcbaba', 'cab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005417", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=off; port=163') == {'path': 'off', 'port': '163'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; port=163') == {'path': 'off', 'port': '163'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005418", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('adddde') == 'ade'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adddde') == 'ade'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005419", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(151321) == 389\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(151321) == 389\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005420", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=on; port=348') == {'mode': 'on', 'port': '348'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; port=348') == {'mode': 'on', 'port': '348'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005421", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(263) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(263) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005422", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(310) == 86\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(310) == 86\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005423", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h19m17s') == 19157\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h19m17s') == 19157\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005424", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-1, -8, -9], [4, 8, -4]], [[-3, -2, -8], [-5, 3, -3]]) == [[-4, -10, -17], [-1, 11, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -8, -9], [4, 8, -4]], [[-3, -2, -8], [-5, 3, -3]]) == [[-4, -10, -17], [-1, 11, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005425", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[7, 1], [9, 2], [1, 9], [4, 2]]) == [[7, 9, 1, 4], [1, 2, 9, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 1], [9, 2], [1, 9], [4, 2]]) == [[7, 9, 1, 4], [1, 2, 9, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005426", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([20, 5, 29, 5, 29]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 5, 29, 5, 29]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005427", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([17, 2, 10]) == [2, 10, 17]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([17, 2, 10]) == [2, 10, 17]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_005428", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('ba bcaed bae decd') == 'Ba Bcaed Bae Decd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ba bcaed bae decd') == 'Ba Bcaed Bae Decd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005429", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'b', 'b']) == {'d': 1, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'b', 'b']) == {'d': 1, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005430", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 8, 7], [3, 4, 8, 7, 7, 3, 4, 4]) == [7, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 8, 7], [3, 4, 8, 7, 7, 3, 4, 4]) == [7, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005431", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([9, 21, 18, 16, 26, 28, 21, 18, 22, 11, 11]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 21, 18, 16, 26, 28, 21, 18, 22, 11, 11]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005432", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('12 + 20') == 32\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('12 + 20') == 32\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005433", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([44, 47, 37, 35, 1, 17, 27, 36, 41, 29, 20, 21]) == [1, 17, 20, 21, 27, 29, 35, 36, 37, 41, 44, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([44, 47, 37, 35, 1, 17, 27, 36, 41, 29, 20, 21]) == [1, 17, 20, 21, 27, 29, 35, 36, 37, 41, 44, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005434", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(379) == [379]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(379) == [379]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005435", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=off; host=929; port=295; user=off') == {'path': 'off', 'host': '929', 'port': '295', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; host=929; port=295; user=off') == {'path': 'off', 'host': '929', 'port': '295', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005436", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 2, 1, 0, 5]) == [5, 2, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 1, 0, 5]) == [5, 2, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005437", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(167) == [167]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(167) == [167]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005438", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([10, 49, 41, 38]) == [10, 38, 41, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([10, 49, 41, 38]) == [10, 38, 41, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005439", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([32, 17, 18, 25, 44, 16, 20]) == [16, 17, 18, 20, 25, 32, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 17, 18, 25, 44, 16, 20]) == [16, 17, 18, 20, 25, 32, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005440", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 5, 2, 0, 1, 3, 0, 0, 0, 6], 4) == [0, 0, 0, 6, 1, 5, 2, 0, 1, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 5, 2, 0, 1, 3, 0, 0, 0, 6], 4) == [0, 0, 0, 6, 1, 5, 2, 0, 1, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005441", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([14, 0, 20, 19, 15, 46, 13, 42, 30, 35, 25, 11]) == [0, 11, 13, 14, 15, 19, 20, 25, 30, 35, 42, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([14, 0, 20, 19, 15, 46, 13, 42, 30, 35, 25, 11]) == [0, 11, 13, 14, 15, 19, 20, 25, 30, 35, 42, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005442", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 26, 'd': 33, 'e': 23, 'f': 29}) == {26: 'a', 33: 'd', 23: 'e', 29: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 26, 'd': 33, 'e': 23, 'f': 29}) == {26: 'a', 33: 'd', 23: 'e', 29: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005443", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello Hello', 19) == 'Axeeh Axeeh'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Hello', 19) == 'Axeeh Axeeh'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005444", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('axceatimiv') == 5\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('axceatimiv') == 5\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005445", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('abbaababbbaab', 'bbba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbaababbbaab', 'bbba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005446", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('20 + 11 * 3') == 53\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20 + 11 * 3') == 53\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005447", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-42, -20, 40, -6, 12, 47]) == 47\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-42, -20, 40, -6, 12, 47]) == 47\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005448", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([3]) == 3\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3]) == 3\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005449", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1140) == 'MCXL'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1140) == 'MCXL'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005450", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-10, 31, -28, 28]) == 31\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-10, 31, -28, 28]) == 31\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005451", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(9394) == 25\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9394) == 25\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005452", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(377) == 'CCCLXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(377) == 'CCCLXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005453", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(73)\nacc.deposit(113)\nacc.withdraw(16)\nacc.withdraw(200)\nassert acc.get_balance() == 186\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(73)\nacc.deposit(113)\nassert acc.get_balance() == 186\nacc.withdraw(16)\nassert acc.get_balance() == 170\nacc.withdraw(200)\nassert acc.get_balance() == 170\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005454", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbcccbabbcb', 'cbac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbcccbabbcb', 'cbac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005455", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(81); s.push(81); s.push(92)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(81); s.push(92)\nassert s.peek() == 92\nassert s.pop() == 92\nassert s.pop() == 81\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005456", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[4, 5, 1], [0, 7, 0], [6, 2, 7], [5, 7, 7]]) == [[4, 0, 6, 5], [5, 7, 2, 7], [1, 0, 7, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 5, 1], [0, 7, 0], [6, 2, 7], [5, 7, 7]]) == [[4, 0, 6, 5], [5, 7, 2, 7], [1, 0, 7, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005457", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 7, 6, 7, 7, 7, 5, 9, 5, 9, 5, 3, 5], 2) == [[2, 7], [6, 7], [7, 7], [5, 9], [5, 9], [5, 3], [5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 7, 6, 7, 7, 7, 5, 9, 5, 9, 5, 3, 5], 2) == [[2, 7], [6, 7], [7, 7], [5, 9], [5, 9], [5, 3], [5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005458", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[8, 6]], 6]) == 20\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[8, 6]], 6]) == 20\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005459", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 1, 'b': 9}, 2) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 1, 'b': 9}, 2) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005460", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=572; host=off; path=863') == {'user': '572', 'host': 'off', 'path': '863'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=572; host=off; path=863') == {'user': '572', 'host': 'off', 'path': '863'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005461", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(65); s.push(49); s.push(47)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(65); s.push(49); s.push(47)\nassert s.peek() == 47\nassert s.pop() == 47\nassert s.pop() == 49\nassert s.is_empty() == False\nassert s.pop() == 65\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005462", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([0, 25, -23, 16, 33, -6, -13, -8]) == 33\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([0, 25, -23, 16, 33, -6, -13, -8]) == 33\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005463", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([50, 13, -11, -22, -27]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, 13, -11, -22, -27]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005464", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(212)\nacc.deposit(273)\nacc.withdraw(132)\nacc.withdraw(578)\nassert acc.get_balance() == 485\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(212)\nacc.deposit(273)\nassert acc.get_balance() == 485\nacc.withdraw(132)\nassert acc.get_balance() == 353\nacc.withdraw(578)\nassert acc.get_balance() == 353\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005465", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 3, 4, 0], [4, 3, 3, 5, 5, 2, 8]) == [3, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 3, 4, 0], [4, 3, 3, 5, 5, 2, 8]) == [3, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005466", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([7, 3, 17, 26, 38, 50]) == [3, 7, 17, 26, 38, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([7, 3, 17, 26, 38, 50]) == [3, 7, 17, 26, 38, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005467", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(34); s.push(91); s.push(14)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(34); s.push(91); s.push(14)\nassert s.peek() == 14\nassert s.pop() == 14\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 34\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005468", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('9') == 9\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9') == 9\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005469", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-9, 15, 13, -11, -14, 0]) == -6\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-9, 15, 13, -11, -14, 0]) == -6\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005470", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([20, 15, 28, 26, 10]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 15, 28, 26, 10]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005471", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([0, 7, 13, 24, 46, 78], 179) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 7, 13, 24, 46, 78], 179) == -1\nassert binary_search([0, 7, 13, 24, 46, 78], 0) == 0\nassert binary_search([0, 7, 13, 24, 46, 78], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005472", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([48, 1, 38, 3, 15, 6, 44, 23, 37, 5, 39, 23]) == [1, 3, 5, 6, 15, 23, 23, 37, 38, 39, 44, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 1, 38, 3, 15, 6, 44, 23, 37, 5, 39, 23]) == [1, 3, 5, 6, 15, 23, 23, 37, 38, 39, 44, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005473", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-6, -9, 1, 0], [5, -6, 7, -9]], [[6, 9, 0, 1], [4, 4, 7, -9]]) == [[0, 0, 1, 1], [9, -2, 14, -18]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -9, 1, 0], [5, -6, 7, -9]], [[6, 9, 0, 1], [4, 4, 7, -9]]) == [[0, 0, 1, 1], [9, -2, 14, -18]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005474", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(196) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(196) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005475", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(81); s.push(12); s.push(17)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(12); s.push(17)\nassert s.peek() == 17\nassert s.pop() == 17\nassert s.pop() == 12\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005476", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1667) == 7661\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1667) == 7661\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005477", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 43, 'a': 18, 'd': 2, 'b': 82, 'f': 86}) == {43: 'e', 18: 'a', 2: 'd', 82: 'b', 86: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 43, 'a': 18, 'd': 2, 'b': 82, 'f': 86}) == {43: 'e', 18: 'a', 2: 'd', 82: 'b', 86: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005478", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([29, 13, 29, 13, 23]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 13, 29, 13, 23]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005479", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(37) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(37) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005480", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'banana', 'banana', 'coconut', 'apple', 'date', 'berry', 'coconut']) == {'c': ['cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana', 'berry'], 'a': ['apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'banana', 'banana', 'coconut', 'apple', 'date', 'berry', 'coconut']) == {'c': ['cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana', 'berry'], 'a': ['apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005481", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['b', 'b', 'a']) == {'b': 2, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'b', 'a']) == {'b': 2, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005482", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(9154) == 4519\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(9154) == 4519\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005483", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 2, 5, 1, 3, 5, 0, 6, 0], 6) == [1, 3, 5, 0, 6, 0, 4, 2, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 2, 5, 1, 3, 5, 0, 6, 0], 6) == [1, 3, 5, 0, 6, 0, 4, 2, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005484", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([24, 32, 22]) == [22, 24, 32]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([24, 32, 22]) == [22, 24, 32]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005485", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(4) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(4) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005486", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('dded babgdcf hachadd hbhhh') == 'babgdcf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dded babgdcf hachadd hbhhh') == 'babgdcf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005487", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('debebec') == 'debc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('debebec') == 'debc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005488", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['bcbzzz', 'bcbzyy', 'bcbxxy']) == 'bcb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bcbzzz', 'bcbzyy', 'bcbxxy']) == 'bcb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005489", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('LX') == 60\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LX') == 60\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005490", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('1 - (15 * 13)') == -194\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1 - (15 * 13)') == -194\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005491", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(58) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(58) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005492", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCXXIX') == 229\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXXIX') == 229\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005493", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['axyx', 'axyx', 'a']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['axyx', 'axyx', 'a']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005494", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([42, 43, 41, 49, 22, 28, 50]) == [22, 28, 41, 42, 43, 49, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([42, 43, 41, 49, 22, 28, 50]) == [22, 28, 41, 42, 43, 49, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005495", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('aeabazfzy') == 'yzfzabaea'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('aeabazfzy') == 'yzfzabaea'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005496", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun ran sun sat. Ran the!') == {'sun': 2, 'ran': 2, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun ran sun sat. Ran the!') == {'sun': 2, 'ran': 2, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005497", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CLVI') == 156\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLVI') == 156\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005498", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-3, 8], [6, 8], [6, 8]], [[-5, -3], [-1, -3], [-9, -2]]) == [[-8, 5], [5, 5], [-3, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 8], [6, 8], [6, 8]], [[-5, -3], [-1, -3], [-9, -2]]) == [[-8, 5], [5, 5], [-3, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005499", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('16') == 16\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('16') == 16\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005500", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(263) == 'CCLXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(263) == 'CCLXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005501", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('hvhmsrrewjctl') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hvhmsrrewjctl') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005502", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(11, 45) == 495\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(11, 45) == 495\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005503", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(179) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(179) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005504", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([19, 0, 33, 37]) == [0, 19, 33, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([19, 0, 33, 37]) == [0, 19, 33, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005505", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(99); s.push(17); s.push(68)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(99); s.push(17); s.push(68)\nassert s.peek() == 68\nassert s.pop() == 68\nassert s.pop() == 17\nassert s.is_empty() == False\nassert s.pop() == 99\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005506", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{()}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{()}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005507", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 2, 1, 1, 6, 7, 2, 5], 7) == [2, 1, 1, 6, 7, 2, 5, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 2, 1, 1, 6, 7, 2, 5], 7) == [2, 1, 1, 6, 7, 2, 5, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005508", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(69, 72) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(69, 72) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005509", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'avocado']) == {'b': ['berry'], 'c': ['coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'avocado']) == {'b': ['berry'], 'c': ['coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005510", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-2, -3], [-5, 5]], [[4, 4], [8, -5]]) == [[2, 1], [3, 0]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, -3], [-5, 5]], [[4, 4], [8, -5]]) == [[2, 1], [3, 0]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005511", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([3, 7, [6]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3, 7, [6]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005512", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[2, 8, 8, 7], [6, 9, 5, 4]]) == [[2, 6], [8, 9], [8, 5], [7, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 8, 8, 7], [6, 9, 5, 4]]) == [[2, 6], [8, 9], [8, 5], [7, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005513", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([3, 6, 8, 8, 0, 3, 5, 8], 5) == [8, 0, 3, 5, 8, 3, 6, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 6, 8, 8, 0, 3, 5, 8], 5) == [8, 0, 3, 5, 8, 3, 6, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005514", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([9, 4, [0, 5], [1]]) == [9, 4, 0, 5, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 4, [0, 5], [1]]) == [9, 4, 0, 5, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005515", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 5, 8, 1], [8, 2, 9, 2]) == [8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 5, 8, 1], [8, 2, 9, 2]) == [8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005516", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h5m41s') == 18341\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h5m41s') == 18341\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005517", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(1968) == 44\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1968) == 44\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005518", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([22, 34, 37, 70, 97], 97) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([22, 34, 37, 70, 97], 97) == 4\nassert binary_search([22, 34, 37, 70, 97], 22) == 0\nassert binary_search([22, 34, 37, 70, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005519", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([1, 2, 4, 35, 58, 67, 84], 132) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 2, 4, 35, 58, 67, 84], 132) == -1\nassert binary_search([1, 2, 4, 35, 58, 67, 84], 1) == 0\nassert binary_search([1, 2, 4, 35, 58, 67, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005520", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[0, 0], [3, 2], [3, 0]], [[4, 3, 0], [1, 2, 2]]) == [[0, 0, 0], [14, 13, 4], [12, 9, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 0], [3, 2], [3, 0]], [[4, 3, 0], [1, 2, 2]]) == [[0, 0, 0], [14, 13, 4], [12, 9, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005521", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(21, 117, 752) == 629\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(21, 117, 752) == 629\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005522", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ccdbd') == 'Ccdbd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ccdbd') == 'Ccdbd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005523", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([14, 1, 9, 14, 23, 17]) == [1, 9, 14, 14, 17, 23]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 1, 9, 14, 23, 17]) == [1, 9, 14, 14, 17, 23]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005524", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('fxacbf') == 'fbcaxf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fxacbf') == 'fbcaxf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005525", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(726182) == 852\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(726182) == 852\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005526", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gacgdg agfe cd ghdda da g') == 'gacgdg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gacgdg agfe cd ghdda da g') == 'gacgdg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005527", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('(){}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(){}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005528", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aceeee') == 'ace'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aceeee') == 'ace'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005529", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(326) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(326) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005530", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 38, 'c': 2, 'f': 19}) == {38: 'd', 2: 'c', 19: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 38, 'c': 2, 'f': 19}) == {38: 'd', 2: 'c', 19: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005531", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([16, 26, 30, 34], 34) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 26, 30, 34], 34) == 3\nassert binary_search([16, 26, 30, 34], 16) == 0\nassert binary_search([16, 26, 30, 34], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005532", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 7, 3], [0, 3, 0]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 7, 3], [0, 3, 0]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005533", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[3, 3, 1], [2, 3, 0], [4, 2, 4]], [[2, 2], [4, 0], [5, 0]]) == [[23, 6], [16, 4], [36, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3, 1], [2, 3, 0], [4, 2, 4]], [[2, 2], [4, 0], [5, 0]]) == [[23, 6], [16, 4], [36, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005534", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('dbcbdee', 'cbbedde') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dbcbdee', 'cbbedde') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005535", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(105) == [3, 5, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(105) == [3, 5, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005536", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 7, 6, 0, 3, 4, 2, 6, 9], 13) == [4, 2, 6, 9, 9, 7, 6, 0, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 7, 6, 0, 3, 4, 2, 6, 9], 13) == [4, 2, 6, 9, 9, 7, 6, 0, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005537", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([7, 16], [0, 3, 8, 10, 15, 16]) == [0, 3, 7, 8, 10, 15, 16, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7, 16], [0, 3, 8, 10, 15, 16]) == [0, 3, 7, 8, 10, 15, 16, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005538", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(49, 29, 483) == 301\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(49, 29, 483) == 301\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005539", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('addacad') == 'adc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('addacad') == 'adc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005540", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(33, 193, 213) == 102\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(33, 193, 213) == 102\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005541", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('aecc daddba') == 'Aecc Daddba'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aecc daddba') == 'Aecc Daddba'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005542", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(23) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(23) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005543", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 4, 5], [5, 1, 0], [3, 3, 3]], [[3, 0], [5, 3], [3, 0]]) == [[41, 12], [20, 3], [33, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 4, 5], [5, 1, 0], [3, 3, 3]], [[3, 0], [5, 3], [3, 0]]) == [[41, 12], [20, 3], [33, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005544", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(107)\nacc.deposit(278)\nacc.withdraw(37)\nacc.withdraw(559)\nassert acc.get_balance() == 385\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(107)\nacc.deposit(278)\nassert acc.get_balance() == 385\nacc.withdraw(37)\nassert acc.get_balance() == 348\nacc.withdraw(559)\nassert acc.get_balance() == 348\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005545", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h18m49s') == 8329\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h18m49s') == 8329\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005546", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('25m47s') == 1547\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('25m47s') == 1547\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005547", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('aaf', 'afa') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aaf', 'afa') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005548", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('The ran ran dog cat ran') == {'the': 1, 'ran': 3, 'dog': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The ran ran dog cat ran') == {'the': 1, 'ran': 3, 'dog': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005549", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(6061) == 77\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6061) == 77\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005550", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([18, 13, 23, 14]) == [13, 14, 18, 23]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([18, 13, 23, 14]) == [13, 14, 18, 23]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005551", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([4, [4, 7, 1]]) == [4, 4, 7, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [4, 7, 1]]) == [4, 4, 7, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005552", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(231) == [3, 7, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(231) == [3, 7, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005553", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'berry']) == {'b': ['banana', 'berry'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'berry']) == {'b': ['banana', 'berry'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005554", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[0], [[5], [7, 2]], [[8, 5, 7], 6]]) == [0, 5, 7, 2, 8, 5, 7, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[0], [[5], [7, 2]], [[8, 5, 7], 6]]) == [0, 5, 7, 2, 8, 5, 7, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005555", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[1, -7, -4], [9, -3, 4], [6, 2, 9]], [[0, 4, 8], [5, -8, 3], [-1, -3, 7]]) == [[1, -3, 4], [14, -11, 7], [5, -1, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -7, -4], [9, -3, 4], [6, 2, 9]], [[0, 4, 8], [5, -8, 3], [-1, -3, 7]]) == [[1, -3, 4], [14, -11, 7], [5, -1, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005556", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 1, 0, 7], [9, 0, 5, 4, 0]) == [0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 1, 0, 7], [9, 0, 5, 4, 0]) == [0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005557", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('ba aead b') == 'Ba Aead B'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ba aead b') == 'Ba Aead B'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005558", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ecdde') == 'ecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecdde') == 'ecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005559", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(6729) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6729) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005560", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=57; port=278') == {'host': '57', 'port': '278'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=57; port=278') == {'host': '57', 'port': '278'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005561", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'w': 2}, {'w': 3, 'x': 9}) == {'x': 13, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'w': 2}, {'w': 3, 'x': 9}) == {'x': 13, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005562", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8758) == 28\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8758) == 28\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005563", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('bccccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bccccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005564", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([18, 16, 16, 15, 29]) == [15, 16, 16, 18, 29]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 16, 16, 15, 29]) == [15, 16, 16, 18, 29]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005565", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 88, 'f': 98, 'a': 52, 'e': 11}) == {88: 'd', 98: 'f', 52: 'a', 11: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 88, 'f': 98, 'a': 52, 'e': 11}) == {88: 'd', 98: 'f', 52: 'a', 11: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005566", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([7, 1, 6, 8, 2, 0, 4, 5], 8) == [7, 1, 6, 8, 2, 0, 4, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 1, 6, 8, 2, 0, 4, 5], 8) == [7, 1, 6, 8, 2, 0, 4, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005567", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([32, 47, 49, 35, 10]) == [10, 32, 35, 47, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 47, 49, 35, 10]) == [10, 32, 35, 47, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005568", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(9, 67, 222) == 123\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(9, 67, 222) == 123\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005569", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(16, 23) == 368\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 23) == 368\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005570", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 9, 5, 7, 7, 6, 8], 3) == [[8, 9, 5], [7, 7, 6], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 9, 5, 7, 7, 6, 8], 3) == [[8, 9, 5], [7, 7, 6], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005571", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun! the! The sat The dog') == {'sun': 1, 'the': 3, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun! the! The sat The dog') == {'sun': 1, 'the': 3, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005572", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('4,d,96') == ['4', 'd', '96']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('4,d,96') == ['4', 'd', '96']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005573", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat dog sat dog cat the') == {'cat': 2, 'dog': 2, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat dog sat dog cat the') == {'cat': 2, 'dog': 2, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005574", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat. the dog. cat ran sat sat.') == {'cat': 2, 'the': 1, 'dog': 1, 'ran': 1, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat. the dog. cat ran sat sat.') == {'cat': 2, 'the': 1, 'dog': 1, 'ran': 1, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005575", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(24, 80, 629) == 120\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(24, 80, 629) == 120\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005576", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('1h25m9s') == 5109\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h25m9s') == 5109\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005577", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('accccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('accccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005578", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('user=576; port=292; path=off; mode=605') == {'user': '576', 'port': '292', 'path': 'off', 'mode': '605'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=576; port=292; path=off; mode=605') == {'user': '576', 'port': '292', 'path': 'off', 'mode': '605'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005579", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('aexz') == 'zxea'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('aexz') == 'zxea'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005580", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(26); s.push(22); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(26); s.push(22); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 26\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005581", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 2, 'f': 24, 'a': 0, 'c': 85, 'b': 26}) == {2: 'd', 24: 'f', 0: 'a', 85: 'c', 26: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 2, 'f': 24, 'a': 0, 'c': 85, 'b': 26}) == {2: 'd', 24: 'f', 0: 'a', 85: 'c', 26: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005582", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(429)\nacc.deposit(85)\nacc.withdraw(459)\nacc.withdraw(524)\nassert acc.get_balance() == 514\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(429)\nacc.deposit(85)\nassert acc.get_balance() == 514\nacc.withdraw(459)\nassert acc.get_balance() == 55\nacc.withdraw(524)\nassert acc.get_balance() == 55\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005583", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([9, 9, 0, 7, 9, 0], 4) == [[9, 9, 0, 7], [9, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 9, 0, 7, 9, 0], 4) == [[9, 9, 0, 7], [9, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005584", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(2, 2) == 4\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 2) == 4\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005585", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(132) == 'CXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(132) == 'CXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005586", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([6, [0], [3, 7, 7]]) == [6, 0, 3, 7, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [0], [3, 7, 7]]) == [6, 0, 3, 7, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005587", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(4246) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4246) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005588", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(65) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(65) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005589", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bccccdccc') == 'b1c4d1c3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bccccdccc') == 'b1c4d1c3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005590", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(4) == 2\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(4) == 2\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005591", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 0, 3, 3, 5, 2, 4, 5, 6, 9, 2, 7, 1, 9], 3) == [[6, 0, 3], [3, 5, 2], [4, 5, 6], [9, 2, 7], [1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 0, 3, 3, 5, 2, 4, 5, 6, 9, 2, 7, 1, 9], 3) == [[6, 0, 3], [3, 5, 2], [4, 5, 6], [9, 2, 7], [1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005592", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(198, 112) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(198, 112) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005593", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 3, 3, 5, 5, 3, 7, 0], [4, 6, 7, 4, 2, 4]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 3, 3, 5, 5, 3, 7, 0], [4, 6, 7, 4, 2, 4]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005594", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'coconut', 'cherry', 'banana', 'berry', 'cherry', 'avocado', 'apple']) == {'c': ['cherry', 'coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'coconut', 'cherry', 'banana', 'berry', 'cherry', 'avocado', 'apple']) == {'c': ['cherry', 'coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005595", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(6, 54, 984) == 144\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(6, 54, 984) == 144\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005596", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1886) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1886) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005597", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[6, 1, 0], [8, 3]]) == [6, 1, 0, 8, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 1, 0], [8, 3]]) == [6, 1, 0, 8, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005598", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([23, 22, 6, 21, 11, 29, 13, 41]) == [6, 11, 13, 21, 22, 23, 29, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([23, 22, 6, 21, 11, 29, 13, 41]) == [6, 11, 13, 21, 22, 23, 29, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005599", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([14, -20, -9, 19, 2]) == 6\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([14, -20, -9, 19, 2]) == 6\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005600", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sat! dog Sun cat. ran sat. ran') == {'sat': 2, 'dog': 1, 'sun': 1, 'cat': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat! dog Sun cat. ran sat. ran') == {'sat': 2, 'dog': 1, 'sun': 1, 'cat': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005601", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([4, 38, 26, 20, 25, 0, 23]) == [0, 4, 20, 23, 25, 26, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([4, 38, 26, 20, 25, 0, 23]) == [0, 4, 20, 23, 25, 26, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005602", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([49, 41, 32]) == [32, 41, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([49, 41, 32]) == [32, 41, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005603", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(78); s.push(96); s.push(53)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(78); s.push(96); s.push(53)\nassert s.peek() == 53\nassert s.pop() == 53\nassert s.pop() == 96\nassert s.is_empty() == False\nassert s.pop() == 78\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005604", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the sun, Ran sat sun!') == {'the': 1, 'sun': 2, 'ran': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the sun, Ran sat sun!') == {'the': 1, 'sun': 2, 'ran': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005605", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 21, 'd': 51}) == {21: 'b', 51: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 21, 'd': 51}) == {21: 'b', 51: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005606", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('aaaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005607", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(141) == [3, 47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(141) == [3, 47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005608", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([15, 34, 11]) == [11, 15, 34]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([15, 34, 11]) == [11, 15, 34]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005609", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(6347) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6347) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005610", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('cdfeaa', 'acfdae') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cdfeaa', 'acfdae') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005611", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([12, 37, 12, 7, 29, 8, 1, 48]) == [1, 7, 8, 12, 12, 29, 37, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([12, 37, 12, 7, 29, 8, 1, 48]) == [1, 7, 8, 12, 12, 29, 37, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005612", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([18, 40, 0, 39, 49, 31]) == [0, 18, 31, 39, 40, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([18, 40, 0, 39, 49, 31]) == [0, 18, 31, 39, 40, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005613", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['aacx', 'aacy', 'aac']) == 'aac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['aacx', 'aacy', 'aac']) == 'aac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005614", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 1, 3, 6, 7, 4, 3, 2, 7, 2], 5) == [[8, 1, 3, 6, 7], [4, 3, 2, 7, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 3, 6, 7, 4, 3, 2, 7, 2], 5) == [[8, 1, 3, 6, 7], [4, 3, 2, 7, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005615", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([3, [8, 7], 8]) == [3, 8, 7, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [8, 7], 8]) == [3, 8, 7, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005616", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(28); s.push(88); s.push(34)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(28); s.push(88); s.push(34)\nassert s.peek() == 34\nassert s.pop() == 34\nassert s.pop() == 88\nassert s.is_empty() == False\nassert s.pop() == 28\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005617", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 3}, {'w': 4, 'z': 2}) == {'y': 3, 'w': 4, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3}, {'w': 4, 'z': 2}) == {'y': 3, 'w': 4, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005618", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 10, 'c': 8, 'e': 7}, 5) == {'a': 10, 'c': 8, 'e': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 10, 'c': 8, 'e': 7}, 5) == {'a': 10, 'c': 8, 'e': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005619", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Sat ran. Cat Ran sun dog. the, Sat') == {'sat': 2, 'ran': 2, 'cat': 1, 'sun': 1, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat ran. Cat Ran sun dog. the, Sat') == {'sat': 2, 'ran': 2, 'cat': 1, 'sun': 1, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005620", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(2977) == 54\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2977) == 54\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005621", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[0, 3], [-3, 6], [-3, 6]], [[-1, 2], [7, -3], [0, 7]]) == [[-1, 5], [4, 3], [-3, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, 3], [-3, 6], [-3, 6]], [[-1, 2], [7, -3], [0, 7]]) == [[-1, 5], [4, 3], [-3, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005622", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([5, 34, 23, 8, 12, 38, 31, 19, 34, 23]) == [5, 8, 12, 19, 23, 23, 31, 34, 34, 38]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([5, 34, 23, 8, 12, 38, 31, 19, 34, 23]) == [5, 8, 12, 19, 23, 23, 31, 34, 34, 38]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005623", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(19, 54) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 54) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005624", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(7, 22) == 154\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(7, 22) == 154\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005625", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dbacaddbedadd') == 'dbace'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbacaddbedadd') == 'dbace'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005626", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('cdccc') == 'Cdccc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cdccc') == 'Cdccc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005627", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['d', 'd', 'b', 'a']) == {'d': 2, 'b': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'b', 'a']) == {'d': 2, 'b': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005628", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([31, 27, 1, 34, 18, 48]) == [1, 18, 27, 31, 34, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 27, 1, 34, 18, 48]) == [1, 18, 27, 31, 34, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005629", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[4, 0, 4], [3, 5, 5]], [[5, 4], [1, 2], [0, 5]]) == [[20, 36], [20, 47]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 0, 4], [3, 5, 5]], [[5, 4], [1, 2], [0, 5]]) == [[20, 36], [20, 47]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005630", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'banana', 'berry', 'apple', 'banana', 'coconut', 'coconut', 'date']) == {'b': ['berry', 'banana', 'berry', 'banana'], 'a': ['apple'], 'c': ['coconut', 'coconut'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'berry', 'apple', 'banana', 'coconut', 'coconut', 'date']) == {'b': ['berry', 'banana', 'berry', 'banana'], 'a': ['apple'], 'c': ['coconut', 'coconut'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005631", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(36, 53) == 1908\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(36, 53) == 1908\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005632", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(100) == [2, 2, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(100) == [2, 2, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005633", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([3, 6], [1, 15]) == [1, 3, 6, 15]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 6], [1, 15]) == [1, 3, 6, 15]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005634", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([10, 34, 0, 33, 17, 46, 2, 41, 8, 1]) == [0, 1, 2, 8, 10, 17, 33, 34, 41, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([10, 34, 0, 33, 17, 46, 2, 41, 8, 1]) == [0, 1, 2, 8, 10, 17, 33, 34, 41, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005635", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[5, 4, 7, 9], 7, 9, 0, [9, 6, 4]]) == [5, 4, 7, 9, 7, 9, 0, 9, 6, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 4, 7, 9], 7, 9, 0, [9, 6, 4]]) == [5, 4, 7, 9, 7, 9, 0, 9, 6, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005636", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(35, 20) == 140\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(35, 20) == 140\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005637", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 18) == 'pqr'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 18) == 'pqr'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005638", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-3, 16, -4, -1, -18]) == -10\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-3, 16, -4, -1, -18]) == -10\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005639", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[0, 3], [1, 0]], [[1, 3, 0], [1, 4, 3]]) == [[3, 12, 9], [1, 3, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3], [1, 0]], [[1, 3, 0], [1, 4, 3]]) == [[3, 12, 9], [1, 3, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005640", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('bbdad') == 'bda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbdad') == 'bda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005641", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCXXXIX') == 239\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXXXIX') == 239\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005642", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 4, 3, 2, 0, 3, 1, 5, 3]) == [0, 4, 3, 2, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 3, 2, 0, 3, 1, 5, 3]) == [0, 4, 3, 2, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005643", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 5], [1, 2], [3, 4]], [[0, 0, 2], [0, 4, 0]]) == [[0, 20, 4], [0, 8, 2], [0, 16, 6]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 5], [1, 2], [3, 4]], [[0, 0, 2], [0, 4, 0]]) == [[0, 20, 4], [0, 8, 2], [0, 16, 6]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005644", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([36, 24, 5, 15, 35, 43, 8]) == [5, 8, 15, 24, 35, 36, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 24, 5, 15, 35, 43, 8]) == [5, 8, 15, 24, 35, 36, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005645", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=79; path=591; user=541; port=42') == {'mode': '79', 'path': '591', 'user': '541', 'port': '42'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=79; path=591; user=541; port=42') == {'mode': '79', 'path': '591', 'user': '541', 'port': '42'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005646", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('48m9s') == 2889\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('48m9s') == 2889\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005647", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(30, 41, 909) == 792\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(30, 41, 909) == 792\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005648", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sat sun ran dog sun ran ran cat dog,') == {'sat': 1, 'sun': 2, 'ran': 3, 'dog': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun ran dog sun ran ran cat dog,') == {'sat': 1, 'sun': 2, 'ran': 3, 'dog': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005649", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([7, 2, 4, 37]) == [2, 4, 7, 37]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 2, 4, 37]) == [2, 4, 7, 37]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005650", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[9, -8], [1, -7], [0, 0]], [[-7, 8], [6, -5], [7, -9]]) == [[2, 0], [7, -12], [7, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, -8], [1, -7], [0, 0]], [[-7, 8], [6, -5], [7, -9]]) == [[2, 0], [7, -12], [7, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005651", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(17, 11) == 187\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 11) == 187\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005652", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('acc', 'acce') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acc', 'acce') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005653", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(112) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(112) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005654", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 7, 'b': 10, 'e': 2}, 3) == {'c': 7, 'b': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 7, 'b': 10, 'e': 2}, 3) == {'c': 7, 'b': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005655", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([15, 17, 11, 41, 1, 19]) == [1, 11, 15, 17, 19, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([15, 17, 11, 41, 1, 19]) == [1, 11, 15, 17, 19, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005656", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(45, 27) == 9\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(45, 27) == 9\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005657", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h40m24s') == 16824\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h40m24s') == 16824\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005658", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-46, -4, -10, -26, 11, -45, 12, -16]) == 12\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-46, -4, -10, -26, 11, -45, 12, -16]) == 12\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005659", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(7); s.push(52); s.push(89)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(7); s.push(52); s.push(89)\nassert s.peek() == 89\nassert s.pop() == 89\nassert s.pop() == 52\nassert s.is_empty() == False\nassert s.pop() == 7\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005660", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'cherry', 'avocado', 'banana', 'banana']) == {'b': ['banana', 'banana', 'banana'], 'c': ['cherry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'cherry', 'avocado', 'banana', 'banana']) == {'b': ['banana', 'banana', 'banana'], 'c': ['cherry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005661", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([6, [2, 7, 1], 8, 4, [3, 3, 6]]) == [6, 2, 7, 1, 8, 4, 3, 3, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [2, 7, 1], 8, 4, [3, 3, 6]]) == [6, 2, 7, 1, 8, 4, 3, 3, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005662", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('bbbaaaaaba', 'ab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbaaaaaba', 'ab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005663", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('aeaaea c') == 'Aeaaea C'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aeaaea c') == 'Aeaaea C'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005664", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(21, 17) == 357\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 17) == 357\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005665", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=39; mode=auto; port=on') == {'user': '39', 'mode': 'auto', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=39; mode=auto; port=on') == {'user': '39', 'mode': 'auto', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005666", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(22, 39) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(22, 39) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005667", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([9, 31, 12]) == [9, 12, 31]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 31, 12]) == [9, 12, 31]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005668", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['c', 'cyxz', 'c']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['c', 'cyxz', 'c']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005669", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([20, 25, 13, 3, 5]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 25, 13, 3, 5]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005670", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=701; path=auto') == {'mode': '701', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=701; path=auto') == {'mode': '701', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005671", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([28, 43, 39, 1, 27]) == [1, 27, 28, 39, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([28, 43, 39, 1, 27]) == [1, 27, 28, 39, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005672", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(275187) == 524\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(275187) == 524\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005673", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('aa)([})') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('aa)([})') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005674", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 4, 3, 5]) == [2, 4, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 3, 5]) == [2, 4, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005675", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(6307) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6307) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005676", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([45, 30, 18, 32, 8, 14, 7, 10]) == [7, 8, 10, 14, 18, 30, 32, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([45, 30, 18, 32, 8, 14, 7, 10]) == [7, 8, 10, 14, 18, 30, 32, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005677", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCCLIX') == 359\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLIX') == 359\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005678", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([0, 2, 19]) == 2\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 2, 19]) == 2\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005679", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(1); s.push(68); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(1); s.push(68); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 68\nassert s.is_empty() == False\nassert s.pop() == 1\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005680", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[8], [0, 4, 1], 6]) == [8, 0, 4, 1, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8], [0, 4, 1], 6]) == [8, 0, 4, 1, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005681", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('dabfc', 'dabfce') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dabfc', 'dabfce') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005682", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(111) == [3, 37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(111) == [3, 37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005683", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-19, 2]) == -17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-19, 2]) == -17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005684", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('83,48') == ['83', '48']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('83,48') == ['83', '48']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005685", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([38, 42, 44, 20]) == [20, 38, 42, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([38, 42, 44, 20]) == [20, 38, 42, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005686", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([48, 28, 34, 21, 23]) == [21, 23, 28, 34, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([48, 28, 34, 21, 23]) == [21, 23, 28, 34, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005687", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h59m16s') == 21556\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h59m16s') == 21556\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005688", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('bdce ae ceecda') == 'Bdce Ae Ceecda'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bdce ae ceecda') == 'Bdce Ae Ceecda'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005689", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(515) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(515) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005690", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('cbbc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbbc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005691", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('World', 18) == 'Ogjdv'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World', 18) == 'Ogjdv'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005692", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[9, 1, 9], 9, [9, 4, 0]]) == [9, 1, 9, 9, 9, 4, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 1, 9], 9, [9, 4, 0]]) == [9, 1, 9, 9, 9, 4, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005693", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 2, 3, 5, 6, 6, 3], [9, 3, 9, 3]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 2, 3, 5, 6, 6, 3], [9, 3, 9, 3]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005694", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(43); s.push(54); s.push(82)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(43); s.push(54); s.push(82)\nassert s.peek() == 82\nassert s.pop() == 82\nassert s.pop() == 54\nassert s.is_empty() == False\nassert s.pop() == 43\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005695", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(175)\nacc.deposit(280)\nacc.withdraw(437)\nacc.withdraw(568)\nassert acc.get_balance() == 455\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(175)\nacc.deposit(280)\nassert acc.get_balance() == 455\nacc.withdraw(437)\nassert acc.get_balance() == 18\nacc.withdraw(568)\nassert acc.get_balance() == 18\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005696", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{}{}{[]}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}{}{[]}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005697", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-3, 1], [-7, -9], [-1, -9], [0, 4]], [[-2, 9], [-5, -9], [-7, 0], [0, -4]]) == [[-5, 10], [-12, -18], [-8, -9], [0, 0]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 1], [-7, -9], [-1, -9], [0, 4]], [[-2, 9], [-5, -9], [-7, 0], [0, -4]]) == [[-5, 10], [-12, -18], [-8, -9], [0, 0]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005698", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([21, 30, 16, 23, 24, 0, 7]) == [0, 7, 16, 21, 23, 24, 30]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([21, 30, 16, 23, 24, 0, 7]) == [0, 7, 16, 21, 23, 24, 30]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005699", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([5, 7]) == 12\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([5, 7]) == 12\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005700", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(20, 3) == 60\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(20, 3) == 60\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005701", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('cat, sun sat. The cat Sat cat') == {'cat': 3, 'sun': 1, 'sat': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat, sun sat. The cat Sat cat') == {'cat': 3, 'sun': 1, 'sat': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005702", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([3, 27, 41, 57, 60, 62, 78, 87, 88, 90, 95], 27) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 27, 41, 57, 60, 62, 78, 87, 88, 90, 95], 27) == 1\nassert binary_search([3, 27, 41, 57, 60, 62, 78, 87, 88, 90, 95], 3) == 0\nassert binary_search([3, 27, 41, 57, 60, 62, 78, 87, 88, 90, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005703", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('acdbcc') == 'acdb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acdbcc') == 'acdb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005704", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(66) == [2, 3, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(66) == [2, 3, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005705", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([21, 16, 2, 12, 10, 11, 20, 14]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 16, 2, 12, 10, 11, 20, 14]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005706", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[9, 9, 8], [-8, -2, -5], [9, 2, -7]], [[6, 3, -8], [-2, -2, -6], [-9, -8, 3]]) == [[15, 12, 0], [-10, -4, -11], [0, -6, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, 9, 8], [-8, -2, -5], [9, 2, -7]], [[6, 3, -8], [-2, -2, -6], [-9, -8, 3]]) == [[15, 12, 0], [-10, -4, -11], [0, -6, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005707", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('dog The Ran ran! dog! dog dog Dog dog') == {'dog': 6, 'the': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog The Ran ran! dog! dog dog Dog dog') == {'dog': 6, 'the': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005708", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aaaeb') == 'aeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaaeb') == 'aeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005709", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([23, 5, 8, 28, 5, 8]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 5, 8, 28, 5, 8]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005710", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(51) == 'LI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(51) == 'LI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005711", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('29m31s') == 1771\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('29m31s') == 1771\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005712", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python World', 25) == 'Oxsgnm Vnqkc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python World', 25) == 'Oxsgnm Vnqkc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005713", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXC') == 490\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXC') == 490\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005714", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['', '', 'xy', 'zxx']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['', '', 'xy', 'zxx']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005715", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'b', 'b', 'd', 'd', 'a', 'c', 'd', 'b', 'e']) == {'e': 2, 'b': 3, 'd': 3, 'a': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'b', 'd', 'd', 'a', 'c', 'd', 'b', 'e']) == {'e': 2, 'b': 3, 'd': 3, 'a': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005716", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('caac') == 'ca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caac') == 'ca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005717", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[7, 5], [2], [4, 1], [3, 4], [4, 7, 3]]) == [7, 5, 2, 4, 1, 3, 4, 4, 7, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 5], [2], [4, 1], [3, 4], [4, 7, 3]]) == [7, 5, 2, 4, 1, 3, 4, 4, 7, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005718", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(611432) == 781\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(611432) == 781\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005719", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 9, 'y': 5, 'x': 8}, {'y': 6}) == {'w': 9, 'y': 11, 'x': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9, 'y': 5, 'x': 8}, {'y': 6}) == {'w': 9, 'y': 11, 'x': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005720", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([9, 6, 9, 6, 4], [2, 8, 8, 3, 1]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 6, 9, 6, 4], [2, 8, 8, 3, 1]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005721", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 69, 'e': 30}) == {69: 'a', 30: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 69, 'e': 30}) == {69: 'a', 30: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005722", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 3}, {'w': 7, 'y': 8, 'z': 2}) == {'w': 10, 'y': 8, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 3}, {'w': 7, 'y': 8, 'z': 2}) == {'w': 10, 'y': 8, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005723", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('dddddccccccccccccc') == 'd5c13'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddccccccccccccc') == 'd5c13'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005724", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-23, -6, -10, -46, 41, 26]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-23, -6, -10, -46, 41, 26]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005725", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([38, 50, 41, 15, 45]) == [15, 38, 41, 45, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([38, 50, 41, 15, 45]) == [15, 38, 41, 45, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005726", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([9, 5, 35, 26, 22, 30]) == [5, 9, 22, 26, 30, 35]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 5, 35, 26, 22, 30]) == [5, 9, 22, 26, 30, 35]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005727", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('2h52m51s') == 10371\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h52m51s') == 10371\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005728", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 8, 3, 2, 0, 3, 6], [8, 9, 1, 2]) == [8, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 8, 3, 2, 0, 3, 6], [8, 9, 1, 2]) == [8, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005729", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[2, 8, 7], [4, 9, 7], [5, 5, 3]]) == [[2, 4, 5], [8, 9, 5], [7, 7, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 8, 7], [4, 9, 7], [5, 5, 3]]) == [[2, 4, 5], [8, 9, 5], [7, 7, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005730", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(399) == 120\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(399) == 120\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005731", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('cbbbab', 'cca') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbbbab', 'cca') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005732", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([0, 2, [6], 5, [1, 8, 4, 3]]) == [0, 2, 6, 5, 1, 8, 4, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, 2, [6], 5, [1, 8, 4, 3]]) == [0, 2, 6, 5, 1, 8, 4, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005733", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 2, 1, 3, 0, 1, 3, 1, 1, 4, 4, 1]) == [4, 2, 1, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 1, 3, 0, 1, 3, 1, 1, 4, 4, 1]) == [4, 2, 1, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005734", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 3, 1, 4]) == [3, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 1, 4]) == [3, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005735", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([4, 8, 58, 86], 58) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 8, 58, 86], 58) == 2\nassert binary_search([4, 8, 58, 86], 4) == 0\nassert binary_search([4, 8, 58, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005736", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('pugzoxgw') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('pugzoxgw') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005737", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(21, 44) == 924\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 44) == 924\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005738", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([44, 32, 17, 5, 22, 47, 1, 0]) == [0, 1, 5, 17, 22, 32, 44, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([44, 32, 17, 5, 22, 47, 1, 0]) == [0, 1, 5, 17, 22, 32, 44, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005739", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(')([ab') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')([ab') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005740", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(12, 36) == 36\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(12, 36) == 36\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005741", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([25, 7, 35, 41, 38, 14, 24, 22, 35, 46, 37]) == [7, 14, 22, 24, 25, 35, 35, 37, 38, 41, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([25, 7, 35, 41, 38, 14, 24, 22, 35, 46, 37]) == [7, 14, 22, 24, 25, 35, 35, 37, 38, 41, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005742", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(320) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(320) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005743", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abacbbcabcbacaaa', 'cc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abacbbcabcbacaaa', 'cc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005744", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'a', 'd', 'b', 'c', 'a', 'c', 'b', 'e', 'b']) == {'e': 2, 'a': 2, 'd': 1, 'b': 3, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'd', 'b', 'c', 'a', 'c', 'b', 'e', 'b']) == {'e': 2, 'a': 2, 'd': 1, 'b': 3, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005745", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([6, 14, -20, 8, -42, 41]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([6, 14, -20, 8, -42, 41]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005746", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(4525) == 5254\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4525) == 5254\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005747", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens(')]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005748", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[[3, 2, 6], [6, 1], [5, 2, 7]]]) == 32\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[3, 2, 6], [6, 1], [5, 2, 7]]]) == 32\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005749", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran the, sun The ran the the ran') == {'ran': 3, 'the': 4, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran the, sun The ran the the ran') == {'ran': 3, 'the': 4, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005750", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('abaceadb') == 'abced'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abaceadb') == 'abced'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005751", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'apple', 'apple', 'avocado', 'banana', 'avocado', 'berry']) == {'b': ['banana', 'banana', 'berry'], 'a': ['apple', 'apple', 'avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'apple', 'avocado', 'banana', 'avocado', 'berry']) == {'b': ['banana', 'banana', 'berry'], 'a': ['apple', 'apple', 'avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005752", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([23, 22, 43, 37, 34]) == [22, 23, 34, 37, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([23, 22, 43, 37, 34]) == [22, 23, 34, 37, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005753", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([6, 8, 7, 8, 0, 7, 3], [6, 5, 9, 0, 6, 0, 7, 8]) == [6, 8, 7, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 8, 7, 8, 0, 7, 3], [6, 5, 9, 0, 6, 0, 7, 8]) == [6, 8, 7, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005754", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(396) == 'CCCXCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(396) == 'CCCXCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005755", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[2], [8], [3, 8, 8], [3, 7], [0, 2, 6, 9]]) == [2, 8, 3, 8, 8, 3, 7, 0, 2, 6, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2], [8], [3, 8, 8], [3, 7], [0, 2, 6, 9]]) == [2, 8, 3, 8, 8, 3, 7, 0, 2, 6, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005756", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 7, 7, 5, 2, 3, 0, 7, 3], 9) == [1, 7, 7, 5, 2, 3, 0, 7, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 7, 7, 5, 2, 3, 0, 7, 3], 9) == [1, 7, 7, 5, 2, 3, 0, 7, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005757", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[1, 6, 7, 7], [7, 1, 4, 4], [4, 9, 8, 9]]) == [[1, 7, 4], [6, 1, 9], [7, 4, 8], [7, 4, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 6, 7, 7], [7, 1, 4, 4], [4, 9, 8, 9]]) == [[1, 7, 4], [6, 1, 9], [7, 4, 8], [7, 4, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005758", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 8], [1, 9]]) == [[6, 1], [8, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 8], [1, 9]]) == [[6, 1], [8, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005759", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['date', 'coconut', 'coconut', 'date']) == {'d': ['date', 'date'], 'c': ['coconut', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'coconut', 'coconut', 'date']) == {'d': ['date', 'date'], 'c': ['coconut', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005760", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 5, 5, 2, 8, 0, 3], [6, 0, 0, 2, 9, 5, 8]) == [8, 5, 2, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 5, 5, 2, 8, 0, 3], [6, 0, 0, 2, 9, 5, 8]) == [8, 5, 2, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005761", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-5, -7], [1, 5], [-8, 4]], [[2, 5], [0, 0], [-3, -1]]) == [[-3, -2], [1, 5], [-11, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, -7], [1, 5], [-8, 4]], [[2, 5], [0, 0], [-3, -1]]) == [[-3, -2], [1, 5], [-11, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005762", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(199) == 991\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(199) == 991\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005763", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('bceaa') == 'bcea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bceaa') == 'bcea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005764", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(3617) == 'MMMDCXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3617) == 'MMMDCXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005765", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 0, 1, 7, 5, 6], 2) == [[8, 0], [1, 7], [5, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 0, 1, 7, 5, 6], 2) == [[8, 0], [1, 7], [5, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005766", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eaee') == 'ea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eaee') == 'ea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005767", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'banana', 'avocado', 'banana']) == {'a': ['avocado', 'avocado'], 'b': ['banana', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'banana', 'avocado', 'banana']) == {'a': ['avocado', 'avocado'], 'b': ['banana', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005768", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('cbbbbc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbbbbc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005769", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('zrxdavbbulx') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('zrxdavbbulx') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005770", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('aacbbcaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aacbbcaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005771", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Python World', 4) == 'Tcxlsr Asvph'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python World', 4) == 'Tcxlsr Asvph'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005772", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([7, [5], [8, 5, 7]]) == [7, 5, 8, 5, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([7, [5], [8, 5, 7]]) == [7, 5, 8, 5, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005773", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([4, 6, 19, 10, 43]) == [4, 6, 10, 19, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([4, 6, 19, 10, 43]) == [4, 6, 10, 19, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005774", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[4, 2], [8, 2], [3, 9]]) == [[4, 8, 3], [2, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 2], [8, 2], [3, 9]]) == [[4, 8, 3], [2, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005775", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 2}, {'x': 4, 'w': 2}) == {'y': 2, 'x': 4, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2}, {'x': 4, 'w': 2}) == {'y': 2, 'x': 4, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005776", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 7, 9, 1, 8, 5, 7, 7], 3) == [[8, 7, 9], [1, 8, 5], [7, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 7, 9, 1, 8, 5, 7, 7], 3) == [[8, 7, 9], [1, 8, 5], [7, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005777", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([19, 19, 2, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([19, 19, 2, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005778", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[3, 1]]) == [3, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[3, 1]]) == [3, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005779", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(79) == [79]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(79) == [79]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005780", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'c': 4, 'd': 6, 'e': 10}, 6) == {'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 4, 'd': 6, 'e': 10}, 6) == {'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005781", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog dog dog. dog ran sat Sun sun sat the.') == {'dog': 4, 'ran': 1, 'sat': 2, 'sun': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog dog dog. dog ran sat Sun sun sat the.') == {'dog': 4, 'ran': 1, 'sat': 2, 'sun': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005782", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(30, 113, 249) == 144\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(30, 113, 249) == 144\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005783", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(3656) == 6563\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3656) == 6563\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005784", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[[6, 0, 1], [1, 7, 3]], [[9]]]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[6, 0, 1], [1, 7, 3]], [[9]]]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005785", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([17, 24, 3, 46, 18, 49]) == [3, 17, 18, 24, 46, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([17, 24, 3, 46, 18, 49]) == [3, 17, 18, 24, 46, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005786", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 83, 'b': 91, 'a': 73, 'e': 99}) == {83: 'd', 91: 'b', 73: 'a', 99: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 83, 'b': 91, 'a': 73, 'e': 99}) == {83: 'd', 91: 'b', 73: 'a', 99: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005787", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([9]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005788", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'a': 9, 'd': 10, 'c': 8}, 2) == {'a': 9, 'd': 10, 'c': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 9, 'd': 10, 'c': 8}, 2) == {'a': 9, 'd': 10, 'c': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005789", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([42, 39, 1]) == [1, 39, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 39, 1]) == [1, 39, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005790", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(3); s.push(74); s.push(37)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(3); s.push(74); s.push(37)\nassert s.peek() == 37\nassert s.pop() == 37\nassert s.pop() == 74\nassert s.is_empty() == False\nassert s.pop() == 3\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005791", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([28, 17, 47, 43, 19, 0, 13, 21]) == [0, 13, 17, 19, 21, 28, 43, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([28, 17, 47, 43, 19, 0, 13, 21]) == [0, 13, 17, 19, 21, 28, 43, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005792", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbabbbb', 'bbb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabbbb', 'bbb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005793", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[1, -1, -3, 8], [-2, 3, 9, 3], [9, -2, -1, -2], [5, 1, 3, 6]], [[5, 3, 3, -1], [3, 7, -1, 1], [-7, 7, -5, -4], [-8, 2, 6, -8]]) == [[6, 2, 0, 7], [1, 10, 8, 4], [2, 5, -6, -6], [-3, 3, 9, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -1, -3, 8], [-2, 3, 9, 3], [9, -2, -1, -2], [5, 1, 3, 6]], [[5, 3, 3, -1], [3, 7, -1, 1], [-7, 7, -5, -4], [-8, 2, 6, -8]]) == [[6, 2, 0, 7], [1, 10, 8, 4], [2, 5, -6, -6], [-3, 3, 9, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005794", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(34) == 'XXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(34) == 'XXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005795", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[1, 5], 4, [7, 7, 1], 1, 7]) == [1, 5, 4, 7, 7, 1, 1, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 5], 4, [7, 7, 1], 1, 7]) == [1, 5, 4, 7, 7, 1, 1, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005796", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'d': 0, 'b': 9}, 7) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 0, 'b': 9}, 7) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005797", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 2, 2, 4, 1, 0, 1, 3]) == [2, 4, 1, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 2, 4, 1, 0, 1, 3]) == [2, 4, 1, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005798", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 22, 'f': 48, 'd': 60, 'a': 65}) == {22: 'c', 48: 'f', 60: 'd', 65: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 22, 'f': 48, 'd': 60, 'a': 65}) == {22: 'c', 48: 'f', 60: 'd', 65: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005799", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([1, 3, 3, 5, 2, 0, 8, 8, 2, 2], 2) == [[1, 3], [3, 5], [2, 0], [8, 8], [2, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 3, 5, 2, 0, 8, 8, 2, 2], 2) == [[1, 3], [3, 5], [2, 0], [8, 8], [2, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005800", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(1556) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1556) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005801", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([6]) == [6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([6]) == [6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005802", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 9, 6, 1], 2) == [[4, 9], [6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 9, 6, 1], 2) == [[4, 9], [6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005803", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(5135) == 5315\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5135) == 5315\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005804", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([26, 24, 26, 26, 29, 26]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 24, 26, 26, 29, 26]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005805", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('c feefgege eaacfebb hg afb h') == 'feefgege'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('c feefgege eaacfebb hg afb h') == 'feefgege'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005806", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 4, 4, 1, 4]) == [2, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 4, 1, 4]) == [2, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005807", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMMDCCLIV') == 3754\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCCLIV') == 3754\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005808", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(12) == 9\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(12) == 9\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005809", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['a', 'd', 'a', 'a', 'e', 'a', 'b', 'b']) == {'a': 4, 'd': 1, 'e': 1, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'a', 'a', 'e', 'a', 'b', 'b']) == {'a': 4, 'd': 1, 'e': 1, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005810", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([9]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005811", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'d': 8, 'a': 1}, 2) == {'d': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 8, 'a': 1}, 2) == {'d': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005812", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ecebdbebcb') == 'ecbd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecebdbebcb') == 'ecbd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005813", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('aa]]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('aa]]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005814", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([44, 9, 4, 10, 4, 2]) == [2, 4, 4, 9, 10, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 9, 4, 10, 4, 2]) == [2, 4, 4, 9, 10, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005815", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('{]a])') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{]a])') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005816", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([34, 9, 16]) == [9, 16, 34]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([34, 9, 16]) == [9, 16, 34]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005817", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[2, 1, 7], 1]) == [2, 1, 7, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2, 1, 7], 1]) == [2, 1, 7, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005818", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(37); s.push(36); s.push(39)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(37); s.push(36); s.push(39)\nassert s.peek() == 39\nassert s.pop() == 39\nassert s.pop() == 36\nassert s.is_empty() == False\nassert s.pop() == 37\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005819", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('decacb e ba cbae') == 'Decacb E Ba Cbae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('decacb e ba cbae') == 'Decacb E Ba Cbae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005820", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(9669) == 9669\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(9669) == 9669\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005821", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 5, 7, 0, 9, 4, 8, 4, 8, 4], 7) == [0, 9, 4, 8, 4, 8, 4, 6, 5, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 5, 7, 0, 9, 4, 8, 4, 8, 4], 7) == [0, 9, 4, 8, 4, 8, 4, 6, 5, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005822", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(807831) == 898\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(807831) == 898\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005823", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran the sun sun sun') == {'ran': 1, 'the': 1, 'sun': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran the sun sun sun') == {'ran': 1, 'the': 1, 'sun': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005824", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(276) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(276) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005825", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[3, 5, 2], [3, 1, 4]], [[3, 1, 2], [5, 4, 2], [1, 3, 1]]) == [[36, 29, 18], [18, 19, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 5, 2], [3, 1, 4]], [[3, 1, 2], [5, 4, 2], [1, 3, 1]]) == [[36, 29, 18], [18, 19, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005826", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 10, 'c': 7}, 7) == {'a': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 10, 'c': 7}, 7) == {'a': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005827", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([33, 0, 14, 41, 33, 8, 9, 4, 19, 11, 13, 26]) == [0, 4, 8, 9, 11, 13, 14, 19, 26, 33, 33, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([33, 0, 14, 41, 33, 8, 9, 4, 19, 11, 13, 26]) == [0, 4, 8, 9, 11, 13, 14, 19, 26, 33, 33, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005828", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(40, 20) == 20\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(40, 20) == 20\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005829", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=auto; path=926; user=on; mode=off') == {'port': 'auto', 'path': '926', 'user': 'on', 'mode': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; path=926; user=on; mode=off') == {'port': 'auto', 'path': '926', 'user': 'on', 'mode': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005830", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['cay', 'caxzz']) == 'ca'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cay', 'caxzz']) == 'ca'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005831", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 3, 5, 3, 2, 6, 4, 0], [0, 5, 5, 3, 3, 6, 7]) == [3, 5, 6, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 3, 5, 3, 2, 6, 4, 0], [0, 5, 5, 3, 3, 6, 7]) == [3, 5, 6, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005832", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(579352) == 761\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(579352) == 761\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005833", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([32, 45, 33, 26, 40]) == [26, 32, 33, 40, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 45, 33, 26, 40]) == [26, 32, 33, 40, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005834", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=764; mode=620; port=on; user=off') == {'path': '764', 'mode': '620', 'port': 'on', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=764; mode=620; port=on; user=off') == {'path': '764', 'mode': '620', 'port': 'on', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005835", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([1, 5, 11, 12, 22, 42, 49, 63, 67, 79, 87, 90], 145) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 5, 11, 12, 22, 42, 49, 63, 67, 79, 87, 90], 145) == -1\nassert binary_search([1, 5, 11, 12, 22, 42, 49, 63, 67, 79, 87, 90], 1) == 0\nassert binary_search([1, 5, 11, 12, 22, 42, 49, 63, 67, 79, 87, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005836", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([25, 33, 13, 40, 3, 45, 1, 28, 32, 28, 41]) == [1, 3, 13, 25, 28, 28, 32, 33, 40, 41, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([25, 33, 13, 40, 3, 45, 1, 28, 32, 28, 41]) == [1, 3, 13, 25, 28, 28, 32, 33, 40, 41, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005837", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[3, 4, 4]]) == 11\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[3, 4, 4]]) == 11\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005838", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2469) == 'MMCDLXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2469) == 'MMCDLXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005839", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(500) == 110\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(500) == 110\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005840", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Sat sat! Dog the dog sat ran ran, Cat The') == {'sat': 3, 'dog': 2, 'the': 2, 'ran': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Sat sat! Dog the dog sat ran ran, Cat The') == {'sat': 3, 'dog': 2, 'the': 2, 'ran': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005841", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('cbecbbbbd') == 'cbed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbecbbbbd') == 'cbed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005842", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[9], [5, 5, 3]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9], [5, 5, 3]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005843", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=107; path=on') == {'port': '107', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=107; path=on') == {'port': '107', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005844", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([1, -3, 9, -8, -2, -2, 9]) == [1, -2, 7, -1, -3, -5, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, -3, 9, -8, -2, -2, 9]) == [1, -2, 7, -1, -3, -5, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005845", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(925515) == 962\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(925515) == 962\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005846", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccbb') == 'c2b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccbb') == 'c2b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005847", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(2, 4) == 16\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 4) == 16\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005848", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([7, 10, 12], [1, 7, 8, 19]) == [1, 7, 7, 8, 10, 12, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7, 10, 12], [1, 7, 8, 19]) == [1, 7, 7, 8, 10, 12, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005849", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cffcbb', 'bccbff') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cffcbb', 'bccbff') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005850", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXXVIII') == 278\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXVIII') == 278\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005851", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=on; user=123') == {'mode': 'on', 'user': '123'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; user=123') == {'mode': 'on', 'user': '123'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005852", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(570) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(570) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005853", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(10); s.push(6); s.push(81)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(10); s.push(6); s.push(81)\nassert s.peek() == 81\nassert s.pop() == 81\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 10\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005854", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(59, 54) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 54) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005855", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(171) == [3, 3, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(171) == [3, 3, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005856", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCCLXX') == 370\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXX') == 370\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005857", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'z': 7, 'y': 3}) == {'y': 4, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'z': 7, 'y': 3}) == {'y': 4, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005858", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('eccbeddb') == 'ecbd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eccbeddb') == 'ecbd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005859", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[1, -3], [1, 5], [7, 7]], [[-9, -4], [9, -8], [6, 0]]) == [[-8, -7], [10, -3], [13, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -3], [1, 5], [7, 7]], [[-9, -4], [9, -8], [6, 0]]) == [[-8, -7], [10, -3], [13, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005860", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(2762) == 2672\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2762) == 2672\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005861", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([3, 3, 5, 6, 0, 5, 3, 0], [3, 3, 2, 4, 0]) == [3, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 3, 5, 6, 0, 5, 3, 0], [3, 3, 2, 4, 0]) == [3, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005862", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([5, 7, 7, 7], 2) == [[5, 7], [7, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 7, 7, 7], 2) == [[5, 7], [7, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005863", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('decdacbccadca') == 'decab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('decdacbccadca') == 'decab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005864", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([48, 40, 5]) == [5, 40, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([48, 40, 5]) == [5, 40, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005865", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[0, 3, 0], [1, 1, 5], [4, 3, 4]], [[2, 4, 1], [1, 5, 0], [4, 0, 5]]) == [[3, 15, 0], [23, 9, 26], [27, 31, 24]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3, 0], [1, 1, 5], [4, 3, 4]], [[2, 4, 1], [1, 5, 0], [4, 0, 5]]) == [[3, 15, 0], [23, 9, 26], [27, 31, 24]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005866", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('faafad', 'faafada') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('faafad', 'faafada') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005867", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([34, 31, 48, 45, 45, 33, 8, 35, 28, 30]) == [8, 28, 30, 31, 33, 34, 35, 45, 45, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 31, 48, 45, 45, 33, 8, 35, 28, 30]) == [8, 28, 30, 31, 33, 34, 35, 45, 45, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005868", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([3, [2, 1, 1]]) == [3, 2, 1, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [2, 1, 1]]) == [3, 2, 1, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005869", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(396)\nacc.deposit(79)\nacc.withdraw(219)\nacc.withdraw(590)\nassert acc.get_balance() == 475\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(396)\nacc.deposit(79)\nassert acc.get_balance() == 475\nacc.withdraw(219)\nassert acc.get_balance() == 256\nacc.withdraw(590)\nassert acc.get_balance() == 256\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005870", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'avocado', 'coconut']) == {'b': ['berry'], 'a': ['avocado'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'avocado', 'coconut']) == {'b': ['berry'], 'a': ['avocado'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005871", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([45, 43, 3, 31]) == [3, 31, 43, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([45, 43, 3, 31]) == [3, 31, 43, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005872", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 2, 2, 5, 14], [3, 7]) == [0, 2, 2, 3, 5, 7, 14]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 2, 2, 5, 14], [3, 7]) == [0, 2, 2, 3, 5, 7, 14]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005873", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([38, 36, 8, 17, 25, 12, 18, 20]) == [8, 12, 17, 18, 20, 25, 36, 38]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([38, 36, 8, 17, 25, 12, 18, 20]) == [8, 12, 17, 18, 20, 25, 36, 38]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005874", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 1, 5, 7, 8], [3, 1, 9, 3, 9, 6, 3, 4]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 1, 5, 7, 8], [3, 1, 9, 3, 9, 6, 3, 4]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005875", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('cdba') == 'cdba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdba') == 'cdba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005876", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('{()[]{}}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{()[]{}}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005877", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[5, 1, 2]]) == [5, 1, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 1, 2]]) == [5, 1, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005878", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 1, 9, 3, 5], [5, 8, 7, 6, 0, 3]) == [8, 3, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 1, 9, 3, 5], [5, 8, 7, 6, 0, 3]) == [8, 3, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005879", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 5, 7, 5, 1, 0, 9, 5, 0], 3) == [[6, 5, 7], [5, 1, 0], [9, 5, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 5, 7, 5, 1, 0, 9, 5, 0], 3) == [[6, 5, 7], [5, 1, 0], [9, 5, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005880", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=783; user=auto') == {'path': '783', 'user': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=783; user=auto') == {'path': '783', 'user': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005881", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(49) == 24\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(49) == 24\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005882", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('xyz', 18) == 'pqr'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 18) == 'pqr'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005883", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('edbdaedcbdca') == 'edbac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edbdaedcbdca') == 'edbac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005884", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([39, 21, 3, 31, 5, 45, 30, 12]) == [3, 5, 12, 21, 30, 31, 39, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([39, 21, 3, 31, 5, 45, 30, 12]) == [3, 5, 12, 21, 30, 31, 39, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005885", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9, 1], [7, 0, 2, 6]]) == [9, 1, 7, 0, 2, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 1], [7, 0, 2, 6]]) == [9, 1, 7, 0, 2, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005886", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(1719) == 41\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1719) == 41\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005887", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('da,a,ab') == ['da', 'a', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('da,a,ab') == ['da', 'a', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005888", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 1, 2, 4, 13, 14, 20], [5, 7, 7, 16]) == [0, 1, 2, 4, 5, 7, 7, 13, 14, 16, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 2, 4, 13, 14, 20], [5, 7, 7, 16]) == [0, 1, 2, 4, 5, 7, 7, 13, 14, 16, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005889", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(407) == 'CDVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(407) == 'CDVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005890", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(860248) == 927\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(860248) == 927\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005891", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(8605) == 5068\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8605) == 5068\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005892", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([29, 34, 36, 27, 29, 26, 45, 48]) == [26, 27, 29, 29, 34, 36, 45, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([29, 34, 36, 27, 29, 26, 45, 48]) == [26, 27, 29, 29, 34, 36, 45, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005893", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('3m33s') == 213\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3m33s') == 213\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005894", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(5067) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5067) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005895", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['date', 'banana', 'berry', 'berry']) == {'d': ['date'], 'b': ['banana', 'berry', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'banana', 'berry', 'berry']) == {'d': ['date'], 'b': ['banana', 'berry', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005896", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(201) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(201) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005897", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[8, -4], [0, -7]], [[-3, -2], [9, 3]]) == [[5, -6], [9, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -4], [0, -7]], [[-3, -2], [9, 3]]) == [[5, -6], [9, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005898", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('83,eeba,d,ee') == ['83', 'eeba', 'd', 'ee']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('83,eeba,d,ee') == ['83', 'eeba', 'd', 'ee']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005899", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'a': 4, 'b': 8}, 6) == {'b': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 4, 'b': 8}, 6) == {'b': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005900", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([3, 7, 1, 2]) == [3, 10, 11, 13]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 7, 1, 2]) == [3, 10, 11, 13]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005901", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(63); s.push(13); s.push(5)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(63); s.push(13); s.push(5)\nassert s.peek() == 5\nassert s.pop() == 5\nassert s.pop() == 13\nassert s.is_empty() == False\nassert s.pop() == 63\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005902", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(48) == 'XLVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(48) == 'XLVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005903", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('bebbbd facae cee egbhgh a ggfhfdgh') == 'ggfhfdgh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bebbbd facae cee egbhgh a ggfhfdgh') == 'ggfhfdgh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005904", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[9, 4]]) == [9, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[9, 4]]) == [9, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005905", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(1200) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1200) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005906", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(164) == 11\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(164) == 11\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005907", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ddaddcb') == 'dacb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddaddcb') == 'dacb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005908", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(14) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(14) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005909", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[2, 9], [0, 6]], [[8, 5], [-6, -2]]) == [[10, 14], [-6, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, 9], [0, 6]], [[8, 5], [-6, -2]]) == [[10, 14], [-6, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005910", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([35, 18, 7, 25, 33, 42]) == [7, 18, 25, 33, 35, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 18, 7, 25, 33, 42]) == [7, 18, 25, 33, 35, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005911", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('cdabddbd') == 'cdab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdabddbd') == 'cdab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005912", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(44) == 'XLIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(44) == 'XLIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005913", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('fcb', 'fcbd') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fcb', 'fcbd') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005914", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[0, 5], [2, 9]], [[0, 2], [2, -3]]) == [[0, 7], [4, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, 5], [2, 9]], [[0, 2], [2, -3]]) == [[0, 7], [4, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005915", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([25, 30, 30, 44, 41, 28, 7, 20]) == [7, 20, 25, 28, 30, 30, 41, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 30, 30, 44, 41, 28, 7, 20]) == [7, 20, 25, 28, 30, 30, 41, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005916", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aebbeeeb') == 'aeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aebbeeeb') == 'aeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005917", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([5, 39, 47, 55, 63, 73, 84, 94], 39) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 39, 47, 55, 63, 73, 84, 94], 39) == 1\nassert binary_search([5, 39, 47, 55, 63, 73, 84, 94], 5) == 0\nassert binary_search([5, 39, 47, 55, 63, 73, 84, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005918", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'banana', 'berry', 'date', 'banana', 'berry', 'avocado']) == {'b': ['berry', 'banana', 'berry', 'banana', 'berry'], 'd': ['date'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'berry', 'date', 'banana', 'berry', 'avocado']) == {'b': ['berry', 'banana', 'berry', 'banana', 'berry'], 'd': ['date'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005919", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 65, 'b': 6, 'f': 54}) == {65: 'a', 6: 'b', 54: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 65, 'b': 6, 'f': 54}) == {65: 'a', 6: 'b', 54: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005920", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(27, 6) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(27, 6) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005921", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(38, 160, 508) == 200\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(38, 160, 508) == 200\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005922", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([4, 2, [1]]) == [4, 2, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([4, 2, [1]]) == [4, 2, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005923", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[]]{b[)a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]]{b[)a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005924", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(662806) == 814\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(662806) == 814\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005925", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('49,30,e,c') == ['49', '30', 'e', 'c']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('49,30,e,c') == ['49', '30', 'e', 'c']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005926", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'apple', 'cherry', 'apple', 'coconut', 'berry']) == {'c': ['cherry', 'cherry', 'coconut'], 'b': ['berry', 'berry'], 'a': ['apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'apple', 'cherry', 'apple', 'coconut', 'berry']) == {'c': ['cherry', 'cherry', 'coconut'], 'b': ['berry', 'berry'], 'a': ['apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005927", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-9, -4, -1, 7, 6, 8, 3, 3]) == [-9, -13, -14, -7, -1, 7, 10, 13]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-9, -4, -1, 7, 6, 8, 3, 3]) == [-9, -13, -14, -7, -1, 7, 10, 13]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005928", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(114) == 33\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(114) == 33\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005929", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(9784) == 98\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9784) == 98\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005930", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 0, 7, 8], [4, 8, 9, 9]]) == [[6, 4], [0, 8], [7, 9], [8, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 0, 7, 8], [4, 8, 9, 9]]) == [[6, 4], [0, 8], [7, 9], [8, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005931", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([49, 0, 48, 35, 32, 10]) == [0, 10, 32, 35, 48, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([49, 0, 48, 35, 32, 10]) == [0, 10, 32, 35, 48, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_005932", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([3, 9, 4, 8], 1) == [8, 3, 9, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 9, 4, 8], 1) == [8, 3, 9, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005933", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([9, 13, 16], [2, 9, 11, 12, 13]) == [2, 9, 9, 11, 12, 13, 13, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([9, 13, 16], [2, 9, 11, 12, 13]) == [2, 9, 9, 11, 12, 13, 13, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005934", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabbbaab', 'bba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbbaab', 'bba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005935", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([6, [0, 8], [9], [3, 9, 2, 9], [2, 1, 4]]) == [6, 0, 8, 9, 3, 9, 2, 9, 2, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [0, 8], [9], [3, 9, 2, 9], [2, 1, 4]]) == [6, 0, 8, 9, 3, 9, 2, 9, 2, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005936", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('fahgypxgkvbp') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('fahgypxgkvbp') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005937", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([20, 43, 5, 12, 41, 31]) == [5, 12, 20, 31, 41, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 43, 5, 12, 41, 31]) == [5, 12, 20, 31, 41, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005938", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(867) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(867) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005939", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 7, 7, 7, 9, 8], [2, 3, 3, 3, 6, 9, 3, 6]) == [2, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 7, 7, 9, 8], [2, 3, 3, 3, 6, 9, 3, 6]) == [2, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005940", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 5, 5, 5], [1, 4, 3, 7]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 5, 5, 5], [1, 4, 3, 7]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005941", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bcdbccb') == 'bcd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcdbccb') == 'bcd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005942", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([1, 9, 8, 1, 4, 7, 7, 5], 2) == [[1, 9], [8, 1], [4, 7], [7, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 9, 8, 1, 4, 7, 7, 5], 2) == [[1, 9], [8, 1], [4, 7], [7, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005943", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([23, 30, 45, 24, 2, 16]) == [2, 16, 23, 24, 30, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 30, 45, 24, 2, 16]) == [2, 16, 23, 24, 30, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005944", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([46, 33, 10, 38]) == [10, 33, 38, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([46, 33, 10, 38]) == [10, 33, 38, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005945", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbabaaba', 'bb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabaaba', 'bb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005946", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([30, 1, 36, 40, 47]) == [1, 30, 36, 40, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 1, 36, 40, 47]) == [1, 30, 36, 40, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005947", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'cherry', 'berry', 'apple']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'cherry', 'berry', 'apple']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005948", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(5 + 7 - (8 + 18))') == -14\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(5 + 7 - (8 + 18))') == -14\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005949", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=918; path=261; user=601; host=on') == {'mode': '918', 'path': '261', 'user': '601', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=918; path=261; user=601; host=on') == {'mode': '918', 'path': '261', 'user': '601', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005950", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('ababaabbaab', 'aab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababaabbaab', 'aab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005951", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5, 8], 0, [4, 4, 4, 5], [4, 6, 0, 6], 3]) == [5, 8, 0, 4, 4, 4, 5, 4, 6, 0, 6, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 8], 0, [4, 4, 4, 5], [4, 6, 0, 6], 3]) == [5, 8, 0, 4, 4, 4, 5, 4, 6, 0, 6, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005952", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('ada', 'ada') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ada', 'ada') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005953", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('33m3s') == 1983\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('33m3s') == 1983\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005954", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([0, [6, 3, 1], [9, 9, 4]]) == 32\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, [6, 3, 1], [9, 9, 4]]) == 32\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005955", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(2616) == 6162\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2616) == 6162\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005956", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([9, 6]) == [9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 6]) == [9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005957", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([38, 26, 49, 18, 3, 41, 5, 12, 3, 48, 43]) == [3, 3, 5, 12, 18, 26, 38, 41, 43, 48, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([38, 26, 49, 18, 3, 41, 5, 12, 3, 48, 43]) == [3, 3, 5, 12, 18, 26, 38, 41, 43, 48, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005958", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCCVIII') == 308\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCVIII') == 308\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005959", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('eaeeba cfbc') == 'eaeeba'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('eaeeba cfbc') == 'eaeeba'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005960", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbbaaabbbaabbba', 'ab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbaaabbbaabbba', 'ab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_005961", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([15, 22, 0, 17, 16, 5, 1, 18]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 22, 0, 17, 16, 5, 1, 18]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005962", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran sun cat cat the') == {'ran': 1, 'sun': 1, 'cat': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sun cat cat the') == {'ran': 1, 'sun': 1, 'cat': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005963", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(236) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(236) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005964", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CXXXIX') == 139\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXXIX') == 139\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005965", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(1129) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1129) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005966", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('cae,\",,\",ade,\"bb,a\"') == ['cae', ',,', 'ade', 'bb,a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cae,\",,\",ade,\"bb,a\"') == ['cae', ',,', 'ade', 'bb,a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005967", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(138, 86) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(138, 86) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005968", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[5], [8, 2, 0], [0, 5, 2]]) == [5, 8, 2, 0, 0, 5, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], [8, 2, 0], [0, 5, 2]]) == [5, 8, 2, 0, 0, 5, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005969", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('dgdcehbf efbdbcff hf ec gdbbgff gd') == 'dgdcehbf'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dgdcehbf efbdbcff hf ec gdbbgff gd') == 'dgdcehbf'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005970", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('19 * 3 + 19 + 14') == 90\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19 * 3 + 19 + 14') == 90\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005971", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 3, 4], [4, 8, 8]) == [4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 3, 4], [4, 8, 8]) == [4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005972", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([10, 13]) == 23\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([10, 13]) == 23\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005973", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(6788) == 8876\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6788) == 8876\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005974", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('dadaa aae') == 'Dadaa Aae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dadaa aae') == 'Dadaa Aae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005975", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat dog. the sun sat cat,') == {'sat': 2, 'dog': 1, 'the': 1, 'sun': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat dog. the sun sat cat,') == {'sat': 2, 'dog': 1, 'the': 1, 'sun': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005976", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[8, 9, 1], [2, -1, 5], [-4, 5, -7]], [[-9, 5, -4], [-7, -4, 8], [1, -8, -9]]) == [[-1, 14, -3], [-5, -5, 13], [-3, -3, -16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 9, 1], [2, -1, 5], [-4, 5, -7]], [[-9, 5, -4], [-7, -4, 8], [1, -8, -9]]) == [[-1, 14, -3], [-5, -5, 13], [-3, -3, -16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005977", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(3, 2) == 6\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(3, 2) == 6\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005978", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('[[{}{') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[[{}{') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005979", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(264) == [2, 2, 2, 3, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(264) == [2, 2, 2, 3, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005980", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 3, 7, 8, 9, 18, 19], [8]) == [1, 3, 7, 8, 8, 9, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 3, 7, 8, 9, 18, 19], [8]) == [1, 3, 7, 8, 8, 9, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005981", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 4, 2, 0, 0, 4]) == [3, 4, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 2, 0, 0, 4]) == [3, 4, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005982", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('kqmcpxzubtktns') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('kqmcpxzubtktns') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005983", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babab', 'ba') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babab', 'ba') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005984", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(94, 7) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(94, 7) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005985", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello Hello', 14) == 'Vszzc Vszzc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Hello', 14) == 'Vszzc Vszzc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005986", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat Dog cat, the. sun dog sun cat dog sun') == {'cat': 3, 'dog': 3, 'the': 1, 'sun': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat Dog cat, the. sun dog sun cat dog sun') == {'cat': 3, 'dog': 3, 'the': 1, 'sun': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005987", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaababbbb', 'aaab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaababbbb', 'aaab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_005988", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('bhfd hgffah aheahfb f') == 'aheahfb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bhfd hgffah aheahfb f') == 'aheahfb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005989", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(11, 6) == 66\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(11, 6) == 66\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005990", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 0, 'c': 29, 'f': 86}) == {0: 'e', 29: 'c', 86: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 0, 'c': 29, 'f': 86}) == {0: 'e', 29: 'c', 86: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005991", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=auto; path=754; user=297; port=off') == {'mode': 'auto', 'path': '754', 'user': '297', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=auto; path=754; user=297; port=off') == {'mode': 'auto', 'path': '754', 'user': '297', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005992", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('beagaae ca gcaea eaehbaba gaccfda') == 'eaehbaba'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('beagaae ca gcaea eaehbaba gaccfda') == 'eaehbaba'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005993", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(13, 24) == 312\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 24) == 312\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_005994", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([31, 44, 22, 38, 47, 19, 42, 40, 50, 20, 13]) == [13, 19, 20, 22, 31, 38, 40, 42, 44, 47, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([31, 44, 22, 38, 47, 19, 42, 40, 50, 20, 13]) == [13, 19, 20, 22, 31, 38, 40, 42, 44, 47, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005995", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=495; mode=126') == {'path': '495', 'mode': '126'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=495; mode=126') == {'path': '495', 'mode': '126'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005996", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('11 - 11 * 16') == -165\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('11 - 11 * 16') == -165\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_005997", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 4, 0, 4, 5, 5, 1, 2, 3, 5]) == [1, 4, 0, 5, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 0, 4, 5, 5, 1, 2, 3, 5]) == [1, 4, 0, 5, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_005998", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([13, 49, 40, 26, 43, 36, 38, 39, 44, 24, 32, 45]) == [13, 24, 26, 32, 36, 38, 39, 40, 43, 44, 45, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([13, 49, 40, 26, 43, 36, 38, 39, 44, 24, 32, 45]) == [13, 24, 26, 32, 36, 38, 39, 40, 43, 44, 45, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_005999", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('cat! sat. dog dog ran sat Cat cat! the') == {'cat': 3, 'sat': 2, 'dog': 2, 'ran': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat! sat. dog dog ran sat Cat cat! the') == {'cat': 3, 'sat': 2, 'dog': 2, 'ran': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006000", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([29, 15, 8, 29, 7, 15, 25]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 15, 8, 29, 7, 15, 25]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006001", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(2107) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2107) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006002", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(379) == 'CCCLXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(379) == 'CCCLXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006003", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 4, 'c': 9}, 6) == {'c': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 4, 'c': 9}, 6) == {'c': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006004", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbddddd') == 'b2d5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbddddd') == 'b2d5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006005", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 1], [0, 1], [2, 2]], [[2, 5], [3, 3]]) == [[9, 18], [3, 3], [10, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1], [0, 1], [2, 2]], [[2, 5], [3, 3]]) == [[9, 18], [3, 3], [10, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006006", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(6176) == 6716\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6176) == 6716\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006007", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(44); s.push(14); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(44); s.push(14); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 14\nassert s.is_empty() == False\nassert s.pop() == 44\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006008", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[4, 5], [7, 3], [2, 9], [5, 7]]) == [[4, 7, 2, 5], [5, 3, 9, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 5], [7, 3], [2, 9], [5, 7]]) == [[4, 7, 2, 5], [5, 3, 9, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006009", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(249) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(249) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006010", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([9, 4, 0]) == [9, 4, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 4, 0]) == [9, 4, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006011", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 5, 3, 6, 5, 7, 1, 4], 4) == [[2, 5, 3, 6], [5, 7, 1, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 3, 6, 5, 7, 1, 4], 4) == [[2, 5, 3, 6], [5, 7, 1, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006012", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([4, 25, 16, 23, 28, 35, 43, 39, 30, 12, 9]) == [4, 9, 12, 16, 23, 25, 28, 30, 35, 39, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([4, 25, 16, 23, 28, 35, 43, 39, 30, 12, 9]) == [4, 9, 12, 16, 23, 25, 28, 30, 35, 39, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006013", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([13, 19, 6, 22]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 19, 6, 22]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006014", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(2547) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2547) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006015", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(329888) == 574\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(329888) == 574\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006016", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([12], [0, 8, 11, 13]) == [0, 8, 11, 12, 13]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([12], [0, 8, 11, 13]) == [0, 8, 11, 12, 13]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006017", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([13, 17, 28, 53, 63, 70], 199) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 17, 28, 53, 63, 70], 199) == -1\nassert binary_search([13, 17, 28, 53, 63, 70], 13) == 0\nassert binary_search([13, 17, 28, 53, 63, 70], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006018", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 40, 'b': 88, 'd': 3, 'f': 93}) == {40: 'e', 88: 'b', 3: 'd', 93: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 40, 'b': 88, 'd': 3, 'f': 93}) == {40: 'e', 88: 'b', 3: 'd', 93: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006019", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([7, 21, 21, 11, 7, 39]) == [7, 7, 11, 21, 21, 39]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([7, 21, 21, 11, 7, 39]) == [7, 7, 11, 21, 21, 39]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006020", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-4, -8, 8], [4, -8, -7]], [[-2, 2, -1], [-2, 8, -5]]) == [[-6, -6, 7], [2, 0, -12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -8, 8], [4, -8, -7]], [[-2, 2, -1], [-2, 8, -5]]) == [[-6, -6, 7], [2, 0, -12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006021", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(191, 26) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(191, 26) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006022", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([6, 0, 5, 2], [5, 9, 7, 0, 2]) == [0, 5, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 0, 5, 2], [5, 9, 7, 0, 2]) == [0, 5, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006023", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('World', 17) == 'Nficu'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World', 17) == 'Nficu'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006024", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([38, 24, 11, 20, 33, 13]) == [11, 13, 20, 24, 33, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([38, 24, 11, 20, 33, 13]) == [11, 13, 20, 24, 33, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006025", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([35, 34, 25, 2, 22, 19, 32, 41, 29, 37, 47, 25, 7, 42]) == [2, 7, 19, 22, 25, 25, 29, 32, 34, 35, 37, 41, 42, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([35, 34, 25, 2, 22, 19, 32, 41, 29, 37, 47, 25, 7, 42]) == [2, 7, 19, 22, 25, 25, 29, 32, 34, 35, 37, 41, 42, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006026", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([33, 40, 18, 20, 41, 26, 17, 14]) == [14, 17, 18, 20, 26, 33, 40, 41]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([33, 40, 18, 20, 41, 26, 17, 14]) == [14, 17, 18, 20, 26, 33, 40, 41]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006027", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('h hdafgcg') == 'hdafgcg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('h hdafgcg') == 'hdafgcg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006028", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(5729) == 9275\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5729) == 9275\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006029", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abccbbabab', 'cccc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abccbbabab', 'cccc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006030", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[0, -1, 8, 9], [6, 1, 5, 5]], [[-2, 0, 1, -7], [-5, 8, -4, 2]]) == [[-2, -1, 9, 2], [1, 9, 1, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -1, 8, 9], [6, 1, 5, 5]], [[-2, 0, 1, -7], [-5, 8, -4, 2]]) == [[-2, -1, 9, 2], [1, 9, 1, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006031", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([0, 3, 7, 2, 7, 2, 0, 5, 1], 3) == [[0, 3, 7], [2, 7, 2], [0, 5, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 3, 7, 2, 7, 2, 0, 5, 1], 3) == [[0, 3, 7], [2, 7, 2], [0, 5, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006032", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([0, 11, 45, 15, 24, 38, 11, 44, 49, 33]) == [0, 11, 11, 15, 24, 33, 38, 44, 45, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 11, 45, 15, 24, 38, 11, 44, 49, 33]) == [0, 11, 11, 15, 24, 33, 38, 44, 45, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006033", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 7, 5, 3, 0, 7, 5], 3) == [0, 7, 5, 4, 7, 5, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 7, 5, 3, 0, 7, 5], 3) == [0, 7, 5, 4, 7, 5, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006034", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([4, 17, 30, 63], 30) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 17, 30, 63], 30) == 2\nassert binary_search([4, 17, 30, 63], 4) == 0\nassert binary_search([4, 17, 30, 63], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006035", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(22) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(22) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006036", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, [8, 0, 4, 9], 3, [8, 3]]) == [8, 8, 0, 4, 9, 3, 8, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [8, 0, 4, 9], 3, [8, 3]]) == [8, 8, 0, 4, 9, 3, 8, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006037", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([3, 21, 6, 21, 28, 6, 29]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 21, 6, 21, 28, 6, 29]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006038", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 1, 'z': 9, 'x': 5}, {'x': 1, 'z': 6}) == {'y': 1, 'z': 15, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1, 'z': 9, 'x': 5}, {'x': 1, 'z': 6}) == {'y': 1, 'z': 15, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006039", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([3, 25, 3, 23]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 25, 3, 23]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006040", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-8, -9, -5], [7, -4, -8]], [[-6, -5, 3], [9, 9, -4]]) == [[-14, -14, -2], [16, 5, -12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -9, -5], [7, -4, -8]], [[-6, -5, 3], [9, 9, -4]]) == [[-14, -14, -2], [16, 5, -12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006041", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[0, 6, 1], [9]], [[1, 5]], [7]]) == 29\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[0, 6, 1], [9]], [[1, 5]], [7]]) == 29\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006042", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[2, 0, 0], [1, 7], 3]]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[2, 0, 0], [1, 7], 3]]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006043", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 7) == 'efg'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 7) == 'efg'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006044", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMMDCCXXX') == 3730\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCCXXX') == 3730\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006045", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([6, 25, 9, 29, 9]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([6, 25, 9, 29, 9]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006046", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'c': 2, 'd': 3}, 3) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 2, 'd': 3}, 3) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006047", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([8, -4, 4, 0, 6, 6, -1, -9]) == [8, 4, 8, 8, 14, 20, 19, 10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([8, -4, 4, 0, 6, 6, -1, -9]) == [8, 4, 8, 8, 14, 20, 19, 10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006048", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('\"aa,b\",27,ba') == ['aa,b', '27', 'ba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"aa,b\",27,ba') == ['aa,b', '27', 'ba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006049", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ccbcc') == 'cb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ccbcc') == 'cb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006050", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([7, 6, 3, 3, 0, 6, 1, 4, 8, 8], 3) == [[7, 6, 3], [3, 0, 6], [1, 4, 8], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 6, 3, 3, 0, 6, 1, 4, 8, 8], 3) == [[7, 6, 3], [3, 0, 6], [1, 4, 8], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006051", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[2, 3, 3], [0, 1, 0]], [[4, 3], [3, 3], [4, 3]]) == [[29, 24], [3, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 3, 3], [0, 1, 0]], [[4, 3], [3, 3], [4, 3]]) == [[29, 24], [3, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006052", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([38, 45, 20, 49, 39, 38, 20, 0]) == [0, 20, 20, 38, 38, 39, 45, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([38, 45, 20, 49, 39, 38, 20, 0]) == [0, 20, 20, 38, 38, 39, 45, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006053", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'a': 4, 'e': 5}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 4, 'e': 5}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006054", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('abb bdbed cade d') == 'Abb Bdbed Cade D'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abb bdbed cade d') == 'Abb Bdbed Cade D'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006055", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 0, 0, 3, 2, 5, 1]) == [2, 0, 3, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 0, 0, 3, 2, 5, 1]) == [2, 0, 3, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006056", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([4, 6, 14, 7, 4]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 6, 14, 7, 4]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006057", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('acbdb', 'bcbda') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acbdb', 'bcbda') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006058", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[9, 9, 8], [9, 1, 7]]) == [[9, 9], [9, 1], [8, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 9, 8], [9, 1, 7]]) == [[9, 9], [9, 1], [8, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006059", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(305) == 37\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(305) == 37\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006060", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 2, 4, 0, 4, 2, 2]) == [3, 2, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 2, 4, 0, 4, 2, 2]) == [3, 2, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006061", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([0, 24, 12, 17, 15, 12, 17, 12, 21]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 24, 12, 17, 15, 12, 17, 12, 21]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006062", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(1617) == 40\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1617) == 40\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006063", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(6505) == 80\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6505) == 80\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006064", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([29, 4, 11, 50, 1, 28, 5]) == [1, 4, 5, 11, 28, 29, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([29, 4, 11, 50, 1, 28, 5]) == [1, 4, 5, 11, 28, 29, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006065", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[2, 5, 4], [5, 1, 2]], [[0, 1], [2, 0], [4, 2]]) == [[26, 10], [10, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 5, 4], [5, 1, 2]], [[0, 1], [2, 0], [4, 2]]) == [[26, 10], [10, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006066", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(8300) == 38\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8300) == 38\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006067", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['bcczyz', 'bccyz']) == 'bcc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bcczyz', 'bccyz']) == 'bcc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006068", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([3, 5, 2, 5, 3, 6, 8, 8], 4) == [[3, 5, 2, 5], [3, 6, 8, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 5, 2, 5, 3, 6, 8, 8], 4) == [[3, 5, 2, 5], [3, 6, 8, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006069", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-38, -2, 26, -11, -19, 4, 47]) == 47\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-38, -2, 26, -11, -19, 4, 47]) == 47\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006070", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('ccc,\"aa,,\",acb') == ['ccc', 'aa,,', 'acb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ccc,\"aa,,\",acb') == ['ccc', 'aa,,', 'acb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006071", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-5, 1], [4, 5], [-1, -8]], [[-5, -6], [2, 7], [4, -8]]) == [[-10, -5], [6, 12], [3, -16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, 1], [4, 5], [-1, -8]], [[-5, -6], [2, 7], [4, -8]]) == [[-10, -5], [6, 12], [3, -16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006072", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'y': 7, 'w': 8}) == {'y': 13, 'w': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'y': 7, 'w': 8}) == {'y': 13, 'w': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006073", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([9, 5, [0, 2, 7]]) == [9, 5, 0, 2, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([9, 5, [0, 2, 7]]) == [9, 5, 0, 2, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006074", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([6, 9, 9, 2, 3, 1, 4, 4, 1], 6) == [2, 3, 1, 4, 4, 1, 6, 9, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 9, 9, 2, 3, 1, 4, 4, 1], 6) == [2, 3, 1, 4, 4, 1, 6, 9, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006075", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('caaacaa', 'aaab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caaacaa', 'aaab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006076", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Python World', 7) == 'Wfaovu Dvysk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python World', 7) == 'Wfaovu Dvysk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006077", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(12); s.push(87); s.push(79)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(12); s.push(87); s.push(79)\nassert s.peek() == 79\nassert s.pop() == 79\nassert s.pop() == 87\nassert s.is_empty() == False\nassert s.pop() == 12\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006078", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(4673) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4673) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006079", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('deefe', 'deefed') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('deefe', 'deefed') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006080", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[1, 4, 0], [4, 8, 6], [2, 7, 4], [0, 0, 8]]) == [[1, 4, 2, 0], [4, 8, 7, 0], [0, 6, 4, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 4, 0], [4, 8, 6], [2, 7, 4], [0, 0, 8]]) == [[1, 4, 2, 0], [4, 8, 7, 0], [0, 6, 4, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006081", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([9, [7, 7, 3, 3]]) == [9, 7, 7, 3, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [7, 7, 3, 3]]) == [9, 7, 7, 3, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006082", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h49m44s') == 17384\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h49m44s') == 17384\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006083", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(382) == 'CCCLXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(382) == 'CCCLXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006084", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('ccaaaa') == 'c2a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccaaaa') == 'c2a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006085", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([41, 20, 19, 37]) == [19, 20, 37, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([41, 20, 19, 37]) == [19, 20, 37, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006086", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 4, 4, 3]) == [0, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 4, 3]) == [0, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006087", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([2, 13, 44, 47, 49, 64, 84, 87], 163) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 13, 44, 47, 49, 64, 84, 87], 163) == -1\nassert binary_search([2, 13, 44, 47, 49, 64, 84, 87], 2) == 0\nassert binary_search([2, 13, 44, 47, 49, 64, 84, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006088", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('71,eccc,babaa') == ['71', 'eccc', 'babaa']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('71,eccc,babaa') == ['71', 'eccc', 'babaa']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006089", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-13, 11, 10]) == 8\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-13, 11, 10]) == 8\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006090", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[6, 2, 4, 2], [7, 5, 6, 2]]) == [6, 2, 4, 2, 7, 5, 6, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 2, 4, 2], [7, 5, 6, 2]]) == [6, 2, 4, 2, 7, 5, 6, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006091", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('22m16s') == 1336\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('22m16s') == 1336\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006092", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('ec') == 'Ec'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ec') == 'Ec'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006093", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('cbfafce', 'fbfecca') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cbfafce', 'fbfecca') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006094", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(89, 33) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(89, 33) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006095", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(17, 19) == 323\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 19) == 323\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006096", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dcbedeacccadba') == 'dcbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcbedeacccadba') == 'dcbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006097", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['avocado', 'avocado', 'apple']) == {'a': ['avocado', 'avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'avocado', 'apple']) == {'a': ['avocado', 'avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006098", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0], [9, 7, 5, 3], [5], [2, 3], [9]]) == [0, 9, 7, 5, 3, 5, 2, 3, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], [9, 7, 5, 3], [5], [2, 3], [9]]) == [0, 9, 7, 5, 3, 5, 2, 3, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006099", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['coconut', 'avocado', 'cherry', 'apple', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['avocado', 'apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'avocado', 'cherry', 'apple', 'date']) == {'c': ['coconut', 'cherry'], 'a': ['avocado', 'apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006100", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5m53s') == 353\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5m53s') == 353\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006101", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(280)\nacc.deposit(134)\nacc.withdraw(63)\nacc.withdraw(523)\nassert acc.get_balance() == 414\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(280)\nacc.deposit(134)\nassert acc.get_balance() == 414\nacc.withdraw(63)\nassert acc.get_balance() == 351\nacc.withdraw(523)\nassert acc.get_balance() == 351\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006102", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ddbbebcaa') == 'dbeca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddbbebcaa') == 'dbeca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006103", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(9, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006104", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('a{(]]][') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a{(]]][') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006105", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Ran sat ran sat cat. cat') == {'ran': 2, 'sat': 2, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Ran sat ran sat cat. cat') == {'ran': 2, 'sat': 2, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006106", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(877) == 29\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(877) == 29\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006107", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(109) == 113\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(109) == 113\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006108", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['avocado', 'avocado', 'coconut', 'apple', 'cherry']) == {'a': ['avocado', 'avocado', 'apple'], 'c': ['coconut', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'avocado', 'coconut', 'apple', 'cherry']) == {'a': ['avocado', 'avocado', 'apple'], 'c': ['coconut', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006109", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['cab', 'cabz', 'cab']) == 'cab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cab', 'cabz', 'cab']) == 'cab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006110", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(67) == [67]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(67) == [67]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006111", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('b[)aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b[)aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006112", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dcbcadab') == 'dcba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcbcadab') == 'dcba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006113", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(34) == 13\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(34) == 13\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006114", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, -7, 7, 6], [-3, 7, 9, -8], [2, 9, 0, -6]], [[-6, -2, 6, -1], [-1, 0, -3, 3], [-6, -1, 1, -6]]) == [[0, -9, 13, 5], [-4, 7, 6, -5], [-4, 8, 1, -12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -7, 7, 6], [-3, 7, 9, -8], [2, 9, 0, -6]], [[-6, -2, 6, -1], [-1, 0, -3, 3], [-6, -1, 1, -6]]) == [[0, -9, 13, 5], [-4, 7, 6, -5], [-4, 8, 1, -12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006115", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(6); s.push(42); s.push(26)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(6); s.push(42); s.push(26)\nassert s.peek() == 26\nassert s.pop() == 26\nassert s.pop() == 42\nassert s.is_empty() == False\nassert s.pop() == 6\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006116", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'c': 7, 'd': 6, 'a': 10}, 6) == {'c': 7, 'a': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 7, 'd': 6, 'a': 10}, 6) == {'c': 7, 'a': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006117", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([31, 37, 41, 31, 33, 1, 7]) == [1, 7, 31, 31, 33, 37, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 37, 41, 31, 33, 1, 7]) == [1, 7, 31, 31, 33, 37, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006118", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 2, 2, 8, 2], [6, 4, 6, 3, 7, 4, 5, 9]) == [5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 2, 2, 8, 2], [6, 4, 6, 3, 7, 4, 5, 9]) == [5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006119", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(4953) == 3594\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4953) == 3594\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006120", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[[2, 7], [7]], [[4, 5, 4], [1, 6, 1]], [[9, 3], [3, 1, 0]]]) == [2, 7, 7, 4, 5, 4, 1, 6, 1, 9, 3, 3, 1, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[2, 7], [7]], [[4, 5, 4], [1, 6, 1]], [[9, 3], [3, 1, 0]]]) == [2, 7, 7, 4, 5, 4, 1, 6, 1, 9, 3, 3, 1, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006121", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=off; path=149') == {'host': 'off', 'path': '149'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=off; path=149') == {'host': 'off', 'path': '149'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006122", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(83) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(83) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006123", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('11 - 3') == 8\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('11 - 3') == 8\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006124", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([4, 28, 11]) == [4, 11, 28]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 28, 11]) == [4, 11, 28]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_006125", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(53, 13) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(53, 13) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006126", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('cdeed bebbee bacdcd') == 'Cdeed Bebbee Bacdcd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cdeed bebbee bacdcd') == 'Cdeed Bebbee Bacdcd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006127", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 24, 'a': 38, 'f': 89, 'd': 15, 'c': 80}) == {24: 'b', 38: 'a', 89: 'f', 15: 'd', 80: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 24, 'a': 38, 'f': 89, 'd': 15, 'c': 80}) == {24: 'b', 38: 'a', 89: 'f', 15: 'd', 80: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006128", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('49m36s') == 2976\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('49m36s') == 2976\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006129", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaadddbbaabbbbbbbb') == 'a3d3b2a2b8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaadddbbaabbbbbbbb') == 'a3d3b2a2b8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006130", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Code', 20) == 'Wixy'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 20) == 'Wixy'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006131", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([9, 25, 24, 10]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 25, 24, 10]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006132", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([27, 44, 49, 29, 40, 40]) == [27, 29, 40, 40, 44, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 44, 49, 29, 40, 40]) == [27, 29, 40, 40, 44, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006133", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([4, 4, 4, 9, 8, 7, 8, 7, 2], 1) == [2, 4, 4, 4, 9, 8, 7, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 4, 4, 9, 8, 7, 8, 7, 2], 1) == [2, 4, 4, 4, 9, 8, 7, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006134", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[1], 8]) == [1, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1], 8]) == [1, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006135", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([32, 11, 9, 27, 29, 9]) == [9, 9, 11, 27, 29, 32]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([32, 11, 9, 27, 29, 9]) == [9, 9, 11, 27, 29, 32]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006136", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-15, 11, -9, 18]) == 5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-15, 11, -9, 18]) == 5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006137", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(5045) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5045) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006138", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(364972) == 604\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(364972) == 604\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006139", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXXVIII') == 428\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXVIII') == 428\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006140", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(2962) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2962) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006141", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'a': 1, 'd': 10}, 7) == {'d': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 1, 'd': 10}, 7) == {'d': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006142", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([26, 50, 44, 5, 13]) == [5, 13, 26, 44, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 50, 44, 5, 13]) == [5, 13, 26, 44, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006143", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([7, 9, 9, 2], 2) == [[7, 9], [9, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 9, 9, 2], 2) == [[7, 9], [9, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006144", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([6, 25, 22, 18]) == [6, 18, 22, 25]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([6, 25, 22, 18]) == [6, 18, 22, 25]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006145", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(17, 12) == 204\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 12) == 204\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006146", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babaabbba', 'abaa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babaabbba', 'abaa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006147", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('2h16m39s') == 8199\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h16m39s') == 8199\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006148", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([45, 11, 0, 20, 29, 5, 5, 47, 37, 18, 22]) == [0, 5, 5, 11, 18, 20, 22, 29, 37, 45, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([45, 11, 0, 20, 29, 5, 5, 47, 37, 18, 22]) == [0, 5, 5, 11, 18, 20, 22, 29, 37, 45, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006149", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([9, 9, 9, 9], [2, 6, 0, 2, 7, 6]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 9, 9, 9], [2, 6, 0, 2, 7, 6]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006150", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([34, 38, 3, 2]) == [2, 3, 34, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 38, 3, 2]) == [2, 3, 34, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006151", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([13, 22, 24]) == [13, 22, 24]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([13, 22, 24]) == [13, 22, 24]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006152", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 5, 9], [1, 0, 3, 6, 1]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 5, 9], [1, 0, 3, 6, 1]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006153", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(294) == 'CCXCIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(294) == 'CCXCIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006154", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([6, [5], 0, 9, [3]]) == [6, 5, 0, 9, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [5], 0, 9, [3]]) == [6, 5, 0, 9, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006155", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 5, 'w': 3, 'x': 9}, {'z': 4}) == {'y': 5, 'w': 3, 'x': 9, 'z': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5, 'w': 3, 'x': 9}, {'z': 4}) == {'y': 5, 'w': 3, 'x': 9, 'z': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006156", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h7m46s') == 14866\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h7m46s') == 14866\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006157", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[5, 1], [2, 2]]) == [5, 1, 2, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 1], [2, 2]]) == [5, 1, 2, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006158", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([3, 22, 29, 82], 3) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 22, 29, 82], 3) == 0\nassert binary_search([3, 22, 29, 82], 3) == 0\nassert binary_search([3, 22, 29, 82], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006159", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'c', 'c']) == {'e': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'c', 'c']) == {'e': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006160", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([36, 23, 31, 22, 14, 31, 28]) == [14, 22, 23, 28, 31, 31, 36]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 23, 31, 22, 14, 31, 28]) == [14, 22, 23, 28, 31, 31, 36]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006161", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([3, 20, 13, 14, 1, 5, 8, 24]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 20, 13, 14, 1, 5, 8, 24]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006162", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 1, 5, 0]) == [1, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 5, 0]) == [1, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006163", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(23, 3) == 69\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 3) == 69\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006164", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(5, 90, 692) == 413\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(5, 90, 692) == 413\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006165", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('The the! sat. sun. cat Ran cat Cat') == {'the': 2, 'sat': 1, 'sun': 1, 'cat': 3, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('The the! sat. sun. cat Ran cat Cat') == {'the': 2, 'sat': 1, 'sun': 1, 'cat': 3, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006166", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['d', 'e', 'd', 'a', 'b']) == {'d': 2, 'e': 1, 'a': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'd', 'a', 'b']) == {'d': 2, 'e': 1, 'a': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006167", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('dddddddddaaaaaaaaaddddaadddddddd') == 'd9a9d4a2d8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddddddaaaaaaaaaddddaadddddddd') == 'd9a9d4a2d8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006168", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(749330) == 865\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(749330) == 865\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006169", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 4, 4, 7, 7, 4, 6, 4, 1, 1], 9) == [4, 4, 7, 7, 4, 6, 4, 1, 1, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 4, 4, 7, 7, 4, 6, 4, 1, 1], 9) == [4, 4, 7, 7, 4, 6, 4, 1, 1, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006170", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('18 * 10 - (3 - 15)') == 192\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('18 * 10 - (3 - 15)') == 192\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006171", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=off; path=493; mode=480; host=108') == {'user': 'off', 'path': '493', 'mode': '480', 'host': '108'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; path=493; mode=480; host=108') == {'user': 'off', 'path': '493', 'mode': '480', 'host': '108'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006172", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('dog ran cat sun cat cat ran') == {'dog': 1, 'ran': 2, 'cat': 3, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog ran cat sun cat cat ran') == {'dog': 1, 'ran': 2, 'cat': 3, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006173", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=84; port=auto') == {'mode': '84', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=84; port=auto') == {'mode': '84', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006174", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 5, 0, 0, 2, 1, 4]) == [1, 5, 0, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 0, 0, 2, 1, 4]) == [1, 5, 0, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006175", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['b', 'e', 'b', 'e', 'b', 'd', 'e', 'e', 'd', 'c']) == {'b': 3, 'e': 4, 'd': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'e', 'b', 'e', 'b', 'd', 'e', 'e', 'd', 'c']) == {'b': 3, 'e': 4, 'd': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006176", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['bayzz', 'bayxz', 'ba']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bayzz', 'bayxz', 'ba']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006177", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'date', 'apple', 'date', 'banana', 'coconut', 'coconut', 'avocado']) == {'c': ['cherry', 'coconut', 'coconut'], 'd': ['date', 'date'], 'a': ['apple', 'avocado'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'date', 'apple', 'date', 'banana', 'coconut', 'coconut', 'avocado']) == {'c': ['cherry', 'coconut', 'coconut'], 'd': ['date', 'date'], 'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006178", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[]([])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]([])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006179", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[2, [9, 1, 5]], [[0, 2]]]) == [2, 9, 1, 5, 0, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2, [9, 1, 5]], [[0, 2]]]) == [2, 9, 1, 5, 0, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006180", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([39, -22]) == 39\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([39, -22]) == 39\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006181", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([22, 36, 50, 28, 2, 10, 25]) == [2, 10, 22, 25, 28, 36, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([22, 36, 50, 28, 2, 10, 25]) == [2, 10, 22, 25, 28, 36, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006182", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fefbfhg dbbhcec') == 'fefbfhg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fefbfhg dbbhcec') == 'fefbfhg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006183", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('c,ba') == ['c', 'ba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,ba') == ['c', 'ba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006184", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([0, 48, 6, 27]) == [0, 6, 27, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([0, 48, 6, 27]) == [0, 6, 27, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006185", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 3, 'w': 5, 'x': 2}, {'z': 4}) == {'z': 7, 'w': 5, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3, 'w': 5, 'x': 2}, {'z': 4}) == {'z': 7, 'w': 5, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006186", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([46, 50, 17, 24, 8, 36, 36, 1]) == [1, 8, 17, 24, 36, 36, 46, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([46, 50, 17, 24, 8, 36, 36, 1]) == [1, 8, 17, 24, 36, 36, 46, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006187", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('czeeyzeazb') == 'bzaezyeezc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('czeeyzeazb') == 'bzaezyeezc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006188", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[1, 7, [2, 3, 5]], [1, [4, 3], [6, 9, 2]], [[0], [0, 4]]]) == [1, 7, 2, 3, 5, 1, 4, 3, 6, 9, 2, 0, 0, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1, 7, [2, 3, 5]], [1, [4, 3], [6, 9, 2]], [[0], [0, 4]]]) == [1, 7, 2, 3, 5, 1, 4, 3, 6, 9, 2, 0, 0, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006189", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(7, 2) == 49\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 2) == 49\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006190", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('babbaabbabaaaaaa', 'baab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbaabbabaaaaaa', 'baab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006191", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(397)\nacc.deposit(7)\nacc.withdraw(154)\nacc.withdraw(550)\nassert acc.get_balance() == 404\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(397)\nacc.deposit(7)\nassert acc.get_balance() == 404\nacc.withdraw(154)\nassert acc.get_balance() == 250\nacc.withdraw(550)\nassert acc.get_balance() == 250\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006192", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([5, 9, 16, 19, 23, 26, 30, 31, 36, 57, 70], 190) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 9, 16, 19, 23, 26, 30, 31, 36, 57, 70], 190) == -1\nassert binary_search([5, 9, 16, 19, 23, 26, 30, 31, 36, 57, 70], 5) == 0\nassert binary_search([5, 9, 16, 19, 23, 26, 30, 31, 36, 57, 70], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006193", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(635042) == 796\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(635042) == 796\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006194", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('gdaceed ghedfdef fe cdd acch') == 'ghedfdef'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gdaceed ghedfdef fe cdd acch') == 'ghedfdef'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006195", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('35m42s') == 2142\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('35m42s') == 2142\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006196", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-9, 3], [6, -5], [-2, 2]], [[8, 2], [-4, -9], [-4, -8]]) == [[-1, 5], [2, -14], [-6, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 3], [6, -5], [-2, 2]], [[8, 2], [-4, -9], [-4, -8]]) == [[-1, 5], [2, -14], [-6, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006197", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([44, 28, 47, 37]) == [28, 37, 44, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 28, 47, 37]) == [28, 37, 44, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006198", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(153) == 'CLIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(153) == 'CLIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006199", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([10, 3, 22, 12, 28, 8, 48]) == [3, 8, 10, 12, 22, 28, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([10, 3, 22, 12, 28, 8, 48]) == [3, 8, 10, 12, 22, 28, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006200", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(89); s.push(72); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(89); s.push(72); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 72\nassert s.is_empty() == False\nassert s.pop() == 89\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006201", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'apple', 'date', 'date', 'banana', 'cherry']) == {'b': ['banana', 'banana'], 'a': ['apple'], 'd': ['date', 'date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'date', 'date', 'banana', 'cherry']) == {'b': ['banana', 'banana'], 'a': ['apple'], 'd': ['date', 'date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006202", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ccccccaaaaaaadd') == 'c6a7d2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccaaaaaaadd') == 'c6a7d2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006203", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 7, 6, 8, 9, 5], [4, 3, 6, 0, 6, 8, 9, 4]) == [6, 8, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 7, 6, 8, 9, 5], [4, 3, 6, 0, 6, 8, 9, 4]) == [6, 8, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006204", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([5, 5, 8, 3, 7, 8, 0, 8, 3], 12) == [0, 8, 3, 5, 5, 8, 3, 7, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 5, 8, 3, 7, 8, 0, 8, 3], 12) == [0, 8, 3, 5, 5, 8, 3, 7, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006205", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h32m50s') == 9170\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h32m50s') == 9170\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006206", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CLIII') == 153\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLIII') == 153\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006207", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([2, 20, 23, 32, 36, 37, 42, 63, 70, 82, 90, 92], 70) == 8\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 20, 23, 32, 36, 37, 42, 63, 70, 82, 90, 92], 70) == 8\nassert binary_search([2, 20, 23, 32, 36, 37, 42, 63, 70, 82, 90, 92], 2) == 0\nassert binary_search([2, 20, 23, 32, 36, 37, 42, 63, 70, 82, 90, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006208", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([7, 5, 0, 9, 0]) == [7, 5, 0, 9, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([7, 5, 0, 9, 0]) == [7, 5, 0, 9, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006209", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 9}, {'y': 1}) == {'x': 9, 'y': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9}, {'y': 1}) == {'x': 9, 'y': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006210", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(80) == [2, 2, 2, 2, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(80) == [2, 2, 2, 2, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006211", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([4, 11, 34, 39, 56, 59], 182) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 11, 34, 39, 56, 59], 182) == -1\nassert binary_search([4, 11, 34, 39, 56, 59], 4) == 0\nassert binary_search([4, 11, 34, 39, 56, 59], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006212", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(5234) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5234) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006213", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 5, 1, 3, 6, 7, 4], 3) == [6, 7, 4, 9, 5, 1, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 5, 1, 3, 6, 7, 4], 3) == [6, 7, 4, 9, 5, 1, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006214", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(3351) == 'MMMCCCLI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3351) == 'MMMCCCLI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006215", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1, 11, 14, 15, 17, 19, 19], [10, 11, 17]) == [1, 10, 11, 11, 14, 15, 17, 17, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 11, 14, 15, 17, 19, 19], [10, 11, 17]) == [1, 10, 11, 11, 14, 15, 17, 17, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006216", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1800) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1800) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006217", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 5, 7, 2], 4) == [[9, 5, 7, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 5, 7, 2], 4) == [[9, 5, 7, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006218", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaaaaaaaaaaddd') == 'a11d3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaaaddd') == 'a11d3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006219", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 3, 3, 6, 8, 7, 2, 0], [2, 8, 1, 2, 1, 9, 3]) == [3, 8, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 3, 3, 6, 8, 7, 2, 0], [2, 8, 1, 2, 1, 9, 3]) == [3, 8, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006220", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(9, 2) == 81\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 2) == 81\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006221", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(35, 60) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 60) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006222", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babaa', 'bbaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babaa', 'bbaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006223", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'e': 7, 'a': 9}, 2) == {'e': 7, 'a': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 7, 'a': 9}, 2) == {'e': 7, 'a': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006224", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3773) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3773) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006225", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('eb,bea') == ['eb', 'bea']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('eb,bea') == ['eb', 'bea']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006226", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 85, 'd': 3}) == {85: 'a', 3: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 85, 'd': 3}) == {85: 'a', 3: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006227", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([0, 4, 11, 18], 11) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 4, 11, 18], 11) == 2\nassert binary_search([0, 4, 11, 18], 0) == 0\nassert binary_search([0, 4, 11, 18], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006228", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'd', 'b', 'c', 'a', 'b']) == {'e': 1, 'd': 1, 'b': 2, 'c': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'd', 'b', 'c', 'a', 'b']) == {'e': 1, 'd': 1, 'b': 2, 'c': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006229", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(24, 92, 208) == 48\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(24, 92, 208) == 48\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006230", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'c': 0, 'e': 1, 'a': 10, 'b': 1}, 2) == {'a': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 0, 'e': 1, 'a': 10, 'b': 1}, 2) == {'a': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006231", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('}})}]{)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}})}]{)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006232", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('daedec') == 'daec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daedec') == 'daec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006233", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([7, 19, 45, 70, 79, 92], 79) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 19, 45, 70, 79, 92], 79) == 4\nassert binary_search([7, 19, 45, 70, 79, 92], 7) == 0\nassert binary_search([7, 19, 45, 70, 79, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006234", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(12) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(12) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006235", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([0, 4, 5, 2], 2) == [5, 2, 0, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 4, 5, 2], 2) == [5, 2, 0, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006236", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 24, 'd': 98, 'c': 5}) == {24: 'f', 98: 'd', 5: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 24, 'd': 98, 'c': 5}) == {24: 'f', 98: 'd', 5: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006237", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran Sat sat sun dog ran Ran ran sat ran') == {'ran': 5, 'sat': 3, 'sun': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran Sat sat sun dog ran Ran ran sat ran') == {'ran': 5, 'sat': 3, 'sun': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006238", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(52, 17) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(52, 17) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006239", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=auto; port=859') == {'user': 'auto', 'port': '859'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; port=859') == {'user': 'auto', 'port': '859'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006240", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMMDCLXXX') == 3680\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCLXXX') == 3680\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006241", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([0, 0, 5, 8], [6, 6, 1]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 0, 5, 8], [6, 6, 1]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006242", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([18, -1]) == 17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([18, -1]) == 17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006243", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(21) == [3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(21) == [3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006244", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(9, 9) == 387420489\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 9) == 387420489\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006245", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-2, 18, -12]) == 4\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-2, 18, -12]) == 4\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006246", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([24, 26, 28, 1, 7, 15, 27, 14]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([24, 26, 28, 1, 7, 15, 27, 14]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006247", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(14, 2) == 14\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 2) == 14\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006248", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 3, 0], [5, 5, 8, 6, 9, 4]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 3, 0], [5, 5, 8, 6, 9, 4]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006249", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[4, 5], [1, 3]], [[4, 0, 4], [2, 3, 4]]) == [[26, 15, 36], [10, 9, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 5], [1, 3]], [[4, 0, 4], [2, 3, 4]]) == [[26, 15, 36], [10, 9, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006250", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['cbx', 'cb']) == 'cb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cbx', 'cb']) == 'cb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006251", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ceeaee') == 'cea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceeaee') == 'cea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006252", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{)[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{)[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006253", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-8, 6], [-8, 2], [-1, -3]], [[-7, -7], [-6, 7], [2, -5]]) == [[-15, -1], [-14, 9], [1, -8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 6], [-8, 2], [-1, -3]], [[-7, -7], [-6, 7], [2, -5]]) == [[-15, -1], [-14, 9], [1, -8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006254", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(2478) == 8742\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2478) == 8742\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006255", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(19, 1, 17) == 2\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 1, 17) == 2\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006256", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(424) == 'CDXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(424) == 'CDXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006257", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 0, 1, 2, 0, 4, 4]) == [3, 0, 1, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 1, 2, 0, 4, 4]) == [3, 0, 1, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006258", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 3, 9, 5, 6], 1) == [6, 2, 3, 9, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 3, 9, 5, 6], 1) == [6, 2, 3, 9, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006259", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([9, 10, 9, 24]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 10, 9, 24]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006260", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(34, 50) == 850\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(34, 50) == 850\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006261", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(7, 44) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(7, 44) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006262", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('e aafg bf aggca hfe cbb') == 'aggca'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('e aafg bf aggca hfe cbb') == 'aggca'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006263", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(69) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(69) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006264", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(91); s.push(26); s.push(7)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(91); s.push(26); s.push(7)\nassert s.peek() == 7\nassert s.pop() == 7\nassert s.pop() == 26\nassert s.is_empty() == False\nassert s.pop() == 91\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006265", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(45, 101, 33) == 12\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(45, 101, 33) == 12\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006266", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 4, 0], [1, 5, 3]], [[5, 4, 2], [1, 3, 2], [1, 5, 1]]) == [[29, 32, 18], [13, 34, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 4, 0], [1, 5, 3]], [[5, 4, 2], [1, 3, 2], [1, 5, 1]]) == [[29, 32, 18], [13, 34, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006267", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([8, 16, 16], [0, 11, 13, 19, 20]) == [0, 8, 11, 13, 16, 16, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([8, 16, 16], [0, 11, 13, 19, 20]) == [0, 8, 11, 13, 16, 16, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006268", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[8], [[6, 3, 6]]]) == 23\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[8], [[6, 3, 6]]]) == 23\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006269", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(5453) == 73\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5453) == 73\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006270", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([6, 6, 9, 0, 6, 3, 1], 3) == [6, 3, 1, 6, 6, 9, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 6, 9, 0, 6, 3, 1], 3) == [6, 3, 1, 6, 6, 9, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006271", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'apple', 'date']) == {'a': ['avocado', 'apple'], 'c': ['coconut'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'apple', 'date']) == {'a': ['avocado', 'apple'], 'c': ['coconut'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006272", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('b adec acaaed') == 'B Adec Acaaed'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('b adec acaaed') == 'B Adec Acaaed'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006273", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3326) == 14\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3326) == 14\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006274", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['b', 'b', 'b', 'a', 'd', 'd', 'c', 'a', 'b', 'a']) == {'b': 4, 'a': 3, 'd': 2, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'b', 'b', 'a', 'd', 'd', 'c', 'a', 'b', 'a']) == {'b': 4, 'a': 3, 'd': 2, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006275", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['cacyyy', 'cacyzz']) == 'cacy'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cacyyy', 'cacyzz']) == 'cacy'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006276", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([0, 18, 71], 129) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 18, 71], 129) == -1\nassert binary_search([0, 18, 71], 0) == 0\nassert binary_search([0, 18, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006277", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 0, 9], 2) == [0, 9, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 0, 9], 2) == [0, 9, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006278", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[5, 8, 7], [7, 7, 1], 1]) == 36\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5, 8, 7], [7, 7, 1], 1]) == 36\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006279", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(484) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(484) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006280", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 4, 'e': 2, 'a': 7}, 4) == {'a': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 4, 'e': 2, 'a': 7}, 4) == {'a': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006281", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([1, 7, 41, 42]) == [1, 7, 41, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 7, 41, 42]) == [1, 7, 41, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006282", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(304)\nacc.deposit(121)\nacc.withdraw(79)\nacc.withdraw(569)\nassert acc.get_balance() == 425\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(304)\nacc.deposit(121)\nassert acc.get_balance() == 425\nacc.withdraw(79)\nassert acc.get_balance() == 346\nacc.withdraw(569)\nassert acc.get_balance() == 346\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006283", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[0, 7], 4, 6]) == [0, 7, 4, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[0, 7], 4, 6]) == [0, 7, 4, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006284", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat ran! The cat Sun Cat cat, the sun sat') == {'sat': 2, 'ran': 1, 'the': 2, 'cat': 3, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat ran! The cat Sun Cat cat, the sun sat') == {'sat': 2, 'ran': 1, 'the': 2, 'cat': 3, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006285", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([21, 36, 49, 35, 43, 37, 16, 2, 0, 27, 43]) == [0, 2, 16, 21, 27, 35, 36, 37, 43, 43, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([21, 36, 49, 35, 43, 37, 16, 2, 0, 27, 43]) == [0, 2, 16, 21, 27, 35, 36, 37, 43, 43, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006286", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'a', 'a', 'd', 'c', 'b', 'a', 'e']) == {'e': 2, 'a': 3, 'd': 1, 'c': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'a', 'd', 'c', 'b', 'a', 'e']) == {'e': 2, 'a': 3, 'd': 1, 'c': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006287", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(5658) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5658) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006288", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 3, 8, 4, 4, 1, 7, 5], 3) == [[4, 3, 8], [4, 4, 1], [7, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 3, 8, 4, 4, 1, 7, 5], 3) == [[4, 3, 8], [4, 4, 1], [7, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006289", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(56) == [2, 2, 2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(56) == [2, 2, 2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006290", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([9, 5, 7, 2, 2, 4, 4, 6], [0, 3, 2, 1, 0]) == [2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 5, 7, 2, 2, 4, 4, 6], [0, 3, 2, 1, 0]) == [2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006291", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(410) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(410) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006292", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(4119) == 64\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4119) == 64\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006293", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(3496) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3496) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006294", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 3, 9], 3) == [0, 3, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 3, 9], 3) == [0, 3, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006295", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([40, 43, 27, 29, 28, 15, 2, 38, 28, 19, 4]) == [2, 4, 15, 19, 27, 28, 28, 29, 38, 40, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 43, 27, 29, 28, 15, 2, 38, 28, 19, 4]) == [2, 4, 15, 19, 27, 28, 28, 29, 38, 40, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006296", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([50, 34, 36, 36, 47, 41, 40, 0, 17, 11, 41, 34, 24, 15]) == [0, 11, 15, 17, 24, 34, 34, 36, 36, 40, 41, 41, 47, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([50, 34, 36, 36, 47, 41, 40, 0, 17, 11, 41, 34, 24, 15]) == [0, 11, 15, 17, 24, 34, 34, 36, 36, 40, 41, 41, 47, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006297", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([24, 14, 41, 41]) == [14, 24, 41, 41]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 14, 41, 41]) == [14, 24, 41, 41]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006298", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('hgdhgf dadgbgg dh') == 'dadgbgg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hgdhgf dadgbgg dh') == 'dadgbgg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006299", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 86, 'b': 99, 'c': 38}) == {86: 'd', 99: 'b', 38: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 86, 'b': 99, 'c': 38}) == {86: 'd', 99: 'b', 38: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006300", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([9, 2, 9, 4, 7, 7], [0, 3, 5, 0, 6, 4]) == [4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 2, 9, 4, 7, 7], [0, 3, 5, 0, 6, 4]) == [4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006301", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('fda', 'fdab') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fda', 'fdab') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006302", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('oasvn') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('oasvn') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006303", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([9, 5, 3, 0, 1], [3, 7, 8, 8, 6, 6]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 5, 3, 0, 1], [3, 7, 8, 8, 6, 6]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006304", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 2}, {'y': 8}) == {'z': 2, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2}, {'y': 8}) == {'z': 2, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006305", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('cbab') == 'cba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbab') == 'cba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006306", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['apple', 'date', 'cherry']) == {'a': ['apple'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'date', 'cherry']) == {'a': ['apple'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006307", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abcbcbcbacc', 'cb') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abcbcbcbacc', 'cb') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006308", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabbabca', 'cca') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbabca', 'cca') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006309", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('50m20s') == 3020\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('50m20s') == 3020\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006310", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('hed db fc ba') == 'hed'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hed db fc ba') == 'hed'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006311", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([5, 8, 9, 8, 9, 0, 2, 0, 5, 2, 7, 5, 6], 2) == [[5, 8], [9, 8], [9, 0], [2, 0], [5, 2], [7, 5], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 8, 9, 8, 9, 0, 2, 0, 5, 2, 7, 5, 6], 2) == [[5, 8], [9, 8], [9, 0], [2, 0], [5, 2], [7, 5], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006312", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'e', 'a', 'd', 'a', 'c']) == {'c': 2, 'e': 1, 'a': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'e', 'a', 'd', 'a', 'c']) == {'c': 2, 'e': 1, 'a': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006313", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('f bdedbef') == 'bdedbef'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('f bdedbef') == 'bdedbef'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006314", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(93) == 17\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(93) == 17\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006315", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bdccaaa', 'bdccaaac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bdccaaa', 'bdccaaac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006316", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'d': 3, 'c': 9}, 6) == {'c': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 3, 'c': 9}, 6) == {'c': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006317", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([16, 16, 11, 12, 11, 12, 3]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 16, 11, 12, 11, 12, 3]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006318", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(25) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(25) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006319", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('hegc acecaeg dfhdddb dbgcce') == 'acecaeg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hegc acecaeg dfhdddb dbgcce') == 'acecaeg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006320", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 2}, {'z': 7, 'x': 9, 'w': 6}) == {'z': 9, 'x': 9, 'w': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2}, {'z': 7, 'x': 9, 'w': 6}) == {'z': 9, 'x': 9, 'w': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006321", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(88); s.push(16); s.push(71)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(88); s.push(16); s.push(71)\nassert s.peek() == 71\nassert s.pop() == 71\nassert s.pop() == 16\nassert s.is_empty() == False\nassert s.pop() == 88\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006322", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(50, 37) == 1850\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(50, 37) == 1850\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006323", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(299)\nacc.deposit(232)\nacc.withdraw(360)\nacc.withdraw(687)\nassert acc.get_balance() == 531\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(299)\nacc.deposit(232)\nassert acc.get_balance() == 531\nacc.withdraw(360)\nassert acc.get_balance() == 171\nacc.withdraw(687)\nassert acc.get_balance() == 171\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006324", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ccaaaa') == 'c2a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccaaaa') == 'c2a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006325", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[8, 4, 0, 6], 2, 4, [4, 8, 9]]) == [8, 4, 0, 6, 2, 4, 4, 8, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 4, 0, 6], 2, 4, [4, 8, 9]]) == [8, 4, 0, 6, 2, 4, 4, 8, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006326", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(3); s.push(11); s.push(81)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(3); s.push(11); s.push(81)\nassert s.peek() == 81\nassert s.pop() == 81\nassert s.pop() == 11\nassert s.is_empty() == False\nassert s.pop() == 3\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006327", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aaeecedaa') == 'aecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaeecedaa') == 'aecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006328", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[0], [1, 4, 1], [2, 7, 5]]) == 20\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0], [1, 4, 1], [2, 7, 5]]) == 20\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006329", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(7, 6) == 117649\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 6) == 117649\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006330", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(11); s.push(54); s.push(64)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(11); s.push(54); s.push(64)\nassert s.peek() == 64\nassert s.pop() == 64\nassert s.pop() == 54\nassert s.is_empty() == False\nassert s.pop() == 11\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006331", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('3') == 3\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('3') == 3\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006332", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[7, 8], [0, 3]]) == [[7, 0], [8, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 8], [0, 3]]) == [[7, 0], [8, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006333", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Hello Code', 7) == 'Olssv Jvkl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Code', 7) == 'Olssv Jvkl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006334", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(93); s.push(11); s.push(53)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(93); s.push(11); s.push(53)\nassert s.peek() == 53\nassert s.pop() == 53\nassert s.pop() == 11\nassert s.is_empty() == False\nassert s.pop() == 93\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006335", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'avocado', 'coconut', 'cherry', 'avocado']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'avocado', 'coconut', 'cherry', 'avocado']) == {'c': ['coconut', 'coconut', 'cherry'], 'b': ['berry'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006336", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([5, 0, 5, 5, 6, 1], 2) == [[5, 0], [5, 5], [6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 0, 5, 5, 6, 1], 2) == [[5, 0], [5, 5], [6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006337", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(90); s.push(6); s.push(10)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(6); s.push(10)\nassert s.peek() == 10\nassert s.pop() == 10\nassert s.pop() == 6\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006338", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1082) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1082) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006339", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(19, 25) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 25) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006340", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[3], 1]) == [3, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[3], 1]) == [3, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006341", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('da,b,\",b,a\",bd') == ['da', 'b', ',b,a', 'bd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('da,b,\",b,a\",bd') == ['da', 'b', ',b,a', 'bd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006342", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-9, -7, -9], [6, 8, -6], [5, -6, -6]], [[8, -9, 8], [4, -1, -6], [-8, 6, -5]]) == [[-1, -16, -1], [10, 7, -12], [-3, 0, -11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -7, -9], [6, 8, -6], [5, -6, -6]], [[8, -9, 8], [4, -1, -6], [-8, 6, -5]]) == [[-1, -16, -1], [10, 7, -12], [-3, 0, -11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006343", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[5, 0, 2], [7, -5, -3], [-5, 6, -1]], [[-2, 1, -1], [7, 6, -9], [-4, -9, 7]]) == [[3, 1, 1], [14, 1, -12], [-9, -3, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 0, 2], [7, -5, -3], [-5, 6, -1]], [[-2, 1, -1], [7, 6, -9], [-4, -9, 7]]) == [[3, 1, 1], [14, 1, -12], [-9, -3, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006344", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'x': 9, 'z': 8}, {'z': 7, 'x': 2, 'y': 6}) == {'w': 7, 'x': 11, 'z': 15, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'x': 9, 'z': 8}, {'z': 7, 'x': 2, 'y': 6}) == {'w': 7, 'x': 11, 'z': 15, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006345", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([8, 8, 6, 0, 5, 7], [7, 0, 6, 6]) == [6, 0, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 8, 6, 0, 5, 7], [7, 0, 6, 6]) == [6, 0, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006346", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-12, -13, 2]) == -23\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-12, -13, 2]) == -23\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006347", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([1, 2, -7, -7, 1, -4, 0, -7]) == [1, 3, -4, -11, -10, -14, -14, -21]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, 2, -7, -7, 1, -4, 0, -7]) == [1, 3, -4, -11, -10, -14, -14, -21]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006348", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MCXXXV') == 1135\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCXXXV') == 1135\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006349", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 17, 'a': 70, 'b': 41}) == {17: 'd', 70: 'a', 41: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 17, 'a': 70, 'b': 41}) == {17: 'd', 70: 'a', 41: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006350", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cbacccabbccabcbb', 'bca') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbacccabbccabcbb', 'bca') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006351", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([1, 1, 9, 8, 4, 3, 1, 2], 3) == [3, 1, 2, 1, 1, 9, 8, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 1, 9, 8, 4, 3, 1, 2], 3) == [3, 1, 2, 1, 1, 9, 8, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006352", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 32, 'd': 3, 'c': 54, 'e': 77, 'a': 69}) == {32: 'f', 3: 'd', 54: 'c', 77: 'e', 69: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 32, 'd': 3, 'c': 54, 'e': 77, 'a': 69}) == {32: 'f', 3: 'd', 54: 'c', 77: 'e', 69: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006353", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('bca bcce') == 'Bca Bcce'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bca bcce') == 'Bca Bcce'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006354", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[1, 4, 6, 1], [9, 9, 7, 6], [3, 8, 7, 8], [7, 3, 3, 3]]) == [[1, 9, 3, 7], [4, 9, 8, 3], [6, 7, 7, 3], [1, 6, 8, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 4, 6, 1], [9, 9, 7, 6], [3, 8, 7, 8], [7, 3, 3, 3]]) == [[1, 9, 3, 7], [4, 9, 8, 3], [6, 7, 7, 3], [1, 6, 8, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006355", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(127) == 'CXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(127) == 'CXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006356", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 37, 'c': 79, 'f': 39, 'a': 85, 'e': 78}) == {37: 'b', 79: 'c', 39: 'f', 85: 'a', 78: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 37, 'c': 79, 'f': 39, 'a': 85, 'e': 78}) == {37: 'b', 79: 'c', 39: 'f', 85: 'a', 78: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006357", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(47)\nacc.deposit(64)\nacc.withdraw(24)\nacc.withdraw(280)\nassert acc.get_balance() == 111\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(47)\nacc.deposit(64)\nassert acc.get_balance() == 111\nacc.withdraw(24)\nassert acc.get_balance() == 87\nacc.withdraw(280)\nassert acc.get_balance() == 87\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006358", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 73, 'a': 61, 'f': 10, 'c': 93}) == {73: 'b', 61: 'a', 10: 'f', 93: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 73, 'a': 61, 'f': 10, 'c': 93}) == {73: 'b', 61: 'a', 10: 'f', 93: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006359", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([28, 25, 29, 29]) == 28\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 25, 29, 29]) == 28\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006360", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([5, 9, 4, 1, 9, 6, 1], 7) == [5, 9, 4, 1, 9, 6, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 9, 4, 1, 9, 6, 1], 7) == [5, 9, 4, 1, 9, 6, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006361", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('10 - 5 - 11') == -6\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10 - 5 - 11') == -6\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006362", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bcdd') == 'b1c1d2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bcdd') == 'b1c1d2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006363", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('ccd agaaddbe') == 'agaaddbe'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ccd agaaddbe') == 'agaaddbe'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006364", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([14, 21, 17, 10]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 21, 17, 10]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006365", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([0, 7, 21, 22, 55, 86, 95, 96], 21) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 7, 21, 22, 55, 86, 95, 96], 21) == 2\nassert binary_search([0, 7, 21, 22, 55, 86, 95, 96], 0) == 0\nassert binary_search([0, 7, 21, 22, 55, 86, 95, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006366", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(28, 22) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 22) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006367", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([1, 6, 5], 3) == [1, 6, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 6, 5], 3) == [1, 6, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006368", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([1, 1, 5, 2, 5, 1, 5, 2, 1, 2, 2, 4]) == [1, 5, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 5, 2, 5, 1, 5, 2, 1, 2, 2, 4]) == [1, 5, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006369", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([4]) == 4\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4]) == 4\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006370", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([50, 49, 41, 16, 45, 5]) == [5, 16, 41, 45, 49, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([50, 49, 41, 16, 45, 5]) == [5, 16, 41, 45, 49, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006371", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(36, 134, 792) == 576\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(36, 134, 792) == 576\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006372", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(50) == [2, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(50) == [2, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006373", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eabaeaac') == 'eabc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eabaeaac') == 'eabc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006374", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('be bb adcb ecebc') == 'Be Bb Adcb Ecebc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('be bb adcb ecebc') == 'Be Bb Adcb Ecebc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006375", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([26, 49, 3, 17, 37, 17, 3, 20, 43, 37, 9, 0]) == [0, 3, 3, 9, 17, 17, 20, 26, 37, 37, 43, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([26, 49, 3, 17, 37, 17, 3, 20, 43, 37, 9, 0]) == [0, 3, 3, 9, 17, 17, 20, 26, 37, 37, 43, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006376", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('32m34s') == 1954\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('32m34s') == 1954\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006377", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaccccba') == 'a3c4b1a1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaccccba') == 'a3c4b1a1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006378", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[]{({})}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{({})}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006379", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 2, 3, 3, 3, 2]) == [0, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 3, 3, 3, 2]) == [0, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006380", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([27, 41, 68, 75, 81], 155) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([27, 41, 68, 75, 81], 155) == -1\nassert binary_search([27, 41, 68, 75, 81], 27) == 0\nassert binary_search([27, 41, 68, 75, 81], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006381", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(58); s.push(5); s.push(55)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(58); s.push(5); s.push(55)\nassert s.peek() == 55\nassert s.pop() == 55\nassert s.pop() == 5\nassert s.is_empty() == False\nassert s.pop() == 58\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006382", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([0, 9, 9, 8, 4, 3, 0, 0], 1) == [0, 0, 9, 9, 8, 4, 3, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 9, 9, 8, 4, 3, 0, 0], 1) == [0, 0, 9, 9, 8, 4, 3, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006383", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(5, 2) == 25\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 2) == 25\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006384", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(7, 23) == 161\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(7, 23) == 161\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006385", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(260) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(260) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006386", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([16, 3, 7]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 3, 7]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006387", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python Code', 22) == 'Lupdkj Ykza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Code', 22) == 'Lupdkj Ykza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006388", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([4, 4]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, 4]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006389", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([18, 31, 44, 60, 84], 84) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([18, 31, 44, 60, 84], 84) == 4\nassert binary_search([18, 31, 44, 60, 84], 18) == 0\nassert binary_search([18, 31, 44, 60, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006390", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 7, 4, 4, 0, 4], 10) == [4, 4, 0, 4, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 7, 4, 4, 0, 4], 10) == [4, 4, 0, 4, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006391", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(8292) == 2928\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8292) == 2928\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006392", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('9') == 9\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9') == 9\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006393", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 46, 'c': 9, 'b': 67}) == {46: 'a', 9: 'c', 67: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 46, 'c': 9, 'b': 67}) == {46: 'a', 9: 'c', 67: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006394", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([8, 36, 20, 43, 5, 21, 25, 29]) == [5, 8, 20, 21, 25, 29, 36, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([8, 36, 20, 43, 5, 21, 25, 29]) == [5, 8, 20, 21, 25, 29, 36, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006395", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('eedcdbc') == 'edcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eedcdbc') == 'edcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006396", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-18, 17, -12, 9, -1]) == -5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-18, 17, -12, 9, -1]) == -5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006397", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCIV') == 204\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCIV') == 204\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006398", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(22, 21) == 462\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 21) == 462\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006399", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(18516) == 136\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(18516) == 136\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006400", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('baacxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('baacxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006401", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[[6, 4, 5], [8, 6, 8]], 5]) == [6, 4, 5, 8, 6, 8, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[6, 4, 5], [8, 6, 8]], 5]) == [6, 4, 5, 8, 6, 8, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006402", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(286) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(286) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006403", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 3, 9, 1, 9, 6, 9, 1], 3) == [6, 9, 1, 2, 3, 9, 1, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 3, 9, 1, 9, 6, 9, 1], 3) == [6, 9, 1, 2, 3, 9, 1, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006404", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[5, 2, 1, 0], [5, 6, 0, 7], [0, 3, 2, 2]]) == [[5, 5, 0], [2, 6, 3], [1, 0, 2], [0, 7, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 2, 1, 0], [5, 6, 0, 7], [0, 3, 2, 2]]) == [[5, 5, 0], [2, 6, 3], [1, 0, 2], [0, 7, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006405", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[4], [3, 9, 5, 5]]) == [4, 3, 9, 5, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], [3, 9, 5, 5]]) == [4, 3, 9, 5, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006406", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([42, 45, 21, 49, 13, 50]) == [13, 21, 42, 45, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 45, 21, 49, 13, 50]) == [13, 21, 42, 45, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006407", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([2, [[4, 3], [7, 5, 8], 1], 4]) == [2, 4, 3, 7, 5, 8, 1, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([2, [[4, 3], [7, 5, 8], 1], 4]) == [2, 4, 3, 7, 5, 8, 1, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006408", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3054) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3054) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006409", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'z': 6, 'w': 2}, {'z': 2}) == {'y': 6, 'z': 8, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'z': 6, 'w': 2}, {'z': 2}) == {'y': 6, 'z': 8, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006410", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'e', 'a', 'a', 'd', 'a', 'a']) == {'d': 2, 'e': 1, 'a': 4}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'a', 'a', 'd', 'a', 'a']) == {'d': 2, 'e': 1, 'a': 4}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006411", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 9, 7, 2, 9, 2], 4) == [[4, 9, 7, 2], [9, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 9, 7, 2, 9, 2], 4) == [[4, 9, 7, 2], [9, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006412", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([2, 4, 7, 0, -9]) == [2, 6, 13, 13, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([2, 4, 7, 0, -9]) == [2, 6, 13, 13, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006413", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([13, 2, 37, 19, 13, 47, 18, 46, 50]) == [2, 13, 13, 18, 19, 37, 46, 47, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([13, 2, 37, 19, 13, 47, 18, 46, 50]) == [2, 13, 13, 18, 19, 37, 46, 47, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006414", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(8, 9) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(8, 9) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006415", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cbbdbddec') == 'cbde'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbbdbddec') == 'cbde'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006416", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['bccyxz', 'bcc', 'bccx']) == 'bcc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bccyxz', 'bcc', 'bccx']) == 'bcc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006417", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(157, 41) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(157, 41) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006418", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('24m33s') == 1473\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('24m33s') == 1473\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006419", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eaeeac') == 'eac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eaeeac') == 'eac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006420", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog sat dog, sun dog ran.') == {'dog': 3, 'sat': 1, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat dog, sun dog ran.') == {'dog': 3, 'sat': 1, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006421", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(231)\nacc.deposit(273)\nacc.withdraw(294)\nacc.withdraw(676)\nassert acc.get_balance() == 504\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(231)\nacc.deposit(273)\nassert acc.get_balance() == 504\nacc.withdraw(294)\nassert acc.get_balance() == 210\nacc.withdraw(676)\nassert acc.get_balance() == 210\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006422", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(33, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(33, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006423", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=auto; path=on') == {'host': 'auto', 'path': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; path=on') == {'host': 'auto', 'path': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006424", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('cccccccaaaaa') == 'c7a5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccccaaaaa') == 'c7a5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006425", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(')(b())') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')(b())') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006426", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([1, 3, 6, 12, 18, 19], [1, 3, 11, 12, 15, 17]) == [1, 1, 3, 3, 6, 11, 12, 12, 15, 17, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 3, 6, 12, 18, 19], [1, 3, 11, 12, 15, 17]) == [1, 1, 3, 3, 6, 11, 12, 12, 15, 17, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006427", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ecdabc') == 'ecdab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecdabc') == 'ecdab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006428", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 9, 8, 5, 0, 2, 1, 5, 1, 3], 5) == [[6, 9, 8, 5, 0], [2, 1, 5, 1, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 8, 5, 0, 2, 1, 5, 1, 3], 5) == [[6, 9, 8, 5, 0], [2, 1, 5, 1, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006429", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(26) == [2, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(26) == [2, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006430", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'avocado', 'berry', 'date', 'cherry', 'berry', 'avocado', 'coconut']) == {'b': ['banana', 'berry', 'berry'], 'a': ['avocado', 'avocado'], 'd': ['date'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'avocado', 'berry', 'date', 'cherry', 'berry', 'avocado', 'coconut']) == {'b': ['banana', 'berry', 'berry'], 'a': ['avocado', 'avocado'], 'd': ['date'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006431", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dbab') == 'dba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbab') == 'dba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006432", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([6, [0, 9]]) == [6, 0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [0, 9]]) == [6, 0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006433", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[9], [[6], 8, [8, 5]]]) == [9, 6, 8, 8, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[9], [[6], 8, [8, 5]]]) == [9, 6, 8, 8, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006434", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[8, 1], [4]]) == [8, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 1], [4]]) == [8, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006435", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([9, 0, 7, 9, 3, 2], [8, 9, 7, 6, 4, 1, 6]) == [9, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 0, 7, 9, 3, 2], [8, 9, 7, 6, 4, 1, 6]) == [9, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006436", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([4, 8, 7], 3) == [4, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 8, 7], 3) == [4, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006437", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 2, 0, 0, 4], [2, 5, 3, 0, 1, 2]) == [2, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 2, 0, 0, 4], [2, 5, 3, 0, 1, 2]) == [2, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006438", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('xzccb') == 'bcczx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xzccb') == 'bcczx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006439", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(55); s.push(39); s.push(0)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(55); s.push(39); s.push(0)\nassert s.peek() == 0\nassert s.pop() == 0\nassert s.pop() == 39\nassert s.is_empty() == False\nassert s.pop() == 55\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006440", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 8, 6, 4, 6, 7], 2) == [[4, 8], [6, 4], [6, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 8, 6, 4, 6, 7], 2) == [[4, 8], [6, 4], [6, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006441", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 16, 'b': 64, 'f': 59, 'd': 8}) == {16: 'e', 64: 'b', 59: 'f', 8: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 16, 'b': 64, 'f': 59, 'd': 8}) == {16: 'e', 64: 'b', 59: 'f', 8: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006442", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('7,\"aa,b,\",ebd,bae,ae') == ['7', 'aa,b,', 'ebd', 'bae', 'ae']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('7,\"aa,b,\",ebd,bae,ae') == ['7', 'aa,b,', 'ebd', 'bae', 'ae']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006443", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(5216) == 6125\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5216) == 6125\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006444", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-20, -3]) == -23\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, -3]) == -23\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006445", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 79, 'f': 54, 'b': 11, 'a': 32, 'c': 72}) == {79: 'e', 54: 'f', 11: 'b', 32: 'a', 72: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 79, 'f': 54, 'b': 11, 'a': 32, 'c': 72}) == {79: 'e', 54: 'f', 11: 'b', 32: 'a', 72: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006446", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(3540) == 59\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3540) == 59\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006447", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ea bd deaabd ab') == 'Ea Bd Deaabd Ab'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ea bd deaabd ab') == 'Ea Bd Deaabd Ab'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006448", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('daaabba') == 'dab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('daaabba') == 'dab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006449", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 18, 'a': 38, 'e': 3}) == {18: 'b', 38: 'a', 3: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 18, 'a': 38, 'e': 3}) == {18: 'b', 38: 'a', 3: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006450", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(119, 111) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(119, 111) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006451", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([5, 12, 18, 12, 18, 11]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 12, 18, 12, 18, 11]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006452", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([16, 16, 5, 16, 21, 21]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([16, 16, 5, 16, 21, 21]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006453", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('fac') == 'caf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fac') == 'caf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006454", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[[3, 8, 3], [5, 8, 6], [4, 3]], 7]) == [3, 8, 3, 5, 8, 6, 4, 3, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[3, 8, 3], [5, 8, 6], [4, 3]], 7]) == [3, 8, 3, 5, 8, 6, 4, 3, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006455", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('\"ab,\",c,78,cab,6') == ['ab,', 'c', '78', 'cab', '6']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"ab,\",c,78,cab,6') == ['ab,', 'c', '78', 'cab', '6']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006456", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'banana', 'apple', 'date', 'banana']) == {'a': ['avocado', 'apple'], 'c': ['cherry'], 'b': ['banana', 'banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'banana', 'apple', 'date', 'banana']) == {'a': ['avocado', 'apple'], 'c': ['cherry'], 'b': ['banana', 'banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006457", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(39, 26, 57) == 39\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(39, 26, 57) == 39\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006458", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(2224) == 47\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2224) == 47\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006459", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 5, 5, 6, 5, 1, 4, 1], [7, 1, 2]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 5, 5, 6, 5, 1, 4, 1], [7, 1, 2]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006460", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'b', 'd']) == {'e': 1, 'b': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'd']) == {'e': 1, 'b': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006461", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([7, -31]) == 7\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([7, -31]) == 7\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006462", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CDXXIV') == 424\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXIV') == 424\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006463", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([1, -4, 19, 1]) == 17\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([1, -4, 19, 1]) == 17\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006464", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 20, 'c': 47, 'a': 17, 'd': 15}) == {20: 'b', 47: 'c', 17: 'a', 15: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 20, 'c': 47, 'a': 17, 'd': 15}) == {20: 'b', 47: 'c', 17: 'a', 15: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006465", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[4], [7], 9]) == [4, 7, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], [7], 9]) == [4, 7, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006466", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(301910) == 549\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(301910) == 549\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006467", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccccccaa') == 'c8a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccccaa') == 'c8a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006468", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(8248) == 90\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8248) == 90\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006469", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 85, 'f': 91, 'e': 45, 'a': 21}) == {85: 'c', 91: 'f', 45: 'e', 21: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 85, 'f': 91, 'e': 45, 'a': 21}) == {85: 'c', 91: 'f', 45: 'e', 21: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006470", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([28, 0, 27, 9, 0, 28, 11]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 0, 27, 9, 0, 28, 11]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006471", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(22, 22) == 22\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(22, 22) == 22\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006472", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([36, 18, 37, 43]) == [18, 36, 37, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([36, 18, 37, 43]) == [18, 36, 37, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006473", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[2, 0, 1, 5], 1, 6]) == [2, 0, 1, 5, 1, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 0, 1, 5], 1, 6]) == [2, 0, 1, 5, 1, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006474", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('acbbbcaaababcbc', 'ac') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acbbbcaaababcbc', 'ac') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006475", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(4305) == 5034\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4305) == 5034\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006476", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('ioaimt') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ioaimt') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006477", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('cabaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cabaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006478", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=516; user=125') == {'mode': '516', 'user': '125'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=516; user=125') == {'mode': '516', 'user': '125'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006479", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaabb') == 'a4b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaabb') == 'a4b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006480", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MCDXXI') == 1421\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCDXXI') == 1421\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006481", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([1, [0], 7]) == [1, 0, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [0], 7]) == [1, 0, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006482", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('abc', 8) == 'ijk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 8) == 'ijk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006483", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'e': 5, 'd': 7}, 6) == {'d': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 5, 'd': 7}, 6) == {'d': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006484", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('caceeabbc') == 'caeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caceeabbc') == 'caeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006485", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(60, 24) == 12\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(60, 24) == 12\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006486", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(6, 14) == 42\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 14) == 42\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006487", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(44) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(44) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006488", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([6, 5, 0, 2, 4, 6, 4, 9, 0, 5], 14) == [4, 9, 0, 5, 6, 5, 0, 2, 4, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 5, 0, 2, 4, 6, 4, 9, 0, 5], 14) == [4, 9, 0, 5, 6, 5, 0, 2, 4, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006489", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[4], 9, 2, [4, 7], [4]]) == [4, 9, 2, 4, 7, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4], 9, 2, [4, 7], [4]]) == [4, 9, 2, 4, 7, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006490", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([3, 7, 5, 1, 4, 4, 6, 1], [9, 4, 4, 7, 9, 3]) == [3, 7, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 7, 5, 1, 4, 4, 6, 1], [9, 4, 4, 7, 9, 3]) == [3, 7, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006491", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[9, 0], [9, 1, 8]]) == [9, 0, 9, 1, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 0], [9, 1, 8]]) == [9, 0, 9, 1, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006492", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([19, 0, 50, 6, 26]) == [0, 6, 19, 26, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([19, 0, 50, 6, 26]) == [0, 6, 19, 26, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006493", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(236) == 34\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(236) == 34\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006494", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('edeedd', 'edeeddf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('edeedd', 'edeeddf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006495", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=off; host=252; port=on; path=445') == {'user': 'off', 'host': '252', 'port': 'on', 'path': '445'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=off; host=252; port=on; path=445') == {'user': 'off', 'host': '252', 'port': 'on', 'path': '445'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006496", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([1, 38, 49, 18, 31, 2, 28]) == [1, 2, 18, 28, 31, 38, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 38, 49, 18, 31, 2, 28]) == [1, 2, 18, 28, 31, 38, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006497", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([7, 23, 33, 42, 61, 69, 93], 197) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 23, 33, 42, 61, 69, 93], 197) == -1\nassert binary_search([7, 23, 33, 42, 61, 69, 93], 7) == 0\nassert binary_search([7, 23, 33, 42, 61, 69, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006498", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('baabbabaabaaa', 'bba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabbabaabaaa', 'bba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006499", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ebccbea') == 'ebca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebccbea') == 'ebca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006500", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 3, 1, 5, 4, 3, 5]) == [3, 1, 5, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 1, 5, 4, 3, 5]) == [3, 1, 5, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006501", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(9522) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9522) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006502", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbbaaab', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbaaab', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006503", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[1, 2, 3], [3, 5, 5]], [[2, 0, 1], [3, 1, 0], [2, 0, 1]]) == [[14, 2, 4], [31, 5, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 2, 3], [3, 5, 5]], [[2, 0, 1], [3, 1, 0], [2, 0, 1]]) == [[14, 2, 4], [31, 5, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006504", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CLIV') == 154\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLIV') == 154\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006505", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(81) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(81) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006506", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 9, 'd': 7}, 7) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 9, 'd': 7}, 7) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006507", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[1, 4, 5], [0, 4, 2], [1, 0, 0]], [[5, 4], [5, 4], [0, 5]]) == [[25, 45], [20, 26], [5, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4, 5], [0, 4, 2], [1, 0, 0]], [[5, 4], [5, 4], [0, 5]]) == [[25, 45], [20, 26], [5, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006508", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(887) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(887) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006509", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('ezbddzc') == 'czddbze'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ezbddzc') == 'czddbze'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006510", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([3, 4, 8, 5, 9, 9, 2], 3) == [[3, 4, 8], [5, 9, 9], [2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 4, 8, 5, 9, 9, 2], 3) == [[3, 4, 8], [5, 9, 9], [2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006511", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('d,\"aa,\"') == ['d', 'aa,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,\"aa,\"') == ['d', 'aa,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006512", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 3], [5, 0]], [[4, 1], [3, 2]]) == [[9, 6], [20, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3], [5, 0]], [[4, 1], [3, 2]]) == [[9, 6], [20, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006513", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([0, 0, 1, 5]) == [0, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 1, 5]) == [0, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006514", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Python Python', 15) == 'Eniwdc Eniwdc'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Python', 15) == 'Eniwdc Eniwdc'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006515", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(886) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(886) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006516", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(818) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(818) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006517", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([5, 4, 4, 2, 4, 1]) == [5, 4, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 4, 2, 4, 1]) == [5, 4, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006518", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-3, 1, -3, -1], [1, 2, -2, -7], [3, 2, 4, 0]], [[-9, -9, -6, -8], [5, 8, -4, 1], [4, 6, 7, 3]]) == [[-12, -8, -9, -9], [6, 10, -6, -6], [7, 8, 11, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 1, -3, -1], [1, 2, -2, -7], [3, 2, 4, 0]], [[-9, -9, -6, -8], [5, 8, -4, 1], [4, 6, 7, 3]]) == [[-12, -8, -9, -9], [6, 10, -6, -6], [7, 8, 11, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006519", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(192) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(192) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006520", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 4, 3, 0, 1, 2, 2, 1, 0, 5, 2]) == [0, 4, 3, 1, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 3, 0, 1, 2, 2, 1, 0, 5, 2]) == [0, 4, 3, 1, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006521", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([2, 38, 40, 44, 19, 41, 13, 1]) == [1, 2, 13, 19, 38, 40, 41, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([2, 38, 40, 44, 19, 41, 13, 1]) == [1, 2, 13, 19, 38, 40, 41, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006522", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMMDLVI') == 3556\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDLVI') == 3556\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006523", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('5h31m29s') == 19889\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h31m29s') == 19889\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006524", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([8, 2, 5, 9, 7], 5) == [8, 2, 5, 9, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 2, 5, 9, 7], 5) == [8, 2, 5, 9, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006525", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(966) == 669\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(966) == 669\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006526", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(13, 181, 902) == 233\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(13, 181, 902) == 233\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006527", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h25m29s') == 12329\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h25m29s') == 12329\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006528", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 5, 3, 0, 6, 3, 7, 5, 3, 0, 7, 4, 4], 5) == [[6, 5, 3, 0, 6], [3, 7, 5, 3, 0], [7, 4, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 5, 3, 0, 6, 3, 7, 5, 3, 0, 7, 4, 4], 5) == [[6, 5, 3, 0, 6], [3, 7, 5, 3, 0], [7, 4, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006529", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(183)\nacc.deposit(195)\nacc.withdraw(216)\nacc.withdraw(397)\nassert acc.get_balance() == 378\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(183)\nacc.deposit(195)\nassert acc.get_balance() == 378\nacc.withdraw(216)\nassert acc.get_balance() == 162\nacc.withdraw(397)\nassert acc.get_balance() == 162\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006530", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'x': 3}, {'x': 1, 'y': 1, 'z': 8}) == {'z': 12, 'x': 4, 'y': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'x': 3}, {'x': 1, 'y': 1, 'z': 8}) == {'z': 12, 'x': 4, 'y': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006531", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('((18 + 17) * 4)') == 140\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((18 + 17) * 4)') == 140\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006532", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[0, -2, 3], [-8, 6, -5]], [[9, -5, 3], [9, 4, -3]]) == [[9, -7, 6], [1, 10, -8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -2, 3], [-8, 6, -5]], [[9, -5, 3], [9, 4, -3]]) == [[9, -7, 6], [1, 10, -8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006533", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(3193) == 3913\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3193) == 3913\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006534", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 2, 3, 2, 9, 4, 2, 2], [9, 9, 5, 2, 1, 7]) == [7, 2, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 2, 3, 2, 9, 4, 2, 2], [9, 9, 5, 2, 1, 7]) == [7, 2, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006535", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 5, 7, 5, 9, 9, 5], [4, 9, 5, 7, 0]) == [5, 7, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 5, 7, 5, 9, 9, 5], [4, 9, 5, 7, 0]) == [5, 7, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006536", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ggiumz') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ggiumz') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006537", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(121, 5) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(121, 5) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006538", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(261) == 'CCLXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(261) == 'CCLXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006539", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 4, 4, 2, 0, 0]) == [2, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 4, 2, 0, 0]) == [2, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006540", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('0m44s') == 44\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('0m44s') == 44\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006541", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[[7], [7, 1, 5]], [[4, 2, 6], 6], [[4, 4, 6], 2, 7]]) == [7, 7, 1, 5, 4, 2, 6, 6, 4, 4, 6, 2, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[7], [7, 1, 5]], [[4, 2, 6], 6], [[4, 4, 6], 2, 7]]) == [7, 7, 1, 5, 4, 2, 6, 6, 4, 4, 6, 2, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006542", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([0, 38, 46, 23, 34, 3, 2]) == [0, 2, 3, 23, 34, 38, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([0, 38, 46, 23, 34, 3, 2]) == [0, 2, 3, 23, 34, 38, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006543", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(8, 24, 5) == 1\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(8, 24, 5) == 1\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006544", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([48, 28, 36, 2, 19, 33, 23, 14, 50]) == [2, 14, 19, 23, 28, 33, 36, 48, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 28, 36, 2, 19, 33, 23, 14, 50]) == [2, 14, 19, 23, 28, 33, 36, 48, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006545", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['coconut', 'berry', 'cherry', 'cherry', 'avocado', 'banana']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry', 'banana'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'berry', 'cherry', 'cherry', 'avocado', 'banana']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['berry', 'banana'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006546", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([19, 50, 9, 9]) == [9, 9, 19, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([19, 50, 9, 9]) == [9, 9, 19, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006547", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=auto; path=auto; port=on; host=9') == {'user': 'auto', 'path': 'auto', 'port': 'on', 'host': '9'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=auto; path=auto; port=on; host=9') == {'user': 'auto', 'path': 'auto', 'port': 'on', 'host': '9'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006548", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'a': 8, 'c': 3}, 4) == {'a': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 8, 'c': 3}, 4) == {'a': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006549", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(185) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(185) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006550", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'w': 9}, {'w': 7, 'y': 7, 'z': 2}) == {'y': 13, 'w': 16, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'w': 9}, {'w': 7, 'y': 7, 'z': 2}) == {'y': 13, 'w': 16, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006551", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([0, 2, [3, 7]]) == 12\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, 2, [3, 7]]) == 12\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006552", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'e': 9, 'd': 10, 'a': 1}, 7) == {'e': 9, 'd': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 9, 'd': 10, 'a': 1}, 7) == {'e': 9, 'd': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006553", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 1, 9, 4, 6], [4, 1, 5, 4, 7]) == [7, 1, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 1, 9, 4, 6], [4, 1, 5, 4, 7]) == [7, 1, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006554", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([5, 7, 17, 35, 39, 40, 54, 82, 93], 7) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 7, 17, 35, 39, 40, 54, 82, 93], 7) == 1\nassert binary_search([5, 7, 17, 35, 39, 40, 54, 82, 93], 5) == 0\nassert binary_search([5, 7, 17, 35, 39, 40, 54, 82, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006555", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([1, [6], 0]) == [1, 6, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [6], 0]) == [1, 6, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006556", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('aeedf', 'dfeae') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aeedf', 'dfeae') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006557", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h47m2s') == 10022\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h47m2s') == 10022\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006558", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(32); s.push(30); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(32); s.push(30); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 30\nassert s.is_empty() == False\nassert s.pop() == 32\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006559", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 4, 4, 0], [5, 8, 4, 6, 9, 1]) == [5, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 4, 4, 0], [5, 8, 4, 6, 9, 1]) == [5, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006560", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([27, 34, 2, 24, 36, 42]) == [2, 24, 27, 34, 36, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([27, 34, 2, 24, 36, 42]) == [2, 24, 27, 34, 36, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006561", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccdccaaa') == 'c2d1c2a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccdccaaa') == 'c2d1c2a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006562", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cebdaede') == 'cebda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cebdaede') == 'cebda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006563", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=on; path=455') == {'user': 'on', 'path': '455'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; path=455') == {'user': 'on', 'path': '455'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006564", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbbbbbbbb', 'ab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbbbbb', 'ab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006565", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 5, 1, 2, 4, 0, 1, 9], 3) == [0, 1, 9, 3, 5, 1, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 5, 1, 2, 4, 0, 1, 9], 3) == [0, 1, 9, 3, 5, 1, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006566", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([10, 17, 19, 20], [4]) == [4, 10, 17, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([10, 17, 19, 20], [4]) == [4, 10, 17, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006567", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(83) == 110\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(83) == 110\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006568", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 4, 0], [0, 5, 2]], [[2, 2], [3, 0], [0, 5]]) == [[12, 0], [15, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 4, 0], [0, 5, 2]], [[2, 2], [3, 0], [0, 5]]) == [[12, 0], [15, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006569", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([44, 46, 26, 35, 47, 35, 15]) == [15, 26, 35, 35, 44, 46, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 46, 26, 35, 47, 35, 15]) == [15, 26, 35, 35, 44, 46, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006570", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([16], [6, 7, 9, 9, 11, 15, 17]) == [6, 7, 9, 9, 11, 15, 16, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([16], [6, 7, 9, 9, 11, 15, 17]) == [6, 7, 9, 9, 11, 15, 16, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006571", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('bfbzyyzc') == 'czyyzbfb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bfbzyyzc') == 'czyyzbfb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006572", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(323) == 'CCCXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(323) == 'CCCXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006573", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 2, 2], [4, 4, 0]], [[1, 5], [5, 2], [2, 2]]) == [[14, 8], [24, 28]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2, 2], [4, 4, 0]], [[1, 5], [5, 2], [2, 2]]) == [[14, 8], [24, 28]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006574", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'y': 8, 'z': 3}, {'x': 7}) == {'w': 6, 'y': 8, 'z': 3, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'y': 8, 'z': 3}, {'x': 7}) == {'w': 6, 'y': 8, 'z': 3, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006575", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 6, 'x': 5}, {'w': 7, 'x': 5}) == {'y': 6, 'x': 10, 'w': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6, 'x': 5}, {'w': 7, 'x': 5}) == {'y': 6, 'x': 10, 'w': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006576", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[1, 0], [3, 2]], [[1, 4], [3, 4]]) == [[1, 4], [9, 20]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 0], [3, 2]], [[1, 4], [3, 4]]) == [[1, 4], [9, 20]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006577", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 1, 'b': 5, 'a': 10, 'e': 4}, 6) == {'a': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 1, 'b': 5, 'a': 10, 'e': 4}, 6) == {'a': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006578", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(467) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(467) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006579", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('xyz', 14) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 14) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006580", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['acyz', 'acxx', 'acyxx', 'ac']) == 'ac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['acyz', 'acxx', 'acyxx', 'ac']) == 'ac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006581", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 9, 'z': 4, 'y': 9}, {'w': 7}) == {'w': 16, 'z': 4, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9, 'z': 4, 'y': 9}, {'w': 7}) == {'w': 16, 'z': 4, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006582", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 6, 1, 3, 5, 9], 4) == [[4, 6, 1, 3], [5, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 6, 1, 3, 5, 9], 4) == [[4, 6, 1, 3], [5, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006583", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([4, 1, 5, 3, 3, 0, 0, 3]) == [4, 1, 5, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 5, 3, 3, 0, 0, 3]) == [4, 1, 5, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006584", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([10, 23, 28, 34, 89], 120) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 23, 28, 34, 89], 120) == -1\nassert binary_search([10, 23, 28, 34, 89], 10) == 0\nassert binary_search([10, 23, 28, 34, 89], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006585", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([7, 0, 3, 0, 9], [9, 2, 6, 9, 2, 4]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 0, 3, 0, 9], [9, 2, 6, 9, 2, 4]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006586", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=auto; path=947') == {'mode': 'auto', 'path': '947'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=auto; path=947') == {'mode': 'auto', 'path': '947'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006587", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([5, 4]) == [5, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([5, 4]) == [5, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006588", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 7, 0, 2, 5, 1], [2, 9, 1, 2, 9, 4, 1, 3]) == [4, 2, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 7, 0, 2, 5, 1], [2, 9, 1, 2, 9, 4, 1, 3]) == [4, 2, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006589", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(58, 53) == 3074\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(58, 53) == 3074\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006590", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('acb', 'acbd') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acb', 'acbd') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006591", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(93); s.push(7); s.push(92)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(93); s.push(7); s.push(92)\nassert s.peek() == 92\nassert s.pop() == 92\nassert s.pop() == 7\nassert s.is_empty() == False\nassert s.pop() == 93\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006592", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bbbacbc') == 'bac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbbacbc') == 'bac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006593", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'b': 32, 'd': 91, 'e': 33, 'c': 96}) == {32: 'b', 91: 'd', 33: 'e', 96: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 32, 'd': 91, 'e': 33, 'c': 96}) == {32: 'b', 91: 'd', 33: 'e', 96: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006594", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(24, 90, 695) == 116\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(24, 90, 695) == 116\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006595", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(20); s.push(5); s.push(26)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(20); s.push(5); s.push(26)\nassert s.peek() == 26\nassert s.pop() == 26\nassert s.pop() == 5\nassert s.is_empty() == False\nassert s.pop() == 20\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006596", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3333) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3333) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006597", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(67) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(67) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006598", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([1, 0, 6, 0, 0, 4, 9, 5], [5, 9, 2, 5, 4, 6, 5]) == [6, 4, 9, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 0, 6, 0, 0, 4, 9, 5], [5, 9, 2, 5, 4, 6, 5]) == [6, 4, 9, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006599", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=996; port=auto; host=on; mode=auto') == {'path': '996', 'port': 'auto', 'host': 'on', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=996; port=auto; host=on; mode=auto') == {'path': '996', 'port': 'auto', 'host': 'on', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006600", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(66) == 27\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(66) == 27\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006601", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([5, 9, 9, 15, 18], [1, 3, 9, 20]) == [1, 3, 5, 9, 9, 9, 15, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 9, 9, 15, 18], [1, 3, 9, 20]) == [1, 3, 5, 9, 9, 9, 15, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006602", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(97, 157) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(97, 157) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006603", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(26, 51, 72) == 8\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(26, 51, 72) == 8\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006604", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(9782) == 2879\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(9782) == 2879\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006605", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([6, 7, [9, 1, 5, 3]]) == [6, 7, 9, 1, 5, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, 7, [9, 1, 5, 3]]) == [6, 7, 9, 1, 5, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006606", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 3], [5, 4], [0, 2]], [[3, 3, 1], [3, 5, 2]]) == [[18, 24, 9], [27, 35, 13], [6, 10, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3], [5, 4], [0, 2]], [[3, 3, 1], [3, 5, 2]]) == [[18, 24, 9], [27, 35, 13], [6, 10, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006607", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([9, 1, 6, 9, 6, 1, 4], 5) == [[9, 1, 6, 9, 6], [1, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 1, 6, 9, 6, 1, 4], 5) == [[9, 1, 6, 9, 6], [1, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006608", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(6258) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6258) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006609", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 77, 'e': 80}) == {77: 'c', 80: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 77, 'e': 80}) == {77: 'c', 80: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006610", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([17, 13, 13, 16]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 13, 13, 16]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006611", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([8, 17, 25, 25, 16, 41, 12]) == [8, 12, 16, 17, 25, 25, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([8, 17, 25, 25, 16, 41, 12]) == [8, 12, 16, 17, 25, 25, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006612", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(343) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(343) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006613", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(20) == [2, 2, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(20) == [2, 2, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006614", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([8, [9]]) == [8, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [9]]) == [8, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006615", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(1217) == 'MCCXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1217) == 'MCCXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006616", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('abeebdad') == 'abed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abeebdad') == 'abed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006617", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('World World', 2) == 'Yqtnf Yqtnf'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World World', 2) == 'Yqtnf Yqtnf'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006618", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([3, 6, 8, 9, 12, 15], [8, 10, 14, 18]) == [3, 6, 8, 8, 9, 10, 12, 14, 15, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 6, 8, 9, 12, 15], [8, 10, 14, 18]) == [3, 6, 8, 8, 9, 10, 12, 14, 15, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006619", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[b((') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[b((') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006620", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(5151) == 71\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5151) == 71\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006621", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('1h58m33s') == 7113\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h58m33s') == 7113\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006622", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([47, -31, -42, 38, -13, 29, 13, 11]) == 47\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([47, -31, -42, 38, -13, 29, 13, 11]) == 47\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006623", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1348) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1348) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006624", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([3, [4, 8, 6]]) == 21\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3, [4, 8, 6]]) == 21\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006625", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 2, 1], [3, 4, 3], [0, 4, 5]], [[5, 5], [3, 2], [5, 5]]) == [[11, 9], [42, 38], [37, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2, 1], [3, 4, 3], [0, 4, 5]], [[5, 5], [3, 2], [5, 5]]) == [[11, 9], [42, 38], [37, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006626", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(3158) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3158) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006627", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(487)\nacc.deposit(267)\nacc.withdraw(600)\nacc.withdraw(828)\nassert acc.get_balance() == 754\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(487)\nacc.deposit(267)\nassert acc.get_balance() == 754\nacc.withdraw(600)\nassert acc.get_balance() == 154\nacc.withdraw(828)\nassert acc.get_balance() == 154\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006628", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(967256) == 983\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(967256) == 983\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006629", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1615) == 'MDCXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1615) == 'MDCXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006630", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[2, -4, -6], [0, -6, -9], [1, 1, 5]], [[0, -2, 1], [3, 8, 9], [-3, 7, -2]]) == [[2, -6, -5], [3, 2, 0], [-2, 8, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -4, -6], [0, -6, -9], [1, 1, 5]], [[0, -2, 1], [3, 8, 9], [-3, 7, -2]]) == [[2, -6, -5], [3, 2, 0], [-2, 8, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006631", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(19, 51) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 51) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006632", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(2681) == 'MMDCLXXXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2681) == 'MMDCLXXXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006633", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(1605) == 40\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1605) == 40\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006634", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([7, 2, 1, 1, 4, 9], 4) == [1, 1, 4, 9, 7, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 2, 1, 1, 4, 9], 4) == [1, 1, 4, 9, 7, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006635", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([41, 48, 24, 12, 41]) == [12, 24, 41, 41, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 48, 24, 12, 41]) == [12, 24, 41, 41, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006636", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('dc,ac,b,bdd,a') == ['dc', 'ac', 'b', 'bdd', 'a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dc,ac,b,bdd,a') == ['dc', 'ac', 'b', 'bdd', 'a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006637", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([36, 12, 5, 1, 28, 33, 47]) == [1, 5, 12, 28, 33, 36, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([36, 12, 5, 1, 28, 33, 47]) == [1, 5, 12, 28, 33, 36, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006638", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 12, 'b': 0}) == {12: 'f', 0: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 12, 'b': 0}) == {12: 'f', 0: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006639", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(2394) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2394) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006640", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([28, 25, 20, 6, 13, 6]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 25, 20, 6, 13, 6]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006641", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aababaaaa', 'abb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aababaaaa', 'abb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006642", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[6, 4], 3, 2]) == 15\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[6, 4], 3, 2]) == 15\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006643", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbdccaa') == 'b3d1c2a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbdccaa') == 'b3d1c2a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006644", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(7, 3) == 343\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 3) == 343\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006645", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('mdzktoinqcqlcv') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('mdzktoinqcqlcv') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006646", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('bbbbbbbbccccccccccccc') == 'b8c13'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbccccccccccccc') == 'b8c13'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006647", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 5, 'z': 3, 'w': 1}, {'z': 8}) == {'x': 5, 'z': 11, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 5, 'z': 3, 'w': 1}, {'z': 8}) == {'x': 5, 'z': 11, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006648", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbbbbbbdddd') == 'b9d4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbdddd') == 'b9d4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006649", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=190; mode=on; user=on') == {'host': '190', 'mode': 'on', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=190; mode=on; user=on') == {'host': '190', 'mode': 'on', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006650", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([14, 14, 31, 3, 48]) == [3, 14, 14, 31, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 14, 31, 3, 48]) == [3, 14, 14, 31, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006651", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 6, 5, 9, 4, 8, 7], [4, 6, 0, 6]) == [6, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 6, 5, 9, 4, 8, 7], [4, 6, 0, 6]) == [6, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006652", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 6], [4, 16]) == [0, 4, 6, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 6], [4, 16]) == [0, 4, 6, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006653", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-7, 2, 4, 1, 5, -7]) == [-7, -5, -1, 0, 5, -2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, 2, 4, 1, 5, -7]) == [-7, -5, -1, 0, 5, -2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006654", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(471)\nacc.deposit(77)\nacc.withdraw(138)\nacc.withdraw(586)\nassert acc.get_balance() == 548\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(471)\nacc.deposit(77)\nassert acc.get_balance() == 548\nacc.withdraw(138)\nassert acc.get_balance() == 410\nacc.withdraw(586)\nassert acc.get_balance() == 410\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006655", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([1, 5, 0, 3, 5, 8, 7, 1], 3) == [[1, 5, 0], [3, 5, 8], [7, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 5, 0, 3, 5, 8, 7, 1], 3) == [[1, 5, 0], [3, 5, 8], [7, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006656", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'date', 'banana', 'berry', 'avocado', 'avocado']) == {'c': ['coconut'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'date', 'banana', 'berry', 'avocado', 'avocado']) == {'c': ['coconut'], 'd': ['date'], 'b': ['banana', 'berry'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006657", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([25, 3, 15, 15, 14, 25]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 3, 15, 15, 14, 25]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006658", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(43, 13) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(43, 13) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006659", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 84, 'b': 75, 'e': 52, 'd': 99}) == {84: 'f', 75: 'b', 52: 'e', 99: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 84, 'b': 75, 'e': 52, 'd': 99}) == {84: 'f', 75: 'b', 52: 'e', 99: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006660", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXLIV') == 444\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXLIV') == 444\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006661", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 31, 'b': 93}) == {31: 'a', 93: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 31, 'b': 93}) == {31: 'a', 93: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006662", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('dbddd bgc') == 'dbddd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dbddd bgc') == 'dbddd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006663", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Cat The sun. Cat ran the') == {'cat': 2, 'the': 2, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat The sun. Cat ran the') == {'cat': 2, 'the': 2, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006664", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(263)\nacc.deposit(21)\nacc.withdraw(280)\nacc.withdraw(380)\nassert acc.get_balance() == 284\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(263)\nacc.deposit(21)\nassert acc.get_balance() == 284\nacc.withdraw(280)\nassert acc.get_balance() == 4\nacc.withdraw(380)\nassert acc.get_balance() == 4\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006665", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'banana', 'date']) == {'d': ['date', 'date'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'banana', 'date']) == {'d': ['date', 'date'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006666", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([5, [[3, 7]]]) == 15\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([5, [[3, 7]]]) == 15\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006667", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[5, 1]]) == [5, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 1]]) == [5, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006668", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([1, [5, 1], [0]]) == [1, 5, 1, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [5, 1], [0]]) == [1, 5, 1, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006669", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 84, 'd': 34, 'e': 75, 'b': 74}) == {84: 'a', 34: 'd', 75: 'e', 74: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 84, 'd': 34, 'e': 75, 'b': 74}) == {84: 'a', 34: 'd', 75: 'e', 74: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006670", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(1985) == 23\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1985) == 23\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006671", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([2, [6]]) == [2, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([2, [6]]) == [2, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006672", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([0, 10, -12, -13]) == -15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([0, 10, -12, -13]) == -15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006673", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['a', 'c', 'e', 'c', 'c', 'd']) == {'a': 1, 'c': 3, 'e': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'c', 'e', 'c', 'c', 'd']) == {'a': 1, 'c': 3, 'e': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006674", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 2, 3, 0, 3, 0, 1, 3, 5]) == [4, 2, 3, 0, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 3, 0, 3, 0, 1, 3, 5]) == [4, 2, 3, 0, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006675", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('{}[]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}[]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006676", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 3, 2, 5, 5, 1]) == [1, 3, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 2, 5, 5, 1]) == [1, 3, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006677", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 1, 'w': 1, 'y': 2}, {'w': 4, 'z': 5}) == {'x': 1, 'w': 5, 'y': 2, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 1, 'w': 1, 'y': 2}, {'w': 4, 'z': 5}) == {'x': 1, 'w': 5, 'y': 2, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006678", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(6, 24) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 24) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006679", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\"b,,\",ba,ed,61,98') == ['b,,', 'ba', 'ed', '61', '98']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"b,,\",ba,ed,61,98') == ['b,,', 'ba', 'ed', '61', '98']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006680", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 8, 1, 7, 0, 7, 5, 1, 6, 2], 5) == [[2, 8, 1, 7, 0], [7, 5, 1, 6, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 8, 1, 7, 0, 7, 5, 1, 6, 2], 5) == [[2, 8, 1, 7, 0], [7, 5, 1, 6, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006681", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=695; mode=off; user=on') == {'path': '695', 'mode': 'off', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=695; mode=off; user=on') == {'path': '695', 'mode': 'off', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006682", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 67, 'e': 93, 'f': 62, 'c': 96, 'b': 86}) == {67: 'a', 93: 'e', 62: 'f', 96: 'c', 86: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 67, 'e': 93, 'f': 62, 'c': 96, 'b': 86}) == {67: 'a', 93: 'e', 62: 'f', 96: 'c', 86: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006683", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(49, 54) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(49, 54) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006684", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat Ran cat the Sat Sat dog sat sun, sat') == {'sat': 5, 'ran': 1, 'cat': 1, 'the': 1, 'dog': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat Ran cat the Sat Sat dog sat sun, sat') == {'sat': 5, 'ran': 1, 'cat': 1, 'the': 1, 'dog': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006685", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[5, 8, -3, 5], [-1, -4, 1, 8]], [[-9, 6, -5, 1], [-1, 0, -3, 5]]) == [[-4, 14, -8, 6], [-2, -4, -2, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 8, -3, 5], [-1, -4, 1, 8]], [[-9, 6, -5, 1], [-1, 0, -3, 5]]) == [[-4, 14, -8, 6], [-2, -4, -2, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006686", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 43, 'd': 7, 'e': 61}) == {43: 'a', 7: 'd', 61: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 43, 'd': 7, 'e': 61}) == {43: 'a', 7: 'd', 61: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006687", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCCL') == 350\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCL') == 350\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006688", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([5, 5, 5, 6, 6, 2], 4) == [5, 6, 6, 2, 5, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 5, 5, 6, 6, 2], 4) == [5, 6, 6, 2, 5, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006689", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(8005) == 89\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8005) == 89\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006690", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(162, 193) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(162, 193) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006691", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(424) == 'CDXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(424) == 'CDXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006692", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(5, 58) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(5, 58) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006693", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('1h30m42s') == 5442\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h30m42s') == 5442\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006694", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([5, 6, 0], 3) == [5, 6, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 6, 0], 3) == [5, 6, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006695", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([3, 27, 0, 6, 3, 17, 20]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 27, 0, 6, 3, 17, 20]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006696", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog! Sun dog Ran cat dog ran!') == {'dog': 3, 'sun': 1, 'ran': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog! Sun dog Ran cat dog ran!') == {'dog': 3, 'sun': 1, 'ran': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006697", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'b': 2, 'd': 8}, 4) == {'d': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 2, 'd': 8}, 4) == {'d': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006698", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(969793) == 984\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(969793) == 984\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006699", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([36, 9, 26, 49, 40, 32, 26, 4, 15]) == [4, 9, 15, 26, 26, 32, 36, 40, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([36, 9, 26, 49, 40, 32, 26, 4, 15]) == [4, 9, 15, 26, 26, 32, 36, 40, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006700", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'y': 8, 'w': 9}, {'w': 7, 'y': 1, 'x': 7}) == {'z': 4, 'y': 9, 'w': 16, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'y': 8, 'w': 9}, {'w': 7, 'y': 1, 'x': 7}) == {'z': 4, 'y': 9, 'w': 16, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006701", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('ababbbba', 'aab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbbba', 'aab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006702", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([11, 19, 24, 40, 50, 53, 63, 72, 77, 82, 90, 99], 50) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([11, 19, 24, 40, 50, 53, 63, 72, 77, 82, 90, 99], 50) == 4\nassert binary_search([11, 19, 24, 40, 50, 53, 63, 72, 77, 82, 90, 99], 11) == 0\nassert binary_search([11, 19, 24, 40, 50, 53, 63, 72, 77, 82, 90, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006703", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(40, 22) == 440\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(40, 22) == 440\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006704", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([4]) == [4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([4]) == [4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006705", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([11, 62, 72, 95], 11) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([11, 62, 72, 95], 11) == 0\nassert binary_search([11, 62, 72, 95], 11) == 0\nassert binary_search([11, 62, 72, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006706", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'w': 2}, {'y': 6, 'x': 4}) == {'z': 9, 'w': 2, 'y': 6, 'x': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'w': 2}, {'y': 6, 'x': 4}) == {'z': 9, 'w': 2, 'y': 6, 'x': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006707", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(2084) == 'MMLXXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2084) == 'MMLXXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006708", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('b,93,ec,\"bba,\"') == ['b', '93', 'ec', 'bba,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('b,93,ec,\"bba,\"') == ['b', '93', 'ec', 'bba,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006709", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(444) == 'CDXLIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(444) == 'CDXLIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006710", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('a gagh ggbgd dbgbda edef') == 'dbgbda'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('a gagh ggbgd dbgbda edef') == 'dbgbda'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006711", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 6, 0, 7], 2) == [[2, 6], [0, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 6, 0, 7], 2) == [[2, 6], [0, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006712", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cbxx', 'cbyz', 'cbxy']) == 'cb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cbxx', 'cbyz', 'cbxy']) == 'cb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006713", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(21, 17) == 357\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 17) == 357\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006714", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(309) == 'CCCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(309) == 'CCCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006715", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 58, 'e': 66}) == {58: 'a', 66: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 58, 'e': 66}) == {58: 'a', 66: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006716", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[1, 5], [3, 1], [2, 4]], [[1, 2], [0, 3]]) == [[1, 17], [3, 9], [2, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5], [3, 1], [2, 4]], [[1, 2], [0, 3]]) == [[1, 17], [3, 9], [2, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006717", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[6, 1], [8, 8, 7, 0], [4, 7, 3, 4], [5, 7]]) == [6, 1, 8, 8, 7, 0, 4, 7, 3, 4, 5, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 1], [8, 8, 7, 0], [4, 7, 3, 4], [5, 7]]) == [6, 1, 8, 8, 7, 0, 4, 7, 3, 4, 5, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006718", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(834) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(834) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006719", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[2, 7, 7], [8, 2, 7], [2, 5, 0], [5, 8, 1]]) == [[2, 8, 2, 5], [7, 2, 5, 8], [7, 7, 0, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 7, 7], [8, 2, 7], [2, 5, 0], [5, 8, 1]]) == [[2, 8, 2, 5], [7, 2, 5, 8], [7, 7, 0, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006720", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('56,5') == ['56', '5']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('56,5') == ['56', '5']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006721", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('2h55m56s') == 10556\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h55m56s') == 10556\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006722", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('tcwn') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('tcwn') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006723", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(6253) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6253) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006724", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([7, 41, 6, 27, 14, 35]) == [6, 7, 14, 27, 35, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([7, 41, 6, 27, 14, 35]) == [6, 7, 14, 27, 35, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006725", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-4, -1], [0, 1]], [[-5, -3], [4, -9]]) == [[-9, -4], [4, -8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -1], [0, 1]], [[-5, -3], [4, -9]]) == [[-9, -4], [4, -8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006726", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[5, 9, 6, 1], [8, 2, 2, 4]]) == [[5, 8], [9, 2], [6, 2], [1, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 9, 6, 1], [8, 2, 2, 4]]) == [[5, 8], [9, 2], [6, 2], [1, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006727", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 1, 4], [3, 1, 0]], [[1, 3, 2], [3, 3, 4], [4, 4, 5]]) == [[24, 34, 34], [6, 12, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 1, 4], [3, 1, 0]], [[1, 3, 2], [3, 3, 4], [4, 4, 5]]) == [[24, 34, 34], [6, 12, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006728", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('aca g') == 'aca'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('aca g') == 'aca'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006729", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran the. sat dog ran The') == {'ran': 2, 'the': 2, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran the. sat dog ran The') == {'ran': 2, 'the': 2, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006730", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(413) == 'CDXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(413) == 'CDXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006731", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'berry', 'coconut', 'avocado', 'berry', 'coconut']) == {'b': ['berry', 'berry', 'berry'], 'c': ['coconut', 'coconut'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'coconut', 'avocado', 'berry', 'coconut']) == {'b': ['berry', 'berry', 'berry'], 'c': ['coconut', 'coconut'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006732", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([0, 4, 7, 7, 6, 6, 7], 3) == [[0, 4, 7], [7, 6, 6], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 4, 7, 7, 6, 6, 7], 3) == [[0, 4, 7], [7, 6, 6], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006733", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([17, 17]) == 34\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([17, 17]) == 34\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006734", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(30)\nacc.deposit(223)\nacc.withdraw(57)\nacc.withdraw(362)\nassert acc.get_balance() == 253\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(30)\nacc.deposit(223)\nassert acc.get_balance() == 253\nacc.withdraw(57)\nassert acc.get_balance() == 196\nacc.withdraw(362)\nassert acc.get_balance() == 196\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006735", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 0, 5, 4, 2, 5, 4, 5]) == [1, 0, 5, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 0, 5, 4, 2, 5, 4, 5]) == [1, 0, 5, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006736", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ddd') == 'd3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddd') == 'd3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006737", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([0, 3, 43, 59], 43) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 3, 43, 59], 43) == 2\nassert binary_search([0, 3, 43, 59], 0) == 0\nassert binary_search([0, 3, 43, 59], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006738", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-2, -16, -13]) == -31\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-2, -16, -13]) == -31\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006739", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([11, 2, -8, 10]) == 15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([11, 2, -8, 10]) == 15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006740", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[0, 8, 5], [9, 1, 4], [5, 1, 4], [8, 7, 6]]) == [[0, 9, 5, 8], [8, 1, 1, 7], [5, 4, 4, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 8, 5], [9, 1, 4], [5, 1, 4], [8, 7, 6]]) == [[0, 9, 5, 8], [8, 1, 1, 7], [5, 4, 4, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006741", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(65, 56) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(65, 56) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006742", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 4, 5, 6, 8, 7], 4) == [5, 6, 8, 7, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 4, 5, 6, 8, 7], 4) == [5, 6, 8, 7, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006743", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([0, 6, 6, 1], 3) == [[0, 6, 6], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 6, 6, 1], 3) == [[0, 6, 6], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006744", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([27, 45, 42, 16, 22, 7, 3]) == [3, 7, 16, 22, 27, 42, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([27, 45, 42, 16, 22, 7, 3]) == [3, 7, 16, 22, 27, 42, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006745", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('eccdec') == 'Eccdec'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eccdec') == 'Eccdec'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006746", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 8, 9, 6, 9, 0, 9], [5, 8, 9, 9, 8, 8, 0, 1]) == [8, 9, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 8, 9, 6, 9, 0, 9], [5, 8, 9, 9, 8, 8, 0, 1]) == [8, 9, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006747", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[5, [7], 6], 6, [[3, 1], [9, 1, 3]]]) == [5, 7, 6, 6, 3, 1, 9, 1, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, [7], 6], 6, [[3, 1], [9, 1, 3]]]) == [5, 7, 6, 6, 3, 1, 9, 1, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006748", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(92); s.push(22); s.push(40)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(92); s.push(22); s.push(40)\nassert s.peek() == 40\nassert s.pop() == 40\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 92\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006749", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('cabbaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cabbaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006750", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(45); s.push(12); s.push(77)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(45); s.push(12); s.push(77)\nassert s.peek() == 77\nassert s.pop() == 77\nassert s.pop() == 12\nassert s.is_empty() == False\nassert s.pop() == 45\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006751", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([1, 12, 17, 35, 70], 12) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 12, 17, 35, 70], 12) == 1\nassert binary_search([1, 12, 17, 35, 70], 1) == 0\nassert binary_search([1, 12, 17, 35, 70], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006752", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[5, 8, 4], [0], 5, [2, 7, 4], 9]) == [5, 8, 4, 0, 5, 2, 7, 4, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 8, 4], [0], 5, [2, 7, 4], 9]) == [5, 8, 4, 0, 5, 2, 7, 4, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006753", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([3, 6, 8], [6, 1, 2, 1, 4]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 6, 8], [6, 1, 2, 1, 4]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006754", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(57)\nacc.deposit(124)\nacc.withdraw(157)\nacc.withdraw(255)\nassert acc.get_balance() == 181\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(57)\nacc.deposit(124)\nassert acc.get_balance() == 181\nacc.withdraw(157)\nassert acc.get_balance() == 24\nacc.withdraw(255)\nassert acc.get_balance() == 24\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006755", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 8, 5, 3, 5, 0, 9], 5) == [[6, 8, 5, 3, 5], [0, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 8, 5, 3, 5, 0, 9], 5) == [[6, 8, 5, 3, 5], [0, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006756", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[9, 0, 9], [-9, 1, -1]], [[0, 2, 4], [-9, 8, 6]]) == [[9, 2, 13], [-18, 9, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, 0, 9], [-9, 1, -1]], [[0, 2, 4], [-9, 8, 6]]) == [[9, 2, 13], [-18, 9, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006757", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(8276) == 6728\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8276) == 6728\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006758", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('cefez') == 'zefec'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cefez') == 'zefec'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006759", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDLXVII') == 467\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDLXVII') == 467\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006760", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 6, 7, 2], 8) == [2, 6, 7, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 6, 7, 2], 8) == [2, 6, 7, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006761", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(27, 29) == 783\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(27, 29) == 783\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006762", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([41, 18, 2, 18]) == [2, 18, 18, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 18, 2, 18]) == [2, 18, 18, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006763", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([1, 21, 22, 37, 41, 58, 84, 95], 21) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 21, 22, 37, 41, 58, 84, 95], 21) == 1\nassert binary_search([1, 21, 22, 37, 41, 58, 84, 95], 1) == 0\nassert binary_search([1, 21, 22, 37, 41, 58, 84, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006764", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('5h39m') == 20340\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h39m') == 20340\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006765", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([30, 11, 38, 27, 45, 6, 4, 33]) == [4, 6, 11, 27, 30, 33, 38, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([30, 11, 38, 27, 45, 6, 4, 33]) == [4, 6, 11, 27, 30, 33, 38, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006766", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('xabkakldyco') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('xabkakldyco') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006767", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('20') == 20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20') == 20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006768", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[7, 7, 7, 6], [4, 0, 9, 2], [2, 8, 0, 4], [3, 4, 8, 8]]) == [[7, 4, 2, 3], [7, 0, 8, 4], [7, 9, 0, 8], [6, 2, 4, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 7, 7, 6], [4, 0, 9, 2], [2, 8, 0, 4], [3, 4, 8, 8]]) == [[7, 4, 2, 3], [7, 0, 8, 4], [7, 9, 0, 8], [6, 2, 4, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006769", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('World Python', 16) == 'Mehbt Fojxed'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Python', 16) == 'Mehbt Fojxed'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006770", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-8, -8, -8, 12]) == -12\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-8, -8, -8, 12]) == -12\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006771", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(247) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(247) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006772", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'d': 0, 'c': 3, 'a': 3}, 5) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 0, 'c': 3, 'a': 3}, 5) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006773", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[0, -6, -4], [8, 0, -6], [6, -1, 4]], [[-8, 5, 0], [6, -9, 4], [-3, -9, 3]]) == [[-8, -1, -4], [14, -9, -2], [3, -10, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -6, -4], [8, 0, -6], [6, -1, 4]], [[-8, 5, 0], [6, -9, 4], [-3, -9, 3]]) == [[-8, -1, -4], [14, -9, -2], [3, -10, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006774", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('19,aaa,ab,93') == ['19', 'aaa', 'ab', '93']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('19,aaa,ab,93') == ['19', 'aaa', 'ab', '93']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006775", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(654) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(654) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006776", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('bhdg b') == 'bhdg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bhdg b') == 'bhdg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006777", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('cbaabcbcccccab', 'aba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbaabcbcccccab', 'aba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006778", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([3, 9, 8, 4, 0, 1], 4) == [[3, 9, 8, 4], [0, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 9, 8, 4, 0, 1], 4) == [[3, 9, 8, 4], [0, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006779", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=793; mode=703') == {'host': '793', 'mode': '703'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=793; mode=703') == {'host': '793', 'mode': '703'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006780", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(11); s.push(49); s.push(50)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(11); s.push(49); s.push(50)\nassert s.peek() == 50\nassert s.pop() == 50\nassert s.pop() == 49\nassert s.is_empty() == False\nassert s.pop() == 11\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006781", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([6, [[8, 3, 9], [7]], [6, [8, 8, 1], [6, 9]]]) == [6, 8, 3, 9, 7, 6, 8, 8, 1, 6, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([6, [[8, 3, 9], [7]], [6, [8, 8, 1], [6, 9]]]) == [6, 8, 3, 9, 7, 6, 8, 8, 1, 6, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006782", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sun sun. dog ran.') == {'sun': 2, 'dog': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun. dog ran.') == {'sun': 2, 'dog': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006783", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(39, 7) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(39, 7) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006784", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(45); s.push(30); s.push(9)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(45); s.push(30); s.push(9)\nassert s.peek() == 9\nassert s.pop() == 9\nassert s.pop() == 30\nassert s.is_empty() == False\nassert s.pop() == 45\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006785", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(146) == 116\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(146) == 116\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006786", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([30, 5, 6, 8, 28, 6, 29, 49]) == [5, 6, 6, 8, 28, 29, 30, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 5, 6, 8, 28, 6, 29, 49]) == [5, 6, 6, 8, 28, 29, 30, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006787", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([4, 3, 8, 3, 11, 13, -8]) == 13\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([4, 3, 8, 3, 11, 13, -8]) == 13\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006788", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('35m42s') == 2142\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('35m42s') == 2142\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006789", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(57); s.push(60); s.push(74)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(57); s.push(60); s.push(74)\nassert s.peek() == 74\nassert s.pop() == 74\nassert s.pop() == 60\nassert s.is_empty() == False\nassert s.pop() == 57\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006790", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('adcbd beabbb cbb') == 'Adcbd Beabbb Cbb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('adcbd beabbb cbb') == 'Adcbd Beabbb Cbb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006791", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=on; mode=805; user=133; port=13') == {'host': 'on', 'mode': '805', 'user': '133', 'port': '13'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; mode=805; user=133; port=13') == {'host': 'on', 'mode': '805', 'user': '133', 'port': '13'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006792", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8920) == 19\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8920) == 19\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006793", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[7, 0], [2, 4], [9, 3]]) == [[7, 2, 9], [0, 4, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 0], [2, 4], [9, 3]]) == [[7, 2, 9], [0, 4, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006794", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(43) == 'XLIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(43) == 'XLIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006795", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog sat Sun ran dog!') == {'dog': 2, 'sat': 1, 'sun': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat Sun ran dog!') == {'dog': 2, 'sat': 1, 'sun': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006796", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('cbcbacabcaabac', 'cba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbcbacabcaabac', 'cba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006797", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(5, 23) == 115\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 23) == 115\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006798", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-2, 5, 8, 1, -4, 7, -1]) == [-2, 3, 11, 12, 8, 15, 14]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-2, 5, 8, 1, -4, 7, -1]) == [-2, 3, 11, 12, 8, 15, 14]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006799", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(70) == [2, 5, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(70) == [2, 5, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006800", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 42, 'c': 62, 'e': 98, 'd': 97, 'f': 22}) == {42: 'a', 62: 'c', 98: 'e', 97: 'd', 22: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 42, 'c': 62, 'e': 98, 'd': 97, 'f': 22}) == {42: 'a', 62: 'c', 98: 'e', 97: 'd', 22: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006801", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 23, 'e': 59, 'd': 33, 'f': 71, 'a': 9}) == {23: 'c', 59: 'e', 33: 'd', 71: 'f', 9: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 23, 'e': 59, 'd': 33, 'f': 71, 'a': 9}) == {23: 'c', 59: 'e', 33: 'd', 71: 'f', 9: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006802", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'coconut', 'banana', 'date', 'banana', 'avocado', 'berry']) == {'a': ['apple', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['banana', 'banana', 'berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'coconut', 'banana', 'date', 'banana', 'avocado', 'berry']) == {'a': ['apple', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['banana', 'banana', 'berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006803", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([8, 0, 5, 4, 0], 3) == [[8, 0, 5], [4, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 0, 5, 4, 0], 3) == [[8, 0, 5], [4, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006804", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('eecd') == 'ecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eecd') == 'ecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006805", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([0, 28, 7, 21, 6]) == [0, 6, 7, 21, 28]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([0, 28, 7, 21, 6]) == [0, 6, 7, 21, 28]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006806", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 8, 4, 0, 2, 1, 6, 8, 5, 3], 5) == [[4, 8, 4, 0, 2], [1, 6, 8, 5, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 8, 4, 0, 2, 1, 6, 8, 5, 3], 5) == [[4, 8, 4, 0, 2], [1, 6, 8, 5, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006807", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([22, 1, 24, 48, 22, 24, 23, 26, 23, 6, 11, 3]) == [1, 3, 6, 11, 22, 22, 23, 23, 24, 24, 26, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 1, 24, 48, 22, 24, 23, 26, 23, 6, 11, 3]) == [1, 3, 6, 11, 22, 22, 23, 23, 24, 24, 26, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006808", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('36,\"bbb,a\",caab,50') == ['36', 'bbb,a', 'caab', '50']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('36,\"bbb,a\",caab,50') == ['36', 'bbb,a', 'caab', '50']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006809", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 0, 2, 0, 3, 1]) == [3, 0, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 2, 0, 3, 1]) == [3, 0, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006810", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 2, 4, 4, 2, 2]) == [0, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 4, 4, 2, 2]) == [0, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006811", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([29, 35, 87], 87) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([29, 35, 87], 87) == 2\nassert binary_search([29, 35, 87], 29) == 0\nassert binary_search([29, 35, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006812", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(21, 11) == 231\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 11) == 231\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006813", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('bbbddbb') == 'b3d2b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbddbb') == 'b3d2b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006814", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 7, 2, 8, 4, 6, 3, 4, 0], 7) == [2, 8, 4, 6, 3, 4, 0, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 7, 2, 8, 4, 6, 3, 4, 0], 7) == [2, 8, 4, 6, 3, 4, 0, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006815", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(48, 58) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 58) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006816", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(94); s.push(13); s.push(49)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(94); s.push(13); s.push(49)\nassert s.peek() == 49\nassert s.pop() == 49\nassert s.pop() == 13\nassert s.is_empty() == False\nassert s.pop() == 94\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006817", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 4, 8, 2, 7, 1, 7], 2) == [1, 7, 3, 4, 8, 2, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 4, 8, 2, 7, 1, 7], 2) == [1, 7, 3, 4, 8, 2, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006818", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-7, 2], [-1, 3], [-9, 9]], [[6, 0], [1, -6], [7, 3]]) == [[-1, 2], [0, -3], [-2, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 2], [-1, 3], [-9, 9]], [[6, 0], [1, -6], [7, 3]]) == [[-1, 2], [0, -3], [-2, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006819", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 19, 19, 19], [8]) == [0, 8, 19, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 19, 19, 19], [8]) == [0, 8, 19, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006820", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(259) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(259) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006821", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 54, 'c': 37, 'e': 35}) == {54: 'd', 37: 'c', 35: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 54, 'c': 37, 'e': 35}) == {54: 'd', 37: 'c', 35: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006822", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(53, 20) == 1060\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(53, 20) == 1060\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006823", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['bbx', 'bb', 'bb', 'bby']) == 'bb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bbx', 'bb', 'bb', 'bby']) == 'bb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006824", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 9, 'x': 8, 'w': 7}, {'y': 7}) == {'y': 16, 'x': 8, 'w': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9, 'x': 8, 'w': 7}, {'y': 7}) == {'y': 16, 'x': 8, 'w': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006825", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(22) == [2, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(22) == [2, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006826", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([2, 26, 25, 10, 40, 20, 23, 40, 21, 36, 35, 29]) == [2, 10, 20, 21, 23, 25, 26, 29, 35, 36, 40, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([2, 26, 25, 10, 40, 20, 23, 40, 21, 36, 35, 29]) == [2, 10, 20, 21, 23, 25, 26, 29, 35, 36, 40, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006827", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('zbab') == 'babz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zbab') == 'babz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006828", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([31, 39, 46, 45, 0]) == [0, 31, 39, 45, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([31, 39, 46, 45, 0]) == [0, 31, 39, 45, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006829", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(59); s.push(71); s.push(79)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(59); s.push(71); s.push(79)\nassert s.peek() == 79\nassert s.pop() == 79\nassert s.pop() == 71\nassert s.is_empty() == False\nassert s.pop() == 59\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006830", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([8, 5, 8, 2, 2, 5, -5, 2]) == [8, 13, 21, 23, 25, 30, 25, 27]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([8, 5, 8, 2, 2, 5, -5, 2]) == [8, 13, 21, 23, 25, 30, 25, 27]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006831", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(303) == 'CCCIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(303) == 'CCCIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006832", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(298) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(298) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006833", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('addeee ec effcfgha gegbcgee a') == 'effcfgha'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('addeee ec effcfgha gegbcgee a') == 'effcfgha'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006834", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([30, 12, 37, 31, 31]) == [12, 30, 31, 31, 37]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 12, 37, 31, 31]) == [12, 30, 31, 31, 37]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006835", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gghegc bffgdegb ga') == 'bffgdegb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gghegc bffgdegb ga') == 'bffgdegb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006836", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([38, 5, 39, 47, 15, 18, 13, 40]) == [5, 13, 15, 18, 38, 39, 40, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([38, 5, 39, 47, 15, 18, 13, 40]) == [5, 13, 15, 18, 38, 39, 40, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006837", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 3, 3, 5, 1, 5, 0, 5]) == [1, 3, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 3, 5, 1, 5, 0, 5]) == [1, 3, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006838", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 6, 1, 9], 4) == [[2, 6, 1, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 6, 1, 9], 4) == [[2, 6, 1, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006839", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(399) == [3, 7, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(399) == [3, 7, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006840", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[]{}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006841", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[0, 9], [4, 8, 3], [9]]) == 33\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 9], [4, 8, 3], [9]]) == 33\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006842", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(4173) == 3714\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4173) == 3714\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006843", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(187)\nacc.deposit(52)\nacc.withdraw(22)\nacc.withdraw(282)\nassert acc.get_balance() == 239\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(187)\nacc.deposit(52)\nassert acc.get_balance() == 239\nacc.withdraw(22)\nassert acc.get_balance() == 217\nacc.withdraw(282)\nassert acc.get_balance() == 217\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006844", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('11m56s') == 716\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('11m56s') == 716\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006845", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([8, 7]) == [8, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([8, 7]) == [8, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006846", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCLXXIX') == 279\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXIX') == 279\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006847", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abbaaabab', 'abab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbaaabab', 'abab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006848", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(966) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(966) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006849", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('2h13m19s') == 7999\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h13m19s') == 7999\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006850", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 3, 1, 5, 1, 1]) == [2, 3, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 1, 5, 1, 1]) == [2, 3, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006851", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([1, 6, 2, 0, 1, 5, 9], [3, 4, 3, 1, 5]) == [1, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 6, 2, 0, 1, 5, 9], [3, 4, 3, 1, 5]) == [1, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006852", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(255) == 47\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(255) == 47\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006853", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([13, 10, 28, 24, 12]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([13, 10, 28, 24, 12]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006854", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(167299) == 409\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(167299) == 409\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006855", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(65, 155) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(65, 155) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006856", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([46, 19, 31, 7]) == [7, 19, 31, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 19, 31, 7]) == [7, 19, 31, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006857", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 7, 9, 17, 21, 39, 50, 71, 75, 80, 83], 134) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 7, 9, 17, 21, 39, 50, 71, 75, 80, 83], 134) == -1\nassert binary_search([5, 7, 9, 17, 21, 39, 50, 71, 75, 80, 83], 5) == 0\nassert binary_search([5, 7, 9, 17, 21, 39, 50, 71, 75, 80, 83], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006858", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('eceaec') == 'eca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eceaec') == 'eca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006859", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([3, 2, 2], [5, 4, 6, 7, 6, 8]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 2, 2], [5, 4, 6, 7, 6, 8]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006860", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('opvnuhsldcevks') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('opvnuhsldcevks') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006861", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('ulgjakjhubwr') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ulgjakjhubwr') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006862", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=619; user=207') == {'host': '619', 'user': '207'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=619; user=207') == {'host': '619', 'user': '207'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006863", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('a,81,\",aaab\",e,9') == ['a', '81', ',aaab', 'e', '9']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('a,81,\",aaab\",e,9') == ['a', '81', ',aaab', 'e', '9']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006864", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([7, [3], 4, 8, [1, 1, 0, 9]]) == [7, 3, 4, 8, 1, 1, 0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([7, [3], 4, 8, [1, 1, 0, 9]]) == [7, 3, 4, 8, 1, 1, 0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006865", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(226) == 'CCXXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(226) == 'CCXXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006866", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 9, 2, 2, 3, 4, 7, 2, 6, 8, 7, 9, 2, 9, 9], 3) == [[9, 9, 2], [2, 3, 4], [7, 2, 6], [8, 7, 9], [2, 9, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 9, 2, 2, 3, 4, 7, 2, 6, 8, 7, 9, 2, 9, 9], 3) == [[9, 9, 2], [2, 3, 4], [7, 2, 6], [8, 7, 9], [2, 9, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006867", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabaabbaaabaaab', 'bb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabbaaabaaab', 'bb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006868", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('eebb,61,d') == ['eebb', '61', 'd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('eebb,61,d') == ['eebb', '61', 'd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006869", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(58); s.push(94); s.push(19)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(58); s.push(94); s.push(19)\nassert s.peek() == 19\nassert s.pop() == 19\nassert s.pop() == 94\nassert s.is_empty() == False\nassert s.pop() == 58\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006870", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([7, 26, 9, 22, 26]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 26, 9, 22, 26]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006871", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(16 + 1)') == 17\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(16 + 1)') == 17\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006872", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(15) == 17\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(15) == 17\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006873", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[4, 4, 5], [2, 0, 4], [1, 0, 3]], [[0, 2, 0], [4, 1, 2], [1, 2, 3]]) == [[21, 22, 23], [4, 12, 12], [3, 8, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 4, 5], [2, 0, 4], [1, 0, 3]], [[0, 2, 0], [4, 1, 2], [1, 2, 3]]) == [[21, 22, 23], [4, 12, 12], [3, 8, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006874", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 5, 5, 2]) == [5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 5, 2]) == [5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006875", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('ghcb dbbge dgaace aadgff faebfhd') == 'faebfhd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ghcb dbbge dgaace aadgff faebfhd') == 'faebfhd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006876", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[5, 0], [2, 2], [6, 6], [6, 7]]) == [[5, 2, 6, 6], [0, 2, 6, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 0], [2, 2], [6, 6], [6, 7]]) == [[5, 2, 6, 6], [0, 2, 6, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006877", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(130)\nacc.deposit(202)\nacc.withdraw(284)\nacc.withdraw(392)\nassert acc.get_balance() == 332\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(130)\nacc.deposit(202)\nassert acc.get_balance() == 332\nacc.withdraw(284)\nassert acc.get_balance() == 48\nacc.withdraw(392)\nassert acc.get_balance() == 48\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006878", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('aefe', 'aefee') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('aefe', 'aefee') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006879", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog, cat dog. dog,') == {'dog': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog, cat dog. dog,') == {'dog': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006880", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaaddddddddbbbb') == 'a3d8b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaddddddddbbbb') == 'a3d8b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006881", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'x': 1, 'y': 7}) == {'y': 8, 'x': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'x': 1, 'y': 7}) == {'y': 8, 'x': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006882", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMCMXCVIII') == 2998\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCMXCVIII') == 2998\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006883", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[[0], [2, 2, 7]]]) == [0, 2, 2, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[0], [2, 2, 7]]]) == [0, 2, 2, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006884", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(126)\nacc.deposit(193)\nacc.withdraw(5)\nacc.withdraw(338)\nassert acc.get_balance() == 319\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(126)\nacc.deposit(193)\nassert acc.get_balance() == 319\nacc.withdraw(5)\nassert acc.get_balance() == 314\nacc.withdraw(338)\nassert acc.get_balance() == 314\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006885", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('9m27s') == 567\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('9m27s') == 567\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006886", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([16, 29, 49, 62, 83, 85, 93], 85) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 29, 49, 62, 83, 85, 93], 85) == 5\nassert binary_search([16, 29, 49, 62, 83, 85, 93], 16) == 0\nassert binary_search([16, 29, 49, 62, 83, 85, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006887", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 2], [5, 1]], [[3, 3, 2], [2, 0, 5]]) == [[19, 15, 20], [17, 15, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 2], [5, 1]], [[3, 3, 2], [2, 0, 5]]) == [[19, 15, 20], [17, 15, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006888", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(1607) == 40\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1607) == 40\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006889", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(8, 6) == 262144\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 6) == 262144\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006890", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([5, 1, 2, [4, 0, 0, 1], 4]) == [5, 1, 2, 4, 0, 0, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 1, 2, [4, 0, 0, 1], 4]) == [5, 1, 2, 4, 0, 0, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006891", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'z': 9}) == {'y': 1, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'z': 9}) == {'y': 1, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006892", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 8, 7], 3) == [8, 8, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 8, 7], 3) == [8, 8, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006893", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([44, 18, 42]) == [18, 42, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([44, 18, 42]) == [18, 42, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006894", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[8, -7], [2, -7]], [[2, 4], [-5, 4]]) == [[10, -3], [-3, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -7], [2, -7]], [[2, 4], [-5, 4]]) == [[10, -3], [-3, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006895", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=938; user=684; host=986') == {'mode': '938', 'user': '684', 'host': '986'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=938; user=684; host=986') == {'mode': '938', 'user': '684', 'host': '986'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006896", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[{)((b(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{)((b(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006897", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([0, 6, 8, -6, -4]) == [0, 6, 14, 8, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([0, 6, 8, -6, -4]) == [0, 6, 14, 8, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006898", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 4, 6, 2, 8, 9, 9], [8, 9, 7, 7, 8, 2, 2, 8]) == [2, 8, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 4, 6, 2, 8, 9, 9], [8, 9, 7, 7, 8, 2, 2, 8]) == [2, 8, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006899", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[2, 6]]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, 6]]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006900", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 73, 'e': 97, 'c': 74, 'f': 93, 'd': 89}) == {73: 'b', 97: 'e', 74: 'c', 93: 'f', 89: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 73, 'e': 97, 'c': 74, 'f': 93, 'd': 89}) == {73: 'b', 97: 'e', 74: 'c', 93: 'f', 89: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006901", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[2, -4, 2], [-4, 3, -3], [0, -8, -9]], [[-8, 3, 2], [1, -6, 3], [-7, 1, 4]]) == [[-6, -1, 4], [-3, -3, 0], [-7, -7, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -4, 2], [-4, 3, -3], [0, -8, -9]], [[-8, 3, 2], [1, -6, 3], [-7, 1, 4]]) == [[-6, -1, 4], [-3, -3, 0], [-7, -7, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006902", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 9, 1, 8, 9, 4, 2], 5) == [[4, 9, 1, 8, 9], [4, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 9, 1, 8, 9, 4, 2], 5) == [[4, 9, 1, 8, 9], [4, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006903", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('bbaxezx') == 'xzexabb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bbaxezx') == 'xzexabb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006904", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-4, 8, -19]) == -15\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-4, 8, -19]) == -15\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006905", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(7356) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7356) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006906", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(75) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(75) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006907", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['date', 'date', 'banana', 'avocado', 'banana', 'date', 'cherry']) == {'d': ['date', 'date', 'date'], 'b': ['banana', 'banana'], 'a': ['avocado'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'date', 'banana', 'avocado', 'banana', 'date', 'cherry']) == {'d': ['date', 'date', 'date'], 'b': ['banana', 'banana'], 'a': ['avocado'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006908", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 5, 1, 3, 4, 3]) == [3, 5, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 1, 3, 4, 3]) == [3, 5, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006909", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(3488) == 23\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3488) == 23\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006910", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([30, 1, 25, 41, 3, 47, 42, 48]) == [1, 3, 25, 30, 41, 42, 47, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([30, 1, 25, 41, 3, 47, 42, 48]) == [1, 3, 25, 30, 41, 42, 47, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006911", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(15); s.push(88); s.push(43)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(15); s.push(88); s.push(43)\nassert s.peek() == 43\nassert s.pop() == 43\nassert s.pop() == 88\nassert s.is_empty() == False\nassert s.pop() == 15\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006912", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([39, 17, 25, 25]) == [17, 25, 25, 39]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([39, 17, 25, 25]) == [17, 25, 25, 39]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006913", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([31, 47, 40, 6, 23]) == [6, 23, 31, 40, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([31, 47, 40, 6, 23]) == [6, 23, 31, 40, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006914", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 13) == 'klm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 13) == 'klm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006915", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aecbaecb') == 'aecb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aecbaecb') == 'aecb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006916", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(499) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(499) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006917", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('32,b,cc,cc,b') == ['32', 'b', 'cc', 'cc', 'b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('32,b,cc,cc,b') == ['32', 'b', 'cc', 'cc', 'b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006918", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([0, 5, 6, 6, 7, 2, 2, 2, 0, 6, 1, 9, 4], 4) == [[0, 5, 6, 6], [7, 2, 2, 2], [0, 6, 1, 9], [4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 5, 6, 6, 7, 2, 2, 2, 0, 6, 1, 9, 4], 4) == [[0, 5, 6, 6], [7, 2, 2, 2], [0, 6, 1, 9], [4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006919", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[6, 5, 5], [1, 9, 8], 0, [9, 7]]) == [6, 5, 5, 1, 9, 8, 0, 9, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 5, 5], [1, 9, 8], 0, [9, 7]]) == [6, 5, 5, 1, 9, 8, 0, 9, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006920", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(7533) == 86\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7533) == 86\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006921", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(22, 24) == 264\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 24) == 264\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006922", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(5363) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5363) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006923", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([20, 43, 35, 47, 10, 20]) == [10, 20, 20, 35, 43, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 43, 35, 47, 10, 20]) == [10, 20, 20, 35, 43, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006924", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(15) == [3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(15) == [3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006925", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'c': 8, 'd': 9}, 5) == {'c': 8, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 8, 'd': 9}, 5) == {'c': 8, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006926", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ddabaaddcdaacb') == 'dabc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddabaaddcdaacb') == 'dabc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006927", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('4h6m16s') == 14776\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h6m16s') == 14776\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006928", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[][][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006929", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([14, 15, 4, 0, 23, 0, 2, 17, 4]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 15, 4, 0, 23, 0, 2, 17, 4]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006930", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 9}, {'w': 5}) == {'x': 9, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9}, {'w': 5}) == {'x': 9, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006931", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['date', 'apple', 'apple', 'cherry', 'date', 'avocado', 'banana', 'coconut']) == {'d': ['date', 'date'], 'a': ['apple', 'apple', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'apple', 'cherry', 'date', 'avocado', 'banana', 'coconut']) == {'d': ['date', 'date'], 'a': ['apple', 'apple', 'avocado'], 'c': ['cherry', 'coconut'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006932", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-14, -18, -42, -23, 32, 15, 1]) == 32\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-14, -18, -42, -23, 32, 15, 1]) == 32\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006933", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-7, -4, -7, 4, -1]) == [-7, -11, -18, -14, -15]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -4, -7, 4, -1]) == [-7, -11, -18, -14, -15]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006934", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([9, -7, -6, 5, 4, 2]) == [9, 2, -4, 1, 5, 7]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, -7, -6, 5, 4, 2]) == [9, 2, -4, 1, 5, 7]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006935", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 17, 'b': 92, 'a': 7}) == {17: 'c', 92: 'b', 7: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 17, 'b': 92, 'a': 7}) == {17: 'c', 92: 'b', 7: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006936", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(83); s.push(80); s.push(44)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(80); s.push(44)\nassert s.peek() == 44\nassert s.pop() == 44\nassert s.pop() == 80\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006937", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([44, 25, 44, 23, 40, 26]) == [23, 25, 26, 40, 44, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([44, 25, 44, 23, 40, 26]) == [23, 25, 26, 40, 44, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006938", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([42, 46, 37, 2, 38, 26, 43, 36, 24]) == [2, 24, 26, 36, 37, 38, 42, 43, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([42, 46, 37, 2, 38, 26, 43, 36, 24]) == [2, 24, 26, 36, 37, 38, 42, 43, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006939", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('1h13m24s') == 4404\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h13m24s') == 4404\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006940", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=543; mode=580; host=on; user=off') == {'port': '543', 'mode': '580', 'host': 'on', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=543; mode=580; host=on; user=off') == {'port': '543', 'mode': '580', 'host': 'on', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006941", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abbbb', 'bbbb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbb', 'bbbb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006942", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=715; port=326; host=auto') == {'user': '715', 'port': '326', 'host': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=715; port=326; host=auto') == {'user': '715', 'port': '326', 'host': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006943", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(49) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(49) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006944", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(41, 47) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(41, 47) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006945", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('1h17m55s') == 4675\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h17m55s') == 4675\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006946", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('ececaah bacg') == 'ececaah'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ececaah bacg') == 'ececaah'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006947", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'y': 2}, {'y': 7}) == {'x': 3, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'y': 2}, {'y': 7}) == {'x': 3, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006948", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(37, 83, 967) == 701\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(37, 83, 967) == 701\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006949", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[1, 4, 0], [9, 8, 1], [9, 2, 7], [8, 6, 8]]) == [[1, 9, 9, 8], [4, 8, 2, 6], [0, 1, 7, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 4, 0], [9, 8, 1], [9, 2, 7], [8, 6, 8]]) == [[1, 9, 9, 8], [4, 8, 2, 6], [0, 1, 7, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006950", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(7, 58) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(7, 58) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006951", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 7, 5], [5, 0, 0], [6, 6, 9]]) == [[6, 5, 6], [7, 0, 6], [5, 0, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 7, 5], [5, 0, 0], [6, 6, 9]]) == [[6, 5, 6], [7, 0, 6], [5, 0, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006952", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([11, 23, 6, 44, 12, 49, 50, 28]) == [6, 11, 12, 23, 28, 44, 49, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([11, 23, 6, 44, 12, 49, 50, 28]) == [6, 11, 12, 23, 28, 44, 49, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006953", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(34) == [2, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(34) == [2, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006954", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('aabcc', 'ab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabcc', 'ab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006955", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([22, 43, 49, 7, 47, 20]) == [7, 20, 22, 43, 47, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 43, 49, 7, 47, 20]) == [7, 20, 22, 43, 47, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006956", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(5013) == 9\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5013) == 9\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006957", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[1, -4, -5], [-4, 0, -8], [-1, 3, -4]], [[0, 3, 2], [-6, -3, -6], [-3, -6, -6]]) == [[1, -1, -3], [-10, -3, -14], [-4, -3, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -4, -5], [-4, 0, -8], [-1, 3, -4]], [[0, 3, 2], [-6, -3, -6], [-3, -6, -6]]) == [[1, -1, -3], [-10, -3, -14], [-4, -3, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006958", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(25, 163, 319) == 16\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(25, 163, 319) == 16\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006959", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbaabaaab', 'aabb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbaabaaab', 'aabb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006960", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([28, 3, 5, 22, 19, 34, 9, 14, 10]) == [3, 5, 9, 10, 14, 19, 22, 28, 34]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([28, 3, 5, 22, 19, 34, 9, 14, 10]) == [3, 5, 9, 10, 14, 19, 22, 28, 34]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006961", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([25, 34, 87], 137) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([25, 34, 87], 137) == -1\nassert binary_search([25, 34, 87], 25) == 0\nassert binary_search([25, 34, 87], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006962", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('e ee dd be') == 'E Ee Dd Be'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('e ee dd be') == 'E Ee Dd Be'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006963", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([45, 21, 23, 31, 2, 33, 28, 1, 27, 45, 5, 0]) == [0, 1, 2, 5, 21, 23, 27, 28, 31, 33, 45, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([45, 21, 23, 31, 2, 33, 28, 1, 27, 45, 5, 0]) == [0, 1, 2, 5, 21, 23, 27, 28, 31, 33, 45, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006964", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('28,dcc,48') == ['28', 'dcc', '48']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('28,dcc,48') == ['28', 'dcc', '48']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006965", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[0, 5, 0], [-2, 0, -2], [-8, -3, -1]], [[3, 3, -6], [0, 2, -2], [-4, -9, 4]]) == [[3, 8, -6], [-2, 2, -4], [-12, -12, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, 5, 0], [-2, 0, -2], [-8, -3, -1]], [[3, 3, -6], [0, 2, -2], [-4, -9, 4]]) == [[3, 8, -6], [-2, 2, -4], [-12, -12, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006966", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('fdhbgg headg bfabcggb ef') == 'bfabcggb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fdhbgg headg bfabcggb ef') == 'bfabcggb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006967", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 2, 4, 9, 7, 7, 3], 3) == [7, 7, 3, 3, 2, 4, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 2, 4, 9, 7, 7, 3], 3) == [7, 7, 3, 3, 2, 4, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006968", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(24); s.push(3); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(24); s.push(3); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 3\nassert s.is_empty() == False\nassert s.pop() == 24\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006969", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('deabeccaadaae') == 'deabc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('deabeccaadaae') == 'deabc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006970", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(4, 6) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(4, 6) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006971", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[[5, 3], [9]], [9]]) == [5, 3, 9, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[5, 3], [9]], [9]]) == [5, 3, 9, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006972", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('baaaaabcabc', 'abc') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaaaabcabc', 'abc') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006973", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'c': 6, 'a': 1, 'd': 9}, 4) == {'c': 6, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 6, 'a': 1, 'd': 9}, 4) == {'c': 6, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006974", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'avocado', 'berry', 'avocado', 'apple', 'apple', 'cherry']) == {'b': ['banana', 'berry'], 'a': ['avocado', 'avocado', 'apple', 'apple'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'avocado', 'berry', 'avocado', 'apple', 'apple', 'cherry']) == {'b': ['banana', 'berry'], 'a': ['avocado', 'avocado', 'apple', 'apple'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006975", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([3, 9, 11, 13, 16, 17, 19], [1, 6]) == [1, 3, 6, 9, 11, 13, 16, 17, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 9, 11, 13, 16, 17, 19], [1, 6]) == [1, 3, 6, 9, 11, 13, 16, 17, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006976", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-7, -3, 1]) == [-7, -10, -9]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, -3, 1]) == [-7, -10, -9]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006977", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-20, 14, -10, -20, 8, -1]) == -29\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, 14, -10, -20, 8, -1]) == -29\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006978", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('b]a}[(]a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b]a}[(]a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006979", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-8, -1], [-6, 7]], [[-1, -6], [-5, 9]]) == [[-9, -7], [-11, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -1], [-6, 7]], [[-1, -6], [-5, 9]]) == [[-9, -7], [-11, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006980", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(86); s.push(86); s.push(60)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(86); s.push(86); s.push(60)\nassert s.peek() == 60\nassert s.pop() == 60\nassert s.pop() == 86\nassert s.is_empty() == False\nassert s.pop() == 86\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006981", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 3, 0, 2, 4, 4, 2, 4, 1]) == [2, 3, 0, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 0, 2, 4, 4, 2, 4, 1]) == [2, 3, 0, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006982", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbabab', 'abbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabab', 'abbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006983", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bccaaaccacba', 'acb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bccaaaccacba', 'acb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_006984", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([8, 16, 28, 13]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 16, 28, 13]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006985", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aabaabb', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabb', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_006986", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(5532) == 2355\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5532) == 2355\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006987", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([39, 29, 24, 28]) == [24, 28, 29, 39]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([39, 29, 24, 28]) == [24, 28, 29, 39]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006988", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(75) == [3, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(75) == [3, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006989", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCXXXII') == 232\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXXXII') == 232\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006990", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([0, 5, 5, 15, 16], [1, 15, 17]) == [0, 1, 5, 5, 15, 15, 16, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 5, 5, 15, 16], [1, 15, 17]) == [0, 1, 5, 5, 15, 15, 16, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_006991", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(2323) == 3232\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2323) == 3232\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006992", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(1417) == 37\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1417) == 37\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006993", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h58m32s') == 21512\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h58m32s') == 21512\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006994", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('aa,\"ba,b\",dcea') == ['aa', 'ba,b', 'dcea']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aa,\"ba,b\",dcea') == ['aa', 'ba,b', 'dcea']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_006995", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([12, 28, 0, 8]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 28, 0, 8]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006996", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('){') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('){') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006997", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cy', 'c', 'cyz']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cy', 'c', 'cyz']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_006998", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([2, 1, 0, 2], 2) == [0, 2, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 1, 0, 2], 2) == [0, 2, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_006999", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('cccc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cccc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007000", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('LXIII') == 63\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXIII') == 63\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007001", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[4, 9], [9]]) == [4, 9, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 9], [9]]) == [4, 9, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007002", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'y': 5}, {'y': 3}) == {'x': 3, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'y': 5}, {'y': 3}) == {'x': 3, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007003", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('cat the sat dog! the the') == {'cat': 1, 'the': 3, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat the sat dog! the the') == {'cat': 1, 'the': 3, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007004", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(380)\nacc.deposit(34)\nacc.withdraw(13)\nacc.withdraw(595)\nassert acc.get_balance() == 414\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(380)\nacc.deposit(34)\nassert acc.get_balance() == 414\nacc.withdraw(13)\nassert acc.get_balance() == 401\nacc.withdraw(595)\nassert acc.get_balance() == 401\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007005", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([20, 34, 41, 44], 34) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([20, 34, 41, 44], 34) == 1\nassert binary_search([20, 34, 41, 44], 20) == 0\nassert binary_search([20, 34, 41, 44], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007006", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(133, 144) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(133, 144) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007007", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([21, 24, 3, 4, 21, 24, 6, 23]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 24, 3, 4, 21, 24, 6, 23]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007008", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('edehcfc bgggbebd cgfbfcac a hbabb bedgbaef') == 'bgggbebd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('edehcfc bgggbebd cgfbfcac a hbabb bedgbaef') == 'bgggbebd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007009", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([49, 39, 40, 1]) == [1, 39, 40, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([49, 39, 40, 1]) == [1, 39, 40, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007010", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(21) == 7\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(21) == 7\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007011", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([2, 5]) == [2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, 5]) == [2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007012", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(14); s.push(27); s.push(26)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(14); s.push(27); s.push(26)\nassert s.peek() == 26\nassert s.pop() == 26\nassert s.pop() == 27\nassert s.is_empty() == False\nassert s.pop() == 14\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007013", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([29, 47, 21, 25, 41, 20, 1, 13, 21, 11]) == [1, 11, 13, 20, 21, 21, 25, 29, 41, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([29, 47, 21, 25, 41, 20, 1, 13, 21, 11]) == [1, 11, 13, 20, 21, 21, 25, 29, 41, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007014", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(384) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(384) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007015", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(29, 9) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(29, 9) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007016", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([0, 7, 6], 2) == [7, 6, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 7, 6], 2) == [7, 6, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007017", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive(0) == [0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive(0) == [0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007018", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['ac', 'acxz', 'ac']) == 'ac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ac', 'acxz', 'ac']) == 'ac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007019", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(9); s.push(88); s.push(2)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(9); s.push(88); s.push(2)\nassert s.peek() == 2\nassert s.pop() == 2\nassert s.pop() == 88\nassert s.is_empty() == False\nassert s.pop() == 9\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007020", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 9, 5, 5, 9, 7, 1, 6, 2], 3) == [[1, 9, 5], [5, 9, 7], [1, 6, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 9, 5, 5, 9, 7, 1, 6, 2], 3) == [[1, 9, 5], [5, 9, 7], [1, 6, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007021", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(58, 102) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(58, 102) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007022", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello', 12) == 'Tqxxa'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 12) == 'Tqxxa'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007023", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('gce c adehacg') == 'adehacg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gce c adehacg') == 'adehacg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007024", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 2, 9, 7, 6, 1, 2, 5, 5, 0], 3) == [[4, 2, 9], [7, 6, 1], [2, 5, 5], [0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 2, 9, 7, 6, 1, 2, 5, 5, 0], 3) == [[4, 2, 9], [7, 6, 1], [2, 5, 5], [0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007025", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'd', 'd', 'd', 'd', 'a', 'a']) == {'d': 5, 'a': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'd', 'd', 'd', 'a', 'a']) == {'d': 5, 'a': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007026", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([25, 23, 7, 13, 15, 15, 11, 28]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 23, 7, 13, 15, 15, 11, 28]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007027", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('hb a fhhgh a') == 'fhhgh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hb a fhhgh a') == 'fhhgh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007028", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('the dog ran cat the! dog ran') == {'the': 2, 'dog': 2, 'ran': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the dog ran cat the! dog ran') == {'the': 2, 'dog': 2, 'ran': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007029", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([14, 27, 36, 54], 190) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([14, 27, 36, 54], 190) == -1\nassert binary_search([14, 27, 36, 54], 14) == 0\nassert binary_search([14, 27, 36, 54], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007030", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(13, 3) == 39\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 3) == 39\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007031", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([6, 7, 15, 19, 19, 20], [4, 4, 14, 14, 18]) == [4, 4, 6, 7, 14, 14, 15, 18, 19, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([6, 7, 15, 19, 19, 20], [4, 4, 14, 14, 18]) == [4, 4, 6, 7, 14, 14, 15, 18, 19, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007032", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bab', 'abb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bab', 'abb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007033", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(351515) == 592\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(351515) == 592\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007034", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'w': 6, 'z': 8}, {'x': 8}) == {'x': 17, 'w': 6, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'w': 6, 'z': 8}, {'x': 8}) == {'x': 17, 'w': 6, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007035", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('abbba,cae,e,ab,ee') == ['abbba', 'cae', 'e', 'ab', 'ee']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('abbba,cae,e,ab,ee') == ['abbba', 'cae', 'e', 'ab', 'ee']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007036", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 7}, {'w': 7, 'z': 4, 'x': 6}) == {'x': 13, 'w': 7, 'z': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7}, {'w': 7, 'z': 4, 'x': 6}) == {'x': 13, 'w': 7, 'z': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007037", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(52) == 11\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(52) == 11\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007038", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(96) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(96) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007039", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([21, 23, 41, 47, 59, 62, 79, 87, 90], 90) == 8\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([21, 23, 41, 47, 59, 62, 79, 87, 90], 90) == 8\nassert binary_search([21, 23, 41, 47, 59, 62, 79, 87, 90], 21) == 0\nassert binary_search([21, 23, 41, 47, 59, 62, 79, 87, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007040", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('byc') == 'cyb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('byc') == 'cyb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007041", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(5, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007042", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([12, 20, 49, 20, 7, 23, 47]) == [7, 12, 20, 20, 23, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([12, 20, 49, 20, 7, 23, 47]) == [7, 12, 20, 20, 23, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007043", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([25, 22, 28, 14, 11, 3, 3, 3, 14]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 22, 28, 14, 11, 3, 3, 3, 14]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007044", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=346; host=465') == {'mode': '346', 'host': '465'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=346; host=465') == {'mode': '346', 'host': '465'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007045", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 1, 'b': 72, 'a': 75, 'd': 11}) == {1: 'e', 72: 'b', 75: 'a', 11: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 1, 'b': 72, 'a': 75, 'd': 11}) == {1: 'e', 72: 'b', 75: 'a', 11: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007046", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 54, 'b': 4}) == {54: 'e', 4: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 54, 'b': 4}) == {54: 'e', 4: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007047", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-8, -2, -4], [5, -8, -4]], [[-9, 1, -5], [8, 7, 1]]) == [[-17, -1, -9], [13, -1, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -2, -4], [5, -8, -4]], [[-9, 1, -5], [8, 7, 1]]) == [[-17, -1, -9], [13, -1, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007048", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(22) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(22) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007049", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([17, 46, 0, 38, 1, 22, 14, 9, 24, 10]) == [0, 1, 9, 10, 14, 17, 22, 24, 38, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([17, 46, 0, 38, 1, 22, 14, 9, 24, 10]) == [0, 1, 9, 10, 14, 17, 22, 24, 38, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007050", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CCCLXXVI') == 376\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXXVI') == 376\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007051", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 5, 5, 6, 3, 4, 6, 0, 6, 7], 2) == [[9, 5], [5, 6], [3, 4], [6, 0], [6, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 5, 5, 6, 3, 4, 6, 0, 6, 7], 2) == [[9, 5], [5, 6], [3, 4], [6, 0], [6, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007052", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(885686) == 941\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(885686) == 941\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007053", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(336) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(336) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007054", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=auto; path=off; host=697') == {'port': 'auto', 'path': 'off', 'host': '697'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; path=off; host=697') == {'port': 'auto', 'path': 'off', 'host': '697'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007055", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('4h33m21s') == 16401\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h33m21s') == 16401\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007056", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8198) == 26\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8198) == 26\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007057", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([34, 38, 22, 15, 41, 28, 43]) == [15, 22, 28, 34, 38, 41, 43]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([34, 38, 22, 15, 41, 28, 43]) == [15, 22, 28, 34, 38, 41, 43]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007058", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 98, 'b': 86, 'f': 65, 'c': 39}) == {98: 'a', 86: 'b', 65: 'f', 39: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 98, 'b': 86, 'f': 65, 'c': 39}) == {98: 'a', 86: 'b', 65: 'f', 39: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007059", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(109) == 'CIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(109) == 'CIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007060", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1810) == 'MDCCCX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1810) == 'MDCCCX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007061", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=275; port=on') == {'mode': '275', 'port': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=275; port=on') == {'mode': '275', 'port': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007062", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(24, 9) == 72\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 9) == 72\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007063", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('cat Cat Cat cat dog the') == {'cat': 4, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat Cat Cat cat dog the') == {'cat': 4, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007064", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(10); s.push(37); s.push(51)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(10); s.push(37); s.push(51)\nassert s.peek() == 51\nassert s.pop() == 51\nassert s.pop() == 37\nassert s.is_empty() == False\nassert s.pop() == 10\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007065", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the sun, the, Dog Sun ran sun the,') == {'the': 3, 'sun': 3, 'dog': 1, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the sun, the, Dog Sun ran sun the,') == {'the': 3, 'sun': 3, 'dog': 1, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007066", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([4, 22, 10, 19, 37, 19, 37]) == [4, 10, 19, 19, 22, 37, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 22, 10, 19, 37, 19, 37]) == [4, 10, 19, 19, 22, 37, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007067", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('egebea hgagc fhfhbd ddf dbeeaacd dbdhe') == 'dbeeaacd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('egebea hgagc fhfhbd ddf dbeeaacd dbdhe') == 'dbeeaacd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007068", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 0, 3, 7, 3, 8, 8, 4, 2, 9], 2) == [[1, 0], [3, 7], [3, 8], [8, 4], [2, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 0, 3, 7, 3, 8, 8, 4, 2, 9], 2) == [[1, 0], [3, 7], [3, 8], [8, 4], [2, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007069", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('yddceeczey') == 'yezceecddy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('yddceeczey') == 'yezceecddy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007070", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([2, 4, 7, 10, 17, 18, 19], [5, 6, 20]) == [2, 4, 5, 6, 7, 10, 17, 18, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 4, 7, 10, 17, 18, 19], [5, 6, 20]) == [2, 4, 5, 6, 7, 10, 17, 18, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007071", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[7, 7], [9, 7], [-3, -4], [-6, -8]], [[0, -8], [-1, 2], [0, 5], [-1, -9]]) == [[7, -1], [8, 9], [-3, 1], [-7, -17]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 7], [9, 7], [-3, -4], [-6, -8]], [[0, -8], [-1, 2], [0, 5], [-1, -9]]) == [[7, -1], [8, 9], [-3, 1], [-7, -17]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007072", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('da e ed cabea') == 'Da E Ed Cabea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('da e ed cabea') == 'Da E Ed Cabea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007073", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 90, 'd': 31, 'b': 17, 'e': 76}) == {90: 'f', 31: 'd', 17: 'b', 76: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 90, 'd': 31, 'b': 17, 'e': 76}) == {90: 'f', 31: 'd', 17: 'b', 76: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007074", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([19, 9, 43, 39, 2, 40, 3]) == [2, 3, 9, 19, 39, 40, 43]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([19, 9, 43, 39, 2, 40, 3]) == [2, 3, 9, 19, 39, 40, 43]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007075", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 73, 'd': 20, 'f': 13}) == {73: 'b', 20: 'd', 13: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 73, 'd': 20, 'f': 13}) == {73: 'b', 20: 'd', 13: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007076", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'z': 8}, {'x': 8, 'y': 7}) == {'x': 11, 'z': 8, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'z': 8}, {'x': 8, 'y': 7}) == {'x': 11, 'z': 8, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007077", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[6, 7, 9], [-2, -6, 3]], [[3, -2, -3], [-1, -4, 9]]) == [[9, 5, 6], [-3, -10, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, 7, 9], [-2, -6, 3]], [[3, -2, -3], [-1, -4, 9]]) == [[9, 5, 6], [-3, -10, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007078", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(21) == 7\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(21) == 7\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007079", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('bca') == 'Bca'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bca') == 'Bca'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007080", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('acaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('acaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007081", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([4, 43, 18, 23, 29, 36, 22, 37]) == [4, 18, 22, 23, 29, 36, 37, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 43, 18, 23, 29, 36, 22, 37]) == [4, 18, 22, 23, 29, 36, 37, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007082", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('ddcbce') == 'Ddcbce'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ddcbce') == 'Ddcbce'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007083", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('ababbabbbbbbb', 'aba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbabbbbbbb', 'aba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007084", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([1, [6, 0], 9, [5]]) == [1, 6, 0, 9, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [6, 0], 9, [5]]) == [1, 6, 0, 9, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007085", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'x': 7}, {'x': 2, 'w': 9}) == {'z': 4, 'x': 9, 'w': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'x': 7}, {'x': 2, 'w': 9}) == {'z': 4, 'x': 9, 'w': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007086", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[9, 8, 5], [7]], [[2, 0], 3], [[7]]]) == 41\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[9, 8, 5], [7]], [[2, 0], 3], [[7]]]) == 41\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007087", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, [7, 0], [7, 1, 1, 4], 4, [0]]) == [8, 7, 0, 7, 1, 1, 4, 4, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [7, 0], [7, 1, 1, 4], 4, [0]]) == [8, 7, 0, 7, 1, 1, 4, 4, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007088", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(979906) == 989\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(979906) == 989\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007089", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(8, 4) == 8\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(8, 4) == 8\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007090", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([-10, 8]) == -2\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-10, 8]) == -2\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007091", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('bcaacb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcaacb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007092", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([2, 2]) == 4\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([2, 2]) == 4\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007093", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(9, 7) == 4782969\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 7) == 4782969\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007094", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(5771) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5771) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007095", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ebadcddeddabec') == 'ebadc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebadcddeddabec') == 'ebadc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007096", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('27m48s') == 1668\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('27m48s') == 1668\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007097", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 3, 8, 8, 4, 4, 6], 4) == [[1, 3, 8, 8], [4, 4, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 8, 8, 4, 4, 6], 4) == [[1, 3, 8, 8], [4, 4, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007098", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(660) == 25\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(660) == 25\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007099", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMDCXXVII') == 2627\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDCXXVII') == 2627\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007100", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(16, 11) == 176\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 11) == 176\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007101", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([7, 23, 8, 8, 8, 11, 21, 7]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 23, 8, 8, 8, 11, 21, 7]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007102", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['banana', 'avocado', 'avocado', 'date', 'coconut', 'date']) == {'b': ['banana'], 'a': ['avocado', 'avocado'], 'd': ['date', 'date'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'avocado', 'avocado', 'date', 'coconut', 'date']) == {'b': ['banana'], 'a': ['avocado', 'avocado'], 'd': ['date', 'date'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007103", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-4, 5, 8, 3, 4, 8, -3, -6]) == [-4, 1, 9, 12, 16, 24, 21, 15]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-4, 5, 8, 3, 4, 8, -3, -6]) == [-4, 1, 9, 12, 16, 24, 21, 15]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007104", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([38, 27, 38, 34, 15, 12, 2]) == [2, 12, 15, 27, 34, 38, 38]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([38, 27, 38, 34, 15, 12, 2]) == [2, 12, 15, 27, 34, 38, 38]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007105", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([2, 17, 19, -16, 7, -16]) == 13\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, 17, 19, -16, 7, -16]) == 13\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007106", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[2], [4, 6, 3]]) == [2, 4, 6, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2], [4, 6, 3]]) == [2, 4, 6, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007107", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bccccbbacbbacb', 'cba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bccccbbacbbacb', 'cba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007108", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(60) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(60) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007109", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(13, 18) == 234\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 18) == 234\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007110", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(4650) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4650) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007111", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([5, 3, 4, 7, 3, 7, 3, 3, 9], 3) == [[5, 3, 4], [7, 3, 7], [3, 3, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 3, 4, 7, 3, 7, 3, 3, 9], 3) == [[5, 3, 4], [7, 3, 7], [3, 3, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007112", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 5], [2, 1]], [[4, 3, 3], [4, 5, 5]]) == [[40, 40, 40], [12, 11, 11]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 5], [2, 1]], [[4, 3, 3], [4, 5, 5]]) == [[40, 40, 40], [12, 11, 11]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007113", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 7, 8, 0, 6, 9, 8], 1) == [8, 8, 7, 8, 0, 6, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 7, 8, 0, 6, 9, 8], 1) == [8, 8, 7, 8, 0, 6, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007114", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'w': 9}, {'w': 7}) == {'x': 9, 'w': 16}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'w': 9}, {'w': 7}) == {'x': 9, 'w': 16}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007115", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([4, 59, 86], 4) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 59, 86], 4) == 0\nassert binary_search([4, 59, 86], 4) == 0\nassert binary_search([4, 59, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007116", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 9, 6, 6, 6, 7], 8) == [6, 7, 1, 9, 6, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 9, 6, 6, 6, 7], 8) == [6, 7, 1, 9, 6, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007117", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[8, 4], 4]) == [8, 4, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8, 4], 4]) == [8, 4, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007118", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([8], [1, 2, 2, 3, 9, 18, 20]) == [1, 2, 2, 3, 8, 9, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([8], [1, 2, 2, 3, 9, 18, 20]) == [1, 2, 2, 3, 8, 9, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007119", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=765; host=off; mode=179; path=760') == {'port': '765', 'host': 'off', 'mode': '179', 'path': '760'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=765; host=off; mode=179; path=760') == {'port': '765', 'host': 'off', 'mode': '179', 'path': '760'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007120", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('the, ran. sat sun Dog ran. Sat the') == {'the': 2, 'ran': 2, 'sat': 2, 'sun': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the, ran. sat sun Dog ran. Sat the') == {'the': 2, 'ran': 2, 'sat': 2, 'sun': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007121", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([15, 21, 6]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 21, 6]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007122", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 28, 'a': 74}) == {28: 'b', 74: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 28, 'a': 74}) == {28: 'b', 74: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007123", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('edbbbc') == 'edbc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edbbbc') == 'edbc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007124", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('baac,caab,52,abb') == ['baac', 'caab', '52', 'abb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('baac,caab,52,abb') == ['baac', 'caab', '52', 'abb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007125", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([6, 19, 39, 40, 57, 64, 89, 93], 120) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([6, 19, 39, 40, 57, 64, 89, 93], 120) == -1\nassert binary_search([6, 19, 39, 40, 57, 64, 89, 93], 6) == 0\nassert binary_search([6, 19, 39, 40, 57, 64, 89, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007126", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'z': 9, 'w': 1}, {'w': 1, 'y': 6, 'z': 2}) == {'x': 9, 'z': 11, 'w': 2, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'z': 9, 'w': 1}, {'w': 1, 'y': 6, 'z': 2}) == {'x': 9, 'z': 11, 'w': 2, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007127", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=962; path=off; host=on') == {'mode': '962', 'path': 'off', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=962; path=off; host=on') == {'mode': '962', 'path': 'off', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007128", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['bbzz', 'bbzy']) == 'bbz'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bbzz', 'bbzy']) == 'bbz'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007129", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([23, 7, 20, 1, 26, 23, 11, 7, 20]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 7, 20, 1, 26, 23, 11, 7, 20]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007130", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(453) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(453) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007131", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([8, [5, 7, 6, 7], 9, [0, 6, 2, 3]]) == [8, 5, 7, 6, 7, 9, 0, 6, 2, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [5, 7, 6, 7], 9, [0, 6, 2, 3]]) == [8, 5, 7, 6, 7, 9, 0, 6, 2, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007132", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([30, 28, 31, 10, 19, 32]) == [10, 19, 28, 30, 31, 32]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([30, 28, 31, 10, 19, 32]) == [10, 19, 28, 30, 31, 32]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007133", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['ba', 'bayz']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ba', 'bayz']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007134", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['banana', 'berry', 'cherry', 'date', 'apple', 'banana', 'banana', 'apple']) == {'b': ['banana', 'berry', 'banana', 'banana'], 'c': ['cherry'], 'd': ['date'], 'a': ['apple', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'berry', 'cherry', 'date', 'apple', 'banana', 'banana', 'apple']) == {'b': ['banana', 'berry', 'banana', 'banana'], 'c': ['cherry'], 'd': ['date'], 'a': ['apple', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007135", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('bbbbbbbbdbbbbbbbbbbbb') == 'b8d1b12'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbdbbbbbbbbbbbb') == 'b8d1b12'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007136", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('2h18m39s') == 8319\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h18m39s') == 8319\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007137", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('the, dog Cat dog') == {'the': 1, 'dog': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the, dog Cat dog') == {'the': 1, 'dog': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007138", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-37, -13, 11, 6]) == 11\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-37, -13, 11, 6]) == 11\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007139", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([5, 15, 23, 39, 50, 62, 65, 71], 15) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 15, 23, 39, 50, 62, 65, 71], 15) == 1\nassert binary_search([5, 15, 23, 39, 50, 62, 65, 71], 5) == 0\nassert binary_search([5, 15, 23, 39, 50, 62, 65, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007140", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(12, 47) == 564\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(12, 47) == 564\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007141", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([29, 21, 9, 32, 49, 36, 46, 23, 5, 8]) == [5, 8, 9, 21, 23, 29, 32, 36, 46, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([29, 21, 9, 32, 49, 36, 46, 23, 5, 8]) == [5, 8, 9, 21, 23, 29, 32, 36, 46, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007142", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=144; path=583; port=658') == {'mode': '144', 'path': '583', 'port': '658'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=144; path=583; port=658') == {'mode': '144', 'path': '583', 'port': '658'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007143", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'e': 2, 'a': 6}, 5) == {'a': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 2, 'a': 6}, 5) == {'a': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007144", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('a{baa](') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a{baa](') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007145", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaaaaaccccccc') == 'a7c7'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaccccccc') == 'a7c7'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007146", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(3189) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3189) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007147", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 3, 1, 0, 4, 2]) == [2, 3, 1, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 1, 0, 4, 2]) == [2, 3, 1, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007148", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-2, -1, 4, -4, 3, -2, 8, 4]) == [-2, -3, 1, -3, 0, -2, 6, 10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-2, -1, 4, -4, 3, -2, 8, 4]) == [-2, -3, 1, -3, 0, -2, 6, 10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007149", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([2, 12, 39, 35, 22, 26, 36, 39, 20]) == [2, 12, 20, 22, 26, 35, 36, 39, 39]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([2, 12, 39, 35, 22, 26, 36, 39, 20]) == [2, 12, 20, 22, 26, 35, 36, 39, 39]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007150", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-2, 6, -7], [-8, -3, -1]], [[3, -1, -9], [1, -4, 1]]) == [[1, 5, -16], [-7, -7, 0]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, 6, -7], [-8, -3, -1]], [[3, -1, -9], [1, -4, 1]]) == [[1, 5, -16], [-7, -7, 0]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007151", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(7926) == 6297\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7926) == 6297\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007152", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(57, 36) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(57, 36) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007153", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('bbcadeb') == 'bcade'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbcadeb') == 'bcade'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007154", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 4], [1, 5], [0, 2]], [[1, 0], [2, 5]]) == [[13, 20], [11, 25], [4, 10]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 4], [1, 5], [0, 2]], [[1, 0], [2, 5]]) == [[13, 20], [11, 25], [4, 10]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007155", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'e': 0, 'a': 2, 'd': 6, 'b': 2}, 3) == {'d': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 0, 'a': 2, 'd': 6, 'b': 2}, 3) == {'d': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007156", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(593397) == 770\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(593397) == 770\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007157", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-24, 38, -34, 46, 9, 14, -3]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-24, 38, -34, 46, 9, 14, -3]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007158", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[2, 5, 3, 6], [4, 8, 3]]) == [2, 5, 3, 6, 4, 8, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 5, 3, 6], [4, 8, 3]]) == [2, 5, 3, 6, 4, 8, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007159", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('(b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007160", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([2, 3, 3, 3, 12, 12, 20], [2, 12, 14]) == [2, 2, 3, 3, 3, 12, 12, 12, 14, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 3, 3, 3, 12, 12, 20], [2, 12, 14]) == [2, 2, 3, 3, 3, 12, 12, 12, 14, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007161", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('16,\"b,b,\",69,e') == ['16', 'b,b,', '69', 'e']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('16,\"b,b,\",69,e') == ['16', 'b,b,', '69', 'e']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007162", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(1383) == 37\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1383) == 37\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007163", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([33, 29, 43, 37]) == [29, 33, 37, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([33, 29, 43, 37]) == [29, 33, 37, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007164", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(38); s.push(70); s.push(58)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(38); s.push(70); s.push(58)\nassert s.peek() == 58\nassert s.pop() == 58\nassert s.pop() == 70\nassert s.is_empty() == False\nassert s.pop() == 38\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007165", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([1, 7, 2], 2) == [7, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 7, 2], 2) == [7, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007166", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(526) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(526) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007167", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ddfef', 'fdfed') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ddfef', 'fdfed') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007168", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([19, 15, 11, 36, 41, 9, 48]) == [9, 11, 15, 19, 36, 41, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([19, 15, 11, 36, 41, 9, 48]) == [9, 11, 15, 19, 36, 41, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007169", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 3, 1, 6, 5, 1, 9, 8, 1, 7], 7) == [6, 5, 1, 9, 8, 1, 7, 3, 3, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 3, 1, 6, 5, 1, 9, 8, 1, 7], 7) == [6, 5, 1, 9, 8, 1, 7, 3, 3, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007170", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3302) == 8\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3302) == 8\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007171", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('dog ran sun sat,') == {'dog': 1, 'ran': 1, 'sun': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog ran sun sat,') == {'dog': 1, 'ran': 1, 'sun': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007172", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(19, 3) == 57\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 3) == 57\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007173", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('bbeebea') == 'bea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbeebea') == 'bea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007174", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 4, 0], [3, 2, 5]], [[5, 3, 1], [1, 4, 2], [1, 5, 0]]) == [[19, 25, 11], [22, 42, 7]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 4, 0], [3, 2, 5]], [[5, 3, 1], [1, 4, 2], [1, 5, 0]]) == [[19, 25, 11], [22, 42, 7]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007175", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('aecacdce') == 'aecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aecacdce') == 'aecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007176", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(270) == 'CCLXX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(270) == 'CCLXX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007177", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([5, 12], [5, 9, 11, 12, 14, 18, 20]) == [5, 5, 9, 11, 12, 12, 14, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 12], [5, 9, 11, 12, 14, 18, 20]) == [5, 5, 9, 11, 12, 12, 14, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007178", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'y': 5}, {'w': 4}) == {'z': 2, 'y': 5, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'y': 5}, {'w': 4}) == {'z': 2, 'y': 5, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007179", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 4, 1, 5, 8, 5, 8, 3, 5], 5) == [[5, 4, 1, 5, 8], [5, 8, 3, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 4, 1, 5, 8, 5, 8, 3, 5], 5) == [[5, 4, 1, 5, 8], [5, 8, 3, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007180", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran! dog sat, sat. sun ran cat! ran the!') == {'ran': 3, 'dog': 1, 'sat': 2, 'sun': 1, 'cat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! dog sat, sat. sun ran cat! ran the!') == {'ran': 3, 'dog': 1, 'sat': 2, 'sun': 1, 'cat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007181", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(3699) == 60\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3699) == 60\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007182", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabaabbabbabbbb', 'aab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabbabbabbbb', 'aab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007183", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-18, 18]) == 18\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-18, 18]) == 18\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007184", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(483) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(483) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007185", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(1, 9) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 9) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007186", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(6167) == 78\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6167) == 78\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007187", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('cuocqyqn') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('cuocqyqn') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007188", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['apple', 'banana', 'date']) == {'a': ['apple'], 'b': ['banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'banana', 'date']) == {'a': ['apple'], 'b': ['banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007189", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(3300) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3300) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007190", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('cef', 'cfe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cef', 'cfe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007191", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(201) == 'CCI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(201) == 'CCI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007192", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 4, 7, 5, 6], [3, 9, 8, 7, 0, 9]) == [3, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 4, 7, 5, 6], [3, 9, 8, 7, 0, 9]) == [3, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007193", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['c', 'd', 'e', 'd', 'a', 'c', 'b', 'd']) == {'c': 2, 'd': 3, 'e': 1, 'a': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'd', 'e', 'd', 'a', 'c', 'b', 'd']) == {'c': 2, 'd': 3, 'e': 1, 'a': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007194", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(792) == 297\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(792) == 297\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007195", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([3, 1, [[9]]]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([3, 1, [[9]]]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007196", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 10, 'd': 52}) == {10: 'b', 52: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 10, 'd': 52}) == {10: 'b', 52: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007197", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MLXXIX') == 1079\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MLXXIX') == 1079\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007198", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(19, 8) == 152\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 8) == 152\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007199", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('ghefccf bdhddbgb fahda habh bfbbe') == 'bdhddbgb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ghefccf bdhddbgb fahda habh bfbbe') == 'bdhddbgb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007200", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[4, 2, 5], [1, 1, 0]], [[1, 3], [1, 3], [0, 3]]) == [[6, 33], [2, 6]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2, 5], [1, 1, 0]], [[1, 3], [1, 3], [0, 3]]) == [[6, 33], [2, 6]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007201", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(8, 1) == 8\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 1) == 8\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007202", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat sun Ran cat the') == {'cat': 2, 'sun': 1, 'ran': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sun Ran cat the') == {'cat': 2, 'sun': 1, 'ran': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007203", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('((3 * 4) + (13 * 2))') == 38\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((3 * 4) + (13 * 2))') == 38\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007204", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([29, 50, 60, 63, 75], 188) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([29, 50, 60, 63, 75], 188) == -1\nassert binary_search([29, 50, 60, 63, 75], 29) == 0\nassert binary_search([29, 50, 60, 63, 75], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007205", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(471) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(471) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007206", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('dcdca') == 'Dcdca'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dcdca') == 'Dcdca'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007207", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 1}, {'w': 8, 'x': 9, 'z': 9}) == {'w': 9, 'x': 9, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 1}, {'w': 8, 'x': 9, 'z': 9}) == {'w': 9, 'x': 9, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007208", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ccddc') == 'c2d2c1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccddc') == 'c2d2c1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007209", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([2, 6, 4, 9, 7, 9, 5, 3, 2, 8], 5) == [[2, 6, 4, 9, 7], [9, 5, 3, 2, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 6, 4, 9, 7, 9, 5, 3, 2, 8], 5) == [[2, 6, 4, 9, 7], [9, 5, 3, 2, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007210", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[5, 1, 0, 0], [3]]) == [5, 1, 0, 0, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 1, 0, 0], [3]]) == [5, 1, 0, 0, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007211", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(15); s.push(69); s.push(69)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(15); s.push(69); s.push(69)\nassert s.peek() == 69\nassert s.pop() == 69\nassert s.pop() == 69\nassert s.is_empty() == False\nassert s.pop() == 15\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007212", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([4, [0]]) == 4\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, [0]]) == 4\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007213", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([2, 2, 11, 24, 9, 10]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 2, 11, 24, 9, 10]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007214", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([49, 2, 11, 9, 41, 6, 26, 48, 26]) == [2, 6, 9, 11, 26, 26, 41, 48, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([49, 2, 11, 9, 41, 6, 26, 48, 26]) == [2, 6, 9, 11, 26, 26, 41, 48, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007215", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[2], [8, 2, 6]]) == [2, 8, 2, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2], [8, 2, 6]]) == [2, 8, 2, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007216", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([5, [9, 2], 5]) == [5, 9, 2, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([5, [9, 2], 5]) == [5, 9, 2, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007217", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([1, 8, 2, 8, 8, 2], 5) == [8, 2, 8, 8, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 8, 2, 8, 8, 2], 5) == [8, 2, 8, 8, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007218", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(70) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(70) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007219", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('glka') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('glka') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007220", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 10, 'f': 76, 'b': 30}) == {10: 'a', 76: 'f', 30: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 10, 'f': 76, 'b': 30}) == {10: 'a', 76: 'f', 30: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007221", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 9, 4, 1, 6], 3) == [[8, 9, 4], [1, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 9, 4, 1, 6], 3) == [[8, 9, 4], [1, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007222", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(178, 71) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(178, 71) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007223", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(60, 45) == 15\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(60, 45) == 15\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007224", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(13); s.push(40); s.push(94)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(13); s.push(40); s.push(94)\nassert s.peek() == 94\nassert s.pop() == 94\nassert s.pop() == 40\nassert s.is_empty() == False\nassert s.pop() == 13\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007225", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([9, 5, -5, 7]) == [9, 14, 9, 16]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, 5, -5, 7]) == [9, 14, 9, 16]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007226", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 0, 6, 3, 4, 7], 1) == [7, 0, 0, 6, 3, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 0, 6, 3, 4, 7], 1) == [7, 0, 0, 6, 3, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007227", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1], [1, 11, 13]) == [1, 1, 11, 13]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1], [1, 11, 13]) == [1, 1, 11, 13]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007228", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(39, 11) == 429\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(39, 11) == 429\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007229", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[[6]]]) == 6\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[6]]]) == 6\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007230", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(15, 144, 289) == 188\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(15, 144, 289) == 188\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007231", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[4, 4, 1], [4, 9, 3], [7, 9, 4]]) == [[4, 4, 7], [4, 9, 9], [1, 3, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 4, 1], [4, 9, 3], [7, 9, 4]]) == [[4, 4, 7], [4, 9, 9], [1, 3, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007232", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'coconut', 'avocado', 'berry']) == {'a': ['avocado', 'avocado'], 'c': ['coconut'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'coconut', 'avocado', 'berry']) == {'a': ['avocado', 'avocado'], 'c': ['coconut'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007233", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(120)\nacc.deposit(50)\nacc.withdraw(86)\nacc.withdraw(244)\nassert acc.get_balance() == 170\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(120)\nacc.deposit(50)\nassert acc.get_balance() == 170\nacc.withdraw(86)\nassert acc.get_balance() == 84\nacc.withdraw(244)\nassert acc.get_balance() == 84\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007234", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(367)\nacc.deposit(112)\nacc.withdraw(119)\nacc.withdraw(677)\nassert acc.get_balance() == 479\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(367)\nacc.deposit(112)\nassert acc.get_balance() == 479\nacc.withdraw(119)\nassert acc.get_balance() == 360\nacc.withdraw(677)\nassert acc.get_balance() == 360\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007235", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('1h18m14s') == 4694\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h18m14s') == 4694\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007236", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([2, 40, -34]) == 40\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([2, 40, -34]) == 40\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007237", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([38, 50, 23, 32]) == [23, 32, 38, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([38, 50, 23, 32]) == [23, 32, 38, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007238", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([8, [[8, 3, 2], [2, 8]], 2]) == 33\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([8, [[8, 3, 2], [2, 8]], 2]) == 33\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007239", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('dfcada', 'dfcadaf') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dfcada', 'dfcadaf') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007240", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['b', 'c', 'a', 'c', 'd', 'c', 'a', 'c', 'b']) == {'b': 2, 'c': 4, 'a': 2, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'c', 'a', 'c', 'd', 'c', 'a', 'c', 'b']) == {'b': 2, 'c': 4, 'a': 2, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007241", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([35, 8, 28, 35, 39, 50, 31]) == [8, 28, 31, 35, 35, 39, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([35, 8, 28, 35, 39, 50, 31]) == [8, 28, 31, 35, 35, 39, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007242", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(9, 18) == 9\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(9, 18) == 9\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007243", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(475) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(475) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007244", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbbbbbbbbbb') == 'b11'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbbb') == 'b11'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007245", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('byafe') == 'efayb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('byafe') == 'efayb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007246", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('d bae') == 'D Bae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('d bae') == 'D Bae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007247", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(839387) == 916\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(839387) == 916\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007248", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[7, 7], 3, 0]) == [7, 7, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 7], 3, 0]) == [7, 7, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007249", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5], [4], 4, [6, 3], [4, 8, 5, 5]]) == [5, 4, 4, 6, 3, 4, 8, 5, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], [4], 4, [6, 3], [4, 8, 5, 5]]) == [5, 4, 4, 6, 3, 4, 8, 5, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007250", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 5, 1, 1, 1, 1, 4]) == [4, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 1, 1, 1, 1, 4]) == [4, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007251", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('babababba', 'aaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babababba', 'aaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007252", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[0, 8, 8, 8], [4, 8, 2, 9], [1, 4, 2, 1]]) == [[0, 4, 1], [8, 8, 4], [8, 2, 2], [8, 9, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 8, 8, 8], [4, 8, 2, 9], [1, 4, 2, 1]]) == [[0, 4, 1], [8, 8, 4], [8, 2, 2], [8, 9, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007253", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 17, 22, 46, 48, 53, 62, 93], 153) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 17, 22, 46, 48, 53, 62, 93], 153) == -1\nassert binary_search([4, 17, 22, 46, 48, 53, 62, 93], 4) == 0\nassert binary_search([4, 17, 22, 46, 48, 53, 62, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007254", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(84) == [2, 2, 3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(84) == [2, 2, 3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007255", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(2, 41) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(2, 41) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007256", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 3, 1, 4], 2) == [1, 4, 8, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 3, 1, 4], 2) == [1, 4, 8, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007257", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('adebeba') == 'adeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adebeba') == 'adeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007258", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('aaed') == 'aed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaed') == 'aed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007259", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['zz', 'xyx', 'z']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zz', 'xyx', 'z']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007260", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 4, 'x': 2}, {'w': 2, 'z': 7, 'y': 7}) == {'w': 6, 'x': 2, 'z': 7, 'y': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 4, 'x': 2}, {'w': 2, 'z': 7, 'y': 7}) == {'w': 6, 'x': 2, 'z': 7, 'y': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007261", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([50, 16, 14, 4, 15, 7, 40, 45, 38]) == [4, 7, 14, 15, 16, 38, 40, 45, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([50, 16, 14, 4, 15, 7, 40, 45, 38]) == [4, 7, 14, 15, 16, 38, 40, 45, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007262", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([35, 49]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([35, 49]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007263", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[0, 5, 5, 3], 4, 9, 6]) == [0, 5, 5, 3, 4, 9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 5, 5, 3], 4, 9, 6]) == [0, 5, 5, 3, 4, 9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007264", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 50, 'd': 49, 'f': 1, 'e': 51, 'b': 16}) == {50: 'a', 49: 'd', 1: 'f', 51: 'e', 16: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 50, 'd': 49, 'f': 1, 'e': 51, 'b': 16}) == {50: 'a', 49: 'd', 1: 'f', 51: 'e', 16: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007265", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('aecdd ebdeac cab cedcb') == 'Aecdd Ebdeac Cab Cedcb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aecdd ebdeac cab cedcb') == 'Aecdd Ebdeac Cab Cedcb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007266", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['', 'xy']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['', 'xy']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007267", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(222)\nacc.deposit(98)\nacc.withdraw(163)\nacc.withdraw(418)\nassert acc.get_balance() == 320\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(222)\nacc.deposit(98)\nassert acc.get_balance() == 320\nacc.withdraw(163)\nassert acc.get_balance() == 157\nacc.withdraw(418)\nassert acc.get_balance() == 157\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007268", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=on; path=866; host=554') == {'user': 'on', 'path': '866', 'host': '554'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; path=866; host=554') == {'user': 'on', 'path': '866', 'host': '554'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007269", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(258) == 'CCLVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(258) == 'CCLVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007270", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([3, 3, 2, 1, 7, 6, 8, 5], [2, 7, 9, 5, 5]) == [2, 7, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 3, 2, 1, 7, 6, 8, 5], [2, 7, 9, 5, 5]) == [2, 7, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007271", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(127) == 'CXXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(127) == 'CXXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007272", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bababb', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bababb', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007273", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([19, 1, 0, 11, 11, 26, 6, 17, 11, 25, 17]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([19, 1, 0, 11, 11, 26, 6, 17, 11, 25, 17]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007274", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007275", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(1242) == 35\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1242) == 35\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007276", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('wjgrktgxptcqal') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('wjgrktgxptcqal') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007277", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([20, 11, 18, 3, 20]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 11, 18, 3, 20]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007278", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=74; host=auto') == {'path': '74', 'host': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=74; host=auto') == {'path': '74', 'host': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007279", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[0, 1, 0], [0, 0, 3]], [[4, 0, 1], [1, 4, 2], [3, 1, 0]]) == [[1, 4, 2], [9, 3, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 1, 0], [0, 0, 3]], [[4, 0, 1], [1, 4, 2], [3, 1, 0]]) == [[1, 4, 2], [9, 3, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007280", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('dbcdce cae') == 'Dbcdce Cae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dbcdce cae') == 'Dbcdce Cae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007281", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(455)\nacc.deposit(155)\nacc.withdraw(475)\nacc.withdraw(768)\nassert acc.get_balance() == 610\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(455)\nacc.deposit(155)\nassert acc.get_balance() == 610\nacc.withdraw(475)\nassert acc.get_balance() == 135\nacc.withdraw(768)\nassert acc.get_balance() == 135\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007282", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('(}](({aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(}](({aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007283", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(1200) == 34\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1200) == 34\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007284", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(100, 16) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(100, 16) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007285", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('caccaacacba', 'cbab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caccaacacba', 'cbab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007286", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 64, 'a': 71, 'd': 58, 'e': 77, 'c': 75}) == {64: 'b', 71: 'a', 58: 'd', 77: 'e', 75: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 64, 'a': 71, 'd': 58, 'e': 77, 'c': 75}) == {64: 'b', 71: 'a', 58: 'd', 77: 'e', 75: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007287", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran dog. The Cat sun Sat sun') == {'ran': 1, 'dog': 1, 'the': 1, 'cat': 1, 'sun': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog. The Cat sun Sat sun') == {'ran': 1, 'dog': 1, 'the': 1, 'cat': 1, 'sun': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007288", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(3831) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3831) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007289", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('(()())') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(()())') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007290", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 4, 4], [5, 5, 3], [4, 1, 0]], [[5, 1, 0], [4, 2, 4], [4, 1, 2]]) == [[42, 14, 24], [57, 18, 26], [24, 6, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 4, 4], [5, 5, 3], [4, 1, 0]], [[5, 1, 0], [4, 2, 4], [4, 1, 2]]) == [[42, 14, 24], [57, 18, 26], [24, 6, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007291", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(200, 54) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(200, 54) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007292", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(3478) == 'MMMCDLXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3478) == 'MMMCDLXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007293", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('bacccedaecd') == 'baced'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bacccedaecd') == 'baced'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007294", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([17, 20, 23, 26, 34, 45, 57, 68, 71, 83, 86, 94], 20) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 20, 23, 26, 34, 45, 57, 68, 71, 83, 86, 94], 20) == 1\nassert binary_search([17, 20, 23, 26, 34, 45, 57, 68, 71, 83, 86, 94], 17) == 0\nassert binary_search([17, 20, 23, 26, 34, 45, 57, 68, 71, 83, 86, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007295", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([2, 7, 8], [10, 12, 19, 19]) == [2, 7, 8, 10, 12, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 7, 8], [10, 12, 19, 19]) == [2, 7, 8, 10, 12, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007296", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([3, 11, 6, 36, 1, 43, 11, 30]) == [1, 3, 6, 11, 11, 30, 36, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([3, 11, 6, 36, 1, 43, 11, 30]) == [1, 3, 6, 11, 11, 30, 36, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007297", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(22, 18) == 198\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 18) == 198\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007298", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=633; path=378; user=off; mode=on') == {'host': '633', 'path': '378', 'user': 'off', 'mode': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=633; path=378; user=off; mode=on') == {'host': '633', 'path': '378', 'user': 'off', 'mode': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007299", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-1, 5, 0, -1], [-7, -8, 6, -9], [-1, -2, -6, -6]], [[8, -2, 3, -1], [0, 7, 8, 7], [-9, 3, -7, 2]]) == [[7, 3, 3, -2], [-7, -1, 14, -2], [-10, 1, -13, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, 5, 0, -1], [-7, -8, 6, -9], [-1, -2, -6, -6]], [[8, -2, 3, -1], [0, 7, 8, 7], [-9, 3, -7, 2]]) == [[7, 3, 3, -2], [-7, -1, 14, -2], [-10, 1, -13, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007300", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('48m1s') == 2881\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('48m1s') == 2881\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007301", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([8, 6, 4, 7, 1, 5, 3, 8], 14) == [4, 7, 1, 5, 3, 8, 8, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 6, 4, 7, 1, 5, 3, 8], 14) == [4, 7, 1, 5, 3, 8, 8, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007302", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([3, 3, 11, 4, 11]) == 4\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 3, 11, 4, 11]) == 4\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007303", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(21); s.push(57); s.push(95)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(21); s.push(57); s.push(95)\nassert s.peek() == 95\nassert s.pop() == 95\nassert s.pop() == 57\nassert s.is_empty() == False\nassert s.pop() == 21\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007304", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[9, 9], [8, 1], [2, 1]]) == 30\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 9], [8, 1], [2, 1]]) == 30\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007305", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 86, 'd': 49, 'b': 52}) == {86: 'e', 49: 'd', 52: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 86, 'd': 49, 'b': 52}) == {86: 'e', 49: 'd', 52: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007306", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 43, 'b': 38, 'd': 30}) == {43: 'e', 38: 'b', 30: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 43, 'b': 38, 'd': 30}) == {43: 'e', 38: 'b', 30: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007307", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('lmyiisgoynz') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('lmyiisgoynz') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007308", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('bbddbc eececb dddeda') == 'Bbddbc Eececb Dddeda'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('bbddbc eececb dddeda') == 'Bbddbc Eececb Dddeda'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007309", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([8, 24, 11, 15, 19, 16]) == [8, 11, 15, 16, 19, 24]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([8, 24, 11, 15, 19, 16]) == [8, 11, 15, 16, 19, 24]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007310", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(14, 54, 920) == 616\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(14, 54, 920) == 616\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007311", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([[4], [7, 7]]) == 18\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[4], [7, 7]]) == 18\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007312", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[0, 2, 8, -1], [7, 7, 9, 9], [7, -7, -8, 1]], [[8, -7, -3, 9], [2, -6, 3, -3], [6, -6, 4, 2]]) == [[8, -5, 5, 8], [9, 1, 12, 6], [13, -13, -4, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, 2, 8, -1], [7, 7, 9, 9], [7, -7, -8, 1]], [[8, -7, -3, 9], [2, -6, 3, -3], [6, -6, 4, 2]]) == [[8, -5, 5, 8], [9, 1, 12, 6], [13, -13, -4, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007313", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 2, 0, 2, 1]) == [2, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 0, 2, 1]) == [2, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007314", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(50); s.push(72); s.push(36)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(50); s.push(72); s.push(36)\nassert s.peek() == 36\nassert s.pop() == 36\nassert s.pop() == 72\nassert s.is_empty() == False\nassert s.pop() == 50\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007315", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(902) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(902) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007316", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([7, 6, 4, 3, 4, 4, 9, 1, 3, 4, 3, 2], 4) == [[7, 6, 4, 3], [4, 4, 9, 1], [3, 4, 3, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 6, 4, 3, 4, 4, 9, 1, 3, 4, 3, 2], 4) == [[7, 6, 4, 3], [4, 4, 9, 1], [3, 4, 3, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007317", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([24, 32, 30, 48, 11, 35]) == [11, 24, 30, 32, 35, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([24, 32, 30, 48, 11, 35]) == [11, 24, 30, 32, 35, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007318", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('ababbab', 'bbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('ababbab', 'bbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007319", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaaaaaaaaaaabbbbbb') == 'a17b6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaaaaaaaaabbbbbb') == 'a17b6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007320", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['baaxyz', 'baaxy', 'baaxy']) == 'baaxy'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['baaxyz', 'baaxy', 'baaxy']) == 'baaxy'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007321", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 57, 'c': 53, 'd': 38, 'a': 95, 'e': 34}) == {57: 'f', 53: 'c', 38: 'd', 95: 'a', 34: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 57, 'c': 53, 'd': 38, 'a': 95, 'e': 34}) == {57: 'f', 53: 'c', 38: 'd', 95: 'a', 34: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007322", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 43, 'e': 14, 'a': 28, 'b': 85, 'd': 82}) == {43: 'c', 14: 'e', 28: 'a', 85: 'b', 82: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 43, 'e': 14, 'a': 28, 'b': 85, 'd': 82}) == {43: 'c', 14: 'e', 28: 'a', 85: 'b', 82: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007323", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(232) == 'CCXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(232) == 'CCXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007324", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([1, 17, 44, 31]) == [1, 17, 31, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([1, 17, 44, 31]) == [1, 17, 31, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007325", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('abccxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('abccxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007326", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([35, 21, 30, 10, 0, 45, 13, 12]) == [0, 10, 12, 13, 21, 30, 35, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 21, 30, 10, 0, 45, 13, 12]) == [0, 10, 12, 13, 21, 30, 35, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007327", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('ab,a') == ['ab', 'a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ab,a') == ['ab', 'a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007328", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[1, 2, 6], 9, 0]) == [1, 2, 6, 9, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1, 2, 6], 9, 0]) == [1, 2, 6, 9, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007329", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([0, [[0, 0], [3]]]) == [0, 0, 0, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([0, [[0, 0], [3]]]) == [0, 0, 0, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007330", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 68, 'e': 64, 'd': 65}) == {68: 'b', 64: 'e', 65: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 68, 'e': 64, 'd': 65}) == {68: 'b', 64: 'e', 65: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007331", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([16, 27, 3, 21, 46, 1, 49, 23]) == [1, 3, 16, 21, 23, 27, 46, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([16, 27, 3, 21, 46, 1, 49, 23]) == [1, 3, 16, 21, 23, 27, 46, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007332", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([8, 27, 29, 25, 10, 27]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 27, 29, 25, 10, 27]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007333", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(26, 45, 559) == 247\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(26, 45, 559) == 247\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007334", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[8, [2, 4, 3]], 2]) == [8, 2, 4, 3, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8, [2, 4, 3]], 2]) == [8, 2, 4, 3, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007335", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(48, 143) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 143) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007336", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(338) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(338) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007337", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([21, 24, 50, 11]) == [11, 21, 24, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([21, 24, 50, 11]) == [11, 21, 24, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007338", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(28, 145, 131) == 84\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(28, 145, 131) == 84\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007339", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 1, 2, 5, 2, 2]) == [3, 1, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 2, 5, 2, 2]) == [3, 1, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007340", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([11, 11, 13, 13, 13], [2, 11, 17, 18]) == [2, 11, 11, 11, 13, 13, 13, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([11, 11, 13, 13, 13], [2, 11, 17, 18]) == [2, 11, 11, 11, 13, 13, 13, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007341", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(78) == 35\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(78) == 35\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007342", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'cherry', 'avocado', 'avocado', 'berry', 'date']) == {'a': ['apple', 'avocado', 'avocado'], 'c': ['cherry', 'cherry'], 'b': ['berry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'cherry', 'avocado', 'avocado', 'berry', 'date']) == {'a': ['apple', 'avocado', 'avocado'], 'c': ['cherry', 'cherry'], 'b': ['berry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007343", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 32, 'd': 59, 'a': 5}) == {32: 'e', 59: 'd', 5: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 32, 'd': 59, 'a': 5}) == {32: 'e', 59: 'd', 5: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007344", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([3, 3]) == [3, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([3, 3]) == [3, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007345", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 5, 9, 12, 13, 18, 20], [1, 2, 8, 17]) == [0, 1, 2, 5, 8, 9, 12, 13, 17, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 5, 9, 12, 13, 18, 20], [1, 2, 8, 17]) == [0, 1, 2, 5, 8, 9, 12, 13, 17, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007346", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aacaabb', 'cbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aacaabb', 'cbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007347", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(6066) == 6606\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6066) == 6606\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007348", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 6, 8, 0, 2, 9, 2, 6, 6], 3) == [[4, 6, 8], [0, 2, 9], [2, 6, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 6, 8, 0, 2, 9, 2, 6, 6], 3) == [[4, 6, 8], [0, 2, 9], [2, 6, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007349", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 55, 'c': 53, 'd': 42}) == {55: 'b', 53: 'c', 42: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 55, 'c': 53, 'd': 42}) == {55: 'b', 53: 'c', 42: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007350", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([5, 7, 0, -3, -5, -6, 2, 5]) == [5, 12, 12, 9, 4, -2, 0, 5]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([5, 7, 0, -3, -5, -6, 2, 5]) == [5, 12, 12, 9, 4, -2, 0, 5]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007351", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('9 + 6 * 2') == 21\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('9 + 6 * 2') == 21\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007352", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[7, 8, 4], 9, [6, 0, 2], [0], [0, 2, 5]]) == [7, 8, 4, 9, 6, 0, 2, 0, 0, 2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 8, 4], 9, [6, 0, 2], [0], [0, 2, 5]]) == [7, 8, 4, 9, 6, 0, 2, 0, 0, 2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007353", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([44, 32, 38]) == [32, 38, 44]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([44, 32, 38]) == [32, 38, 44]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007354", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(43, 140, 402) == 265\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(43, 140, 402) == 265\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007355", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 10, 'e': 55, 'c': 74}) == {10: 'b', 55: 'e', 74: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 10, 'e': 55, 'c': 74}) == {10: 'b', 55: 'e', 74: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007356", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(370)\nacc.deposit(32)\nacc.withdraw(120)\nacc.withdraw(485)\nassert acc.get_balance() == 402\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(370)\nacc.deposit(32)\nassert acc.get_balance() == 402\nacc.withdraw(120)\nassert acc.get_balance() == 282\nacc.withdraw(485)\nassert acc.get_balance() == 282\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007357", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([4, 4, 9, 8, 8, 4, 0, 7, 4, 3], 4) == [[4, 4, 9, 8], [8, 4, 0, 7], [4, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 4, 9, 8, 8, 4, 0, 7, 4, 3], 4) == [[4, 4, 9, 8], [8, 4, 0, 7], [4, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007358", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aabbacbcccbbcbc', 'baac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbacbcccbbcbc', 'baac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007359", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([26, 35, 3]) == [3, 26, 35]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 35, 3]) == [3, 26, 35]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007360", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(263)\nacc.deposit(65)\nacc.withdraw(229)\nacc.withdraw(347)\nassert acc.get_balance() == 328\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(263)\nacc.deposit(65)\nassert acc.get_balance() == 328\nacc.withdraw(229)\nassert acc.get_balance() == 99\nacc.withdraw(347)\nassert acc.get_balance() == 99\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007361", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(39) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(39) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007362", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('abeb') == 'abe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abeb') == 'abe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007363", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([9, 7, 8, 4, 0, 4], [8, 1, 9, 8]) == [9, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 7, 8, 4, 0, 4], [8, 1, 9, 8]) == [9, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007364", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(20) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(20) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007365", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(169) == 'CLXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(169) == 'CLXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007366", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([1, 1, 6, -2, 0, -1, -7, -2]) == [1, 2, 8, 6, 6, 5, -2, -4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, 1, 6, -2, 0, -1, -7, -2]) == [1, 2, 8, 6, 6, 5, -2, -4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007367", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(41, 77) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(41, 77) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007368", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(685) == 26\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(685) == 26\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007369", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baabbabaabbabbaa', 'aaaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabbabaabbabbaa', 'aaaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007370", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(362)\nacc.deposit(241)\nacc.withdraw(409)\nacc.withdraw(648)\nassert acc.get_balance() == 603\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(362)\nacc.deposit(241)\nassert acc.get_balance() == 603\nacc.withdraw(409)\nassert acc.get_balance() == 194\nacc.withdraw(648)\nassert acc.get_balance() == 194\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007371", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('h hghhh fdhgd agcagdfb hbeebh') == 'agcagdfb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('h hghhh fdhgd agcagdfb hbeebh') == 'agcagdfb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007372", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=795; host=off') == {'port': '795', 'host': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=795; host=off') == {'port': '795', 'host': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007373", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([1, 4, 0, 0, 1, 2, 2], 6) == [4, 0, 0, 1, 2, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 4, 0, 0, 1, 2, 2], 6) == [4, 0, 0, 1, 2, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007374", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[9], [7, 5]]) == [9, 7, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[9], [7, 5]]) == [9, 7, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007375", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 8, 2, 5, 4, 3], [4, 4, 6, 1, 9, 8, 2]) == [2, 8, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 8, 2, 5, 4, 3], [4, 4, 6, 1, 9, 8, 2]) == [2, 8, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007376", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=off; path=auto; host=596; user=816') == {'port': 'off', 'path': 'auto', 'host': '596', 'user': '816'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; path=auto; host=596; user=816') == {'port': 'off', 'path': 'auto', 'host': '596', 'user': '816'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007377", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'avocado']) == {'c': ['coconut', 'cherry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'avocado']) == {'c': ['coconut', 'cherry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007378", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('baaabaaabaabaaba', 'bba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaabaaabaabaaba', 'bba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007379", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(27); s.push(53); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(27); s.push(53); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 53\nassert s.is_empty() == False\nassert s.pop() == 27\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007380", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'coconut', 'apple', 'coconut', 'coconut', 'cherry']) == {'c': ['cherry', 'coconut', 'coconut', 'coconut', 'cherry'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'coconut', 'apple', 'coconut', 'coconut', 'cherry']) == {'c': ['cherry', 'coconut', 'coconut', 'coconut', 'cherry'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007381", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([6, 32, 31]) == [6, 31, 32]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([6, 32, 31]) == [6, 31, 32]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007382", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 7, 9, 6], [4, 1, 2, 7, 7, 0, 3]) == [4, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 7, 9, 6], [4, 1, 2, 7, 7, 0, 3]) == [4, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007383", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(266) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(266) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007384", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 3], [7, 6], [1, 6], [5, 8]]) == [[6, 7, 1, 5], [3, 6, 6, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 3], [7, 6], [1, 6], [5, 8]]) == [[6, 7, 1, 5], [3, 6, 6, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007385", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 5, 'y': 9}, {'x': 6, 'w': 5, 'y': 6}) == {'z': 5, 'y': 15, 'x': 6, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 5, 'y': 9}, {'x': 6, 'w': 5, 'y': 6}) == {'z': 5, 'y': 15, 'x': 6, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007386", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 3, 2, 1]) == [2, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 2, 1]) == [2, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007387", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('(a]') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(a]') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007388", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['abzyx', 'abzyz', 'ab']) == 'ab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abzyx', 'abzyz', 'ab']) == 'ab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007389", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[7]]) == [7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7]]) == [7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007390", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(319) == 55\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(319) == 55\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007391", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 92, 'd': 33, 'c': 62, 'e': 71}) == {92: 'f', 33: 'd', 62: 'c', 71: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 92, 'd': 33, 'c': 62, 'e': 71}) == {92: 'f', 33: 'd', 62: 'c', 71: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007392", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 0, 2, 6, 0, 5, 8, 7, 6, 3, 7, 1, 3, 3, 4, 1], 3) == [[2, 0, 2], [6, 0, 5], [8, 7, 6], [3, 7, 1], [3, 3, 4], [1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 0, 2, 6, 0, 5, 8, 7, 6, 3, 7, 1, 3, 3, 4, 1], 3) == [[2, 0, 2], [6, 0, 5], [8, 7, 6], [3, 7, 1], [3, 3, 4], [1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007393", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(23, 21) == 483\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 21) == 483\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007394", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 8, 4], [6, 9, 1], [2, 9, 7]]) == [[6, 6, 2], [8, 9, 9], [4, 1, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 8, 4], [6, 9, 1], [2, 9, 7]]) == [[6, 6, 2], [8, 9, 9], [4, 1, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007395", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(37, 59) == 2183\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(37, 59) == 2183\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007396", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran! Cat sat dog') == {'ran': 1, 'cat': 1, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran! Cat sat dog') == {'ran': 1, 'cat': 1, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007397", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bccccb') == 'b1c4b1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bccccb') == 'b1c4b1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007398", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(42) == [2, 3, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(42) == [2, 3, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007399", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[2, 9, 6], 4]) == [2, 9, 6, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 9, 6], 4]) == [2, 9, 6, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007400", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ddcc') == 'dc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddcc') == 'dc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007401", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(66) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(66) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007402", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('ccacaacacc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccacaacacc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007403", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\",,a\",ccb,cb,bab,ad') == [',,a', 'ccb', 'cb', 'bab', 'ad']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\",,a\",ccb,cb,bab,ad') == [',,a', 'ccb', 'cb', 'bab', 'ad']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007404", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('dad,d,99') == ['dad', 'd', '99']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dad,d,99') == ['dad', 'd', '99']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007405", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aaaaddddddddcc') == 'a4d8c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaddddddddcc') == 'a4d8c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007406", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(22, 12, 682) == 374\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(22, 12, 682) == 374\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007407", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran cat cat, dog Sat Cat dog') == {'ran': 1, 'cat': 3, 'dog': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran cat cat, dog Sat Cat dog') == {'ran': 1, 'cat': 3, 'dog': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007408", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 7) == 'hij'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 7) == 'hij'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007409", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 2, 2, 5]) == [5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 2, 5]) == [5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007410", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[1, 9], [8, 5], [5, 5]]) == [[1, 8, 5], [9, 5, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 9], [8, 5], [5, 5]]) == [[1, 8, 5], [9, 5, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007411", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('aaacccccccaaa') == 'a3c7a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaacccccccaaa') == 'a3c7a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007412", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(18, 168, 922) == 528\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 168, 922) == 528\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007413", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([13, 1, 19]) == 33\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([13, 1, 19]) == 33\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007414", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([32, 34, 40, 78, 82, 84], 32) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([32, 34, 40, 78, 82, 84], 32) == 0\nassert binary_search([32, 34, 40, 78, 82, 84], 32) == 0\nassert binary_search([32, 34, 40, 78, 82, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007415", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-23, 1, 19, 10, 35, 46, 32, 10, -22]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-23, 1, 19, 10, 35, 46, 32, 10, -22]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007416", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(4556) == 67\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4556) == 67\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007417", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([25, 48, 0, 37]) == [0, 25, 37, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([25, 48, 0, 37]) == [0, 25, 37, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007418", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[2, [7, 3, 4]]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, [7, 3, 4]]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007419", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(66); s.push(23); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(66); s.push(23); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 23\nassert s.is_empty() == False\nassert s.pop() == 66\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007420", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(2266) == 'MMCCLXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2266) == 'MMCCLXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007421", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([48, 17, 0, 45, 25, 48]) == [0, 17, 25, 45, 48, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 17, 0, 45, 25, 48]) == [0, 17, 25, 45, 48, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007422", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'e', 'e', 'c', 'b', 'c']) == {'c': 3, 'e': 2, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'e', 'e', 'c', 'b', 'c']) == {'c': 3, 'e': 2, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007423", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{[]a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{[]a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007424", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 2, 5, 0]) == [5, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 5, 0]) == [5, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007425", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(9 + (17 - 11))') == 15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(9 + (17 - 11))') == 15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007426", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 3, 0], [0, 3, 2], [4, 2, 5]], [[0, 3], [0, 0], [5, 4]]) == [[0, 15], [10, 8], [25, 32]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3, 0], [0, 3, 2], [4, 2, 5]], [[0, 3], [0, 0], [5, 4]]) == [[0, 15], [10, 8], [25, 32]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007427", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([7, 39, 36, 38, 34, 37]) == [7, 34, 36, 37, 38, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 39, 36, 38, 34, 37]) == [7, 34, 36, 37, 38, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007428", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('(b{())aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(b{())aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007429", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([5, 1, 25]) == 5\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 1, 25]) == 5\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007430", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['abxxz', 'abzzy', 'abxyy', 'abzx']) == 'ab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abxxz', 'abzzy', 'abxyy', 'abzx']) == 'ab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007431", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([5, 6, 5, 12, 25, 11]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 6, 5, 12, 25, 11]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007432", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['cz', 'cy']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cz', 'cy']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007433", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'c': 4, 'd': 1, 'a': 4}, 5) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 4, 'd': 1, 'a': 4}, 5) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007434", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([4, -8, -5, 7, -6, -1, 9, 6]) == [4, -4, -9, -2, -8, -9, 0, 6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([4, -8, -5, 7, -6, -1, 9, 6]) == [4, -4, -9, -2, -8, -9, 0, 6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007435", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ddsvnvi') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ddsvnvi') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007436", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cecaddd', 'cedadcd') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cecaddd', 'cedadcd') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007437", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([18, -1, -1, 26, -39, -13, -23, -24, -49]) == 26\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([18, -1, -1, 26, -39, -13, -23, -24, -49]) == 26\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007438", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([5, 0, 7, 5, 1, 5], 3) == [5, 1, 5, 5, 0, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 0, 7, 5, 1, 5], 3) == [5, 1, 5, 5, 0, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007439", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, 0], [-4, -8], [-2, 6], [0, -8]], [[-8, -1], [-6, -4], [9, -9], [-8, -7]]) == [[-15, -1], [-10, -12], [7, -3], [-8, -15]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 0], [-4, -8], [-2, 6], [0, -8]], [[-8, -1], [-6, -4], [9, -9], [-8, -7]]) == [[-15, -1], [-10, -12], [7, -3], [-8, -15]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007440", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(3027) == 12\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3027) == 12\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007441", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 5, 'y': 5}, {'z': 3, 'x': 5, 'y': 7}) == {'x': 10, 'y': 12, 'z': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 5, 'y': 5}, {'z': 3, 'x': 5, 'y': 7}) == {'x': 10, 'y': 12, 'z': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007442", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(39) == 6\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(39) == 6\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007443", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 1, 'e': 34, 'b': 30, 'c': 10}) == {1: 'f', 34: 'e', 30: 'b', 10: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 1, 'e': 34, 'b': 30, 'c': 10}) == {1: 'f', 34: 'e', 30: 'b', 10: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007444", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=826; path=690') == {'port': '826', 'path': '690'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=826; path=690') == {'port': '826', 'path': '690'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007445", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(3849) == 62\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3849) == 62\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007446", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['yy', 'x', 'yz']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['yy', 'x', 'yz']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007447", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([33, 3, 1, 17, 14]) == [1, 3, 14, 17, 33]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([33, 3, 1, 17, 14]) == [1, 3, 14, 17, 33]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007448", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbaaababab', 'bba') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaaababab', 'bba') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007449", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([8, 8, 3, 6, 7, 7, 4], [9, 9, 6, 8, 3, 2, 1]) == [8, 3, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 8, 3, 6, 7, 7, 4], [9, 9, 6, 8, 3, 2, 1]) == [8, 3, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007450", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([6, 9, 12, 16, 17, 19], [0, 3, 4, 5, 12, 17, 17]) == [0, 3, 4, 5, 6, 9, 12, 12, 16, 17, 17, 17, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([6, 9, 12, 16, 17, 19], [0, 3, 4, 5, 12, 17, 17]) == [0, 3, 4, 5, 6, 9, 12, 12, 16, 17, 17, 17, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007451", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 12, 'a': 46, 'b': 90, 'e': 44}) == {12: 'c', 46: 'a', 90: 'b', 44: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 12, 'a': 46, 'b': 90, 'e': 44}) == {12: 'c', 46: 'a', 90: 'b', 44: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007452", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 4, 5, 1, 6, 5, 9, 7, 8, 4], 2) == [[9, 4], [5, 1], [6, 5], [9, 7], [8, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 4, 5, 1, 6, 5, 9, 7, 8, 4], 2) == [[9, 4], [5, 1], [6, 5], [9, 7], [8, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007453", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('cda,63,58,ace') == ['cda', '63', '58', 'ace']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('cda,63,58,ace') == ['cda', '63', '58', 'ace']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007454", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(204) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(204) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007455", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('4h11m37s') == 15097\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h11m37s') == 15097\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007456", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([37, 53, 68, 77], 68) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([37, 53, 68, 77], 68) == 2\nassert binary_search([37, 53, 68, 77], 37) == 0\nassert binary_search([37, 53, 68, 77], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007457", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=on; host=807; user=448') == {'port': 'on', 'host': '807', 'user': '448'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; host=807; user=448') == {'port': 'on', 'host': '807', 'user': '448'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007458", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('eeb') == 'Eeb'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eeb') == 'Eeb'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007459", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([4, 8, 5, 2, 7, 6, 2, 3, 8, 7], 9) == [8, 5, 2, 7, 6, 2, 3, 8, 7, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 8, 5, 2, 7, 6, 2, 3, 8, 7], 9) == [8, 5, 2, 7, 6, 2, 3, 8, 7, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007460", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('48m10s') == 2890\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('48m10s') == 2890\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007461", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([41, 33, 12, 38, 7, 9, 3, 29, 37, 42]) == [3, 7, 9, 12, 29, 33, 37, 38, 41, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 33, 12, 38, 7, 9, 3, 29, 37, 42]) == [3, 7, 9, 12, 29, 33, 37, 38, 41, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007462", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([7, 3, 6, 0, 6, 7, 6, 7, 0], 5) == [[7, 3, 6, 0, 6], [7, 6, 7, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 3, 6, 0, 6, 7, 6, 7, 0], 5) == [[7, 3, 6, 0, 6], [7, 6, 7, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007463", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('4') == 4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('4') == 4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007464", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 16, 'e': 52, 'a': 20}) == {16: 'c', 52: 'e', 20: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 16, 'e': 52, 'a': 20}) == {16: 'c', 52: 'e', 20: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007465", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([11, 3, 22, 11]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 3, 22, 11]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007466", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 12, 'f': 57, 'b': 6, 'd': 29}) == {12: 'a', 57: 'f', 6: 'b', 29: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 12, 'f': 57, 'b': 6, 'd': 29}) == {12: 'a', 57: 'f', 6: 'b', 29: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007467", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[3, 1], [3, 2, 5, 8], [5, 2, 9, 5], [4, 2]]) == [3, 1, 3, 2, 5, 8, 5, 2, 9, 5, 4, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 1], [3, 2, 5, 8], [5, 2, 9, 5], [4, 2]]) == [3, 1, 3, 2, 5, 8, 5, 2, 9, 5, 4, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007468", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[4, 5, 7, 2], [0, 4, 2, 4], [9, 2, 2, 1]]) == [[4, 0, 9], [5, 4, 2], [7, 2, 2], [2, 4, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 5, 7, 2], [0, 4, 2, 4], [9, 2, 2, 1]]) == [[4, 0, 9], [5, 4, 2], [7, 2, 2], [2, 4, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007469", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([5, 23, 41, 14, 27, 1, 14, 17, 10, 37, 45]) == [1, 5, 10, 14, 14, 17, 23, 27, 37, 41, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([5, 23, 41, 14, 27, 1, 14, 17, 10, 37, 45]) == [1, 5, 10, 14, 14, 17, 23, 27, 37, 41, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007470", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([22, 45, 45, 19, 22, 40, 42]) == [19, 22, 22, 40, 42, 45, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 45, 45, 19, 22, 40, 42]) == [19, 22, 22, 40, 42, 45, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007471", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'date', 'avocado', 'date']) == {'c': ['cherry'], 'd': ['date', 'date'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'date', 'avocado', 'date']) == {'c': ['cherry'], 'd': ['date', 'date'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007472", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 51, 'd': 19, 'e': 92, 'f': 18}) == {51: 'b', 19: 'd', 92: 'e', 18: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 51, 'd': 19, 'e': 92, 'f': 18}) == {51: 'b', 19: 'd', 92: 'e', 18: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007473", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 0, 4, 2, 4, 1, 4, 0]) == [5, 0, 4, 2, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 4, 2, 4, 1, 4, 0]) == [5, 0, 4, 2, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007474", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(28) == [2, 2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(28) == [2, 2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007475", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[[2], [3, 2, 3], [6, 4]]]) == [2, 3, 2, 3, 6, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[2], [3, 2, 3], [6, 4]]]) == [2, 3, 2, 3, 6, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007476", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([14, 20], [6, 13, 15, 19]) == [6, 13, 14, 15, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([14, 20], [6, 13, 15, 19]) == [6, 13, 14, 15, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007477", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=642; mode=150; user=off; port=auto') == {'path': '642', 'mode': '150', 'user': 'off', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=642; mode=150; user=off; port=auto') == {'path': '642', 'mode': '150', 'user': 'off', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007478", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('adde') == 'Adde'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('adde') == 'Adde'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007479", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 20], [4, 13, 14, 17, 20, 20]) == [1, 4, 13, 14, 17, 20, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 20], [4, 13, 14, 17, 20, 20]) == [1, 4, 13, 14, 17, 20, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007480", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([21, 5, 28]) == [5, 21, 28]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([21, 5, 28]) == [5, 21, 28]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007481", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[8, 8, 3], 9, [4]]) == [8, 8, 3, 9, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8, 8, 3], 9, [4]]) == [8, 8, 3, 9, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007482", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(16) == 4\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(16) == 4\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007483", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(19, 24) == 456\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 24) == 456\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007484", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([11, 19, 27, 16]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 19, 27, 16]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007485", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(25) == 'XXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(25) == 'XXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007486", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[2, 2, 9, 6], 0, [8, 4, 1], [8, 5, 4, 9], 2]) == [2, 2, 9, 6, 0, 8, 4, 1, 8, 5, 4, 9, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 2, 9, 6], 0, [8, 4, 1], [8, 5, 4, 9], 2]) == [2, 2, 9, 6, 0, 8, 4, 1, 8, 5, 4, 9, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007487", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('b gc') == 'gc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('b gc') == 'gc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007488", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('c,34,ad') == ['c', '34', 'ad']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,34,ad') == ['c', '34', 'ad']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007489", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaabbbbccaaaaaaaaa') == 'a4b4c2a9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaabbbbccaaaaaaaaa') == 'a4b4c2a9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007490", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('LXXVI') == 76\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXXVI') == 76\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007491", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=off; mode=501; user=226; host=off') == {'port': 'off', 'mode': '501', 'user': '226', 'host': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; mode=501; user=226; host=off') == {'port': 'off', 'mode': '501', 'user': '226', 'host': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007492", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([8, 6, 7, 2, 9, 8, 4, 7, 3, 6], 3) == [[8, 6, 7], [2, 9, 8], [4, 7, 3], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 6, 7, 2, 9, 8, 4, 7, 3, 6], 3) == [[8, 6, 7], [2, 9, 8], [4, 7, 3], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007493", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 6, 'z': 4, 'y': 8}, {'x': 4, 'y': 9, 'z': 3}) == {'x': 10, 'z': 7, 'y': 17}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 6, 'z': 4, 'y': 8}, {'x': 4, 'y': 9, 'z': 3}) == {'x': 10, 'z': 7, 'y': 17}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007494", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([27, -25, -40, 23, -27, -2]) == 27\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([27, -25, -40, 23, -27, -2]) == 27\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007495", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([24, 40, 30, 37, 25, 5, 2, 39]) == [2, 5, 24, 25, 30, 37, 39, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 40, 30, 37, 25, 5, 2, 39]) == [2, 5, 24, 25, 30, 37, 39, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007496", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('eafxzcyb') == 'byczxfae'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('eafxzcyb') == 'byczxfae'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007497", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(4947) == 7494\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4947) == 7494\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007498", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(15 - 20) - 15') == -20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(15 - 20) - 15') == -20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007499", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(367) == 'CCCLXVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(367) == 'CCCLXVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007500", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([6, 9, 9, 7, 8, 7], 4) == [9, 7, 8, 7, 6, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 9, 9, 7, 8, 7], 4) == [9, 7, 8, 7, 6, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007501", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('acaeed cdcaab ceddc') == 'Acaeed Cdcaab Ceddc'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('acaeed cdcaab ceddc') == 'Acaeed Cdcaab Ceddc'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007502", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 1, 2, 2, 0, 2]) == [4, 1, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 2, 2, 0, 2]) == [4, 1, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007503", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[[()()]]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[[()()]]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007504", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([5, 6, [7]]) == [5, 6, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 6, [7]]) == [5, 6, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007505", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 4, 1, 5, 1]) == [3, 4, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 1, 5, 1]) == [3, 4, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007506", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('aacd,be,\"b,,,,\",97,1') == ['aacd', 'be', 'b,,,,', '97', '1']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aacd,be,\"b,,,,\",97,1') == ['aacd', 'be', 'b,,,,', '97', '1']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007507", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(255) == 'CCLV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(255) == 'CCLV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007508", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(277) == [277]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(277) == [277]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007509", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([19, 26, 46, 40, 40, 48]) == [19, 26, 40, 40, 46, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([19, 26, 46, 40, 40, 48]) == [19, 26, 40, 40, 46, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007510", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([28, 0, 22, -31]) == 28\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([28, 0, 22, -31]) == 28\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007511", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(48, 17) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 17) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007512", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(5, 200, 186) == 25\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(5, 200, 186) == 25\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007513", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 0, 3, 7], 5) == [[4, 0, 3, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 0, 3, 7], 5) == [[4, 0, 3, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007514", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([29, 40, 54, 71, 97], 71) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([29, 40, 54, 71, 97], 71) == 3\nassert binary_search([29, 40, 54, 71, 97], 29) == 0\nassert binary_search([29, 40, 54, 71, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007515", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(600) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(600) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007516", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 1, 7, 9, 0, 0, 2, 3], [5, 4, 1, 3]) == [1, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 1, 7, 9, 0, 0, 2, 3], [5, 4, 1, 3]) == [1, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007517", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('deeaeb') == 'deab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('deeaeb') == 'deab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007518", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(4 + 12) + 2') == 18\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(4 + 12) + 2') == 18\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007519", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[2], [2, 9, 0]]) == [2, 2, 9, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2], [2, 9, 0]]) == [2, 2, 9, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007520", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(14, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(14, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007521", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('abeae') == 'abe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abeae') == 'abe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007522", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ddaaaaca') == 'd2a4c1a1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddaaaaca') == 'd2a4c1a1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007523", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(59); s.push(86); s.push(2)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(59); s.push(86); s.push(2)\nassert s.peek() == 2\nassert s.pop() == 2\nassert s.pop() == 86\nassert s.is_empty() == False\nassert s.pop() == 59\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007524", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('babed bec cd') == 'Babed Bec Cd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('babed bec cd') == 'Babed Bec Cd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007525", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(159) == [3, 53]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(159) == [3, 53]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007526", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[0, 3], [1, 5]], [[0, 4, 2], [5, 0, 5]]) == [[15, 0, 15], [25, 4, 27]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3], [1, 5]], [[0, 4, 2], [5, 0, 5]]) == [[15, 0, 15], [25, 4, 27]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007527", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['e', 'b', 'b', 'c', 'b', 'd', 'e', 'b', 'a', 'b']) == {'e': 2, 'b': 5, 'c': 1, 'd': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'b', 'b', 'c', 'b', 'd', 'e', 'b', 'a', 'b']) == {'e': 2, 'b': 5, 'c': 1, 'd': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007528", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(2, 11) == 2048\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 11) == 2048\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007529", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aeddead') == 'aed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aeddead') == 'aed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007530", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 7, 'w': 3}, {'w': 2}) == {'y': 7, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 7, 'w': 3}, {'w': 2}) == {'y': 7, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007531", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CCXLI') == 241\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXLI') == 241\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007532", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(1, 10) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 10) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007533", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([3, 28, 4, 7]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([3, 28, 4, 7]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007534", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([7, 8, 3, 7, 9, 2], 3) == [[7, 8, 3], [7, 9, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 8, 3, 7, 9, 2], 3) == [[7, 8, 3], [7, 9, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007535", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('LXI') == 61\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXI') == 61\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007536", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([16, 8, 20, 46]) == [8, 16, 20, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([16, 8, 20, 46]) == [8, 16, 20, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007537", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('baabbbbaab') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('baabbbbaab') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007538", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(451785) == 672\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(451785) == 672\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007539", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(44) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(44) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007540", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(5, 3) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(5, 3) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007541", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 13, 'a': 61, 'f': 92}) == {13: 'c', 61: 'a', 92: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 13, 'a': 61, 'f': 92}) == {13: 'c', 61: 'a', 92: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007542", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abccb', 'ab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abccb', 'ab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007543", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=off; user=543; port=auto; path=522') == {'host': 'off', 'user': '543', 'port': 'auto', 'path': '522'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=off; user=543; port=auto; path=522') == {'host': 'off', 'user': '543', 'port': 'auto', 'path': '522'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007544", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('bbabbbbabb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbabbbbabb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007545", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbbbababaaa', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbababaaa', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007546", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('cccaaaabb') == 'c3a4b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccaaaabb') == 'c3a4b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007547", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([2, 41, 34]) == [2, 34, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([2, 41, 34]) == [2, 34, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007548", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('cccccc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cccccc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007549", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=548; user=auto; path=auto') == {'mode': '548', 'user': 'auto', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=548; user=auto; path=auto') == {'mode': '548', 'user': 'auto', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007550", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('43m48s') == 2628\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('43m48s') == 2628\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007551", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[7, 2], [-1, -2], [-4, 7]], [[5, -8], [-6, 6], [-5, -4]]) == [[12, -6], [-7, 4], [-9, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 2], [-1, -2], [-4, 7]], [[5, -8], [-6, 6], [-5, -4]]) == [[12, -6], [-7, 4], [-9, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007552", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([23, 2, 2, 11, 24, 50, 41]) == [2, 2, 11, 23, 24, 41, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 2, 2, 11, 24, 50, 41]) == [2, 2, 11, 23, 24, 41, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007553", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('babcaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('babcaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007554", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(32, 25, 290) == 72\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(32, 25, 290) == 72\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007555", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([9, -28]) == 9\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([9, -28]) == 9\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007556", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python Python', 1) == 'Qzuipo Qzuipo'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Python', 1) == 'Qzuipo Qzuipo'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007557", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 1, 5, 5, 3, 3, 3, 2, 5, 2, 5]) == [3, 1, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 5, 5, 3, 3, 3, 2, 5, 2, 5]) == [3, 1, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007558", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-4, 3, -1, -9], [-9, -5, 5, 6], [-8, 7, 7, 8]], [[9, 1, -3, 0], [5, -5, -3, -8], [8, 5, -6, -1]]) == [[5, 4, -4, -9], [-4, -10, 2, -2], [0, 12, 1, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 3, -1, -9], [-9, -5, 5, 6], [-8, 7, 7, 8]], [[9, 1, -3, 0], [5, -5, -3, -8], [8, 5, -6, -1]]) == [[5, 4, -4, -9], [-4, -10, 2, -2], [0, 12, 1, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007559", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-35, -43, -1, 15, -21, 4]) == 15\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-35, -43, -1, 15, -21, 4]) == 15\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007560", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'banana', 'cherry', 'banana', 'banana', 'banana', 'coconut']) == {'a': ['apple'], 'b': ['banana', 'banana', 'banana', 'banana'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'banana', 'cherry', 'banana', 'banana', 'banana', 'coconut']) == {'a': ['apple'], 'b': ['banana', 'banana', 'banana', 'banana'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007561", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[8, -2], [4, -8], [-3, 7]], [[9, 3], [-3, -8], [6, 6]]) == [[17, 1], [1, -16], [3, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -2], [4, -8], [-3, 7]], [[9, 3], [-3, -8], [6, 6]]) == [[17, 1], [1, -16], [3, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007562", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([11, 22, 26, 22, 1, 20, 20, 11]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 22, 26, 22, 1, 20, 20, 11]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007563", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 5], [1, 1]], [[2, 1, 1], [3, 2, 1]]) == [[17, 11, 6], [5, 3, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5], [1, 1]], [[2, 1, 1], [3, 2, 1]]) == [[17, 11, 6], [5, 3, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007564", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(112) == [2, 2, 2, 2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(112) == [2, 2, 2, 2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007565", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 5, 5, 2]) == [0, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 5, 5, 2]) == [0, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007566", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('48m50s') == 2930\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('48m50s') == 2930\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007567", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(2121) == 6\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2121) == 6\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007568", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([7, 1, 3, 5, 4, 3, 4, 6, 6, 1], 4) == [[7, 1, 3, 5], [4, 3, 4, 6], [6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 1, 3, 5, 4, 3, 4, 6, 6, 1], 4) == [[7, 1, 3, 5], [4, 3, 4, 6], [6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007569", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bcdaeed') == 'bcdae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bcdaeed') == 'bcdae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007570", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'b': 21, 'f': 18, 'a': 66}) == {21: 'b', 18: 'f', 66: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 21, 'f': 18, 'a': 66}) == {21: 'b', 18: 'f', 66: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007571", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Code Hello', 2) == 'Eqfg Jgnnq'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Hello', 2) == 'Eqfg Jgnnq'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007572", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(425) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(425) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007573", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat dog ran The') == {'sat': 1, 'dog': 1, 'ran': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat dog ran The') == {'sat': 1, 'dog': 1, 'ran': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007574", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('{[[{}]]}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{[[{}]]}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007575", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(36) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(36) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007576", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(5, 10) == 9765625\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 10) == 9765625\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007577", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-2, -8], [2, 2]], [[-6, 1], [9, -2]]) == [[-8, -7], [11, 0]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, -8], [2, 2]], [[-6, 1], [9, -2]]) == [[-8, -7], [11, 0]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007578", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(4942) == 2494\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4942) == 2494\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007579", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([5, [0, 5], 2]) == 12\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([5, [0, 5], 2]) == 12\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007580", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([7, 8, 4, 9, 0], 3) == [4, 9, 0, 7, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 8, 4, 9, 0], 3) == [4, 9, 0, 7, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007581", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(13, 5) == 65\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 5) == 65\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007582", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([7, 23, 5, 7, 26]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 23, 5, 7, 26]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007583", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(136) == 15\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(136) == 15\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007584", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(433)\nacc.deposit(126)\nacc.withdraw(165)\nacc.withdraw(561)\nassert acc.get_balance() == 559\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(433)\nacc.deposit(126)\nassert acc.get_balance() == 559\nacc.withdraw(165)\nassert acc.get_balance() == 394\nacc.withdraw(561)\nassert acc.get_balance() == 394\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007585", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([47, 28, 17, 47, 8, 2, 34]) == [2, 8, 17, 28, 34, 47, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([47, 28, 17, 47, 8, 2, 34]) == [2, 8, 17, 28, 34, 47, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007586", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(3239) == 'MMMCCXXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3239) == 'MMMCCXXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007587", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(9174) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9174) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007588", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(9081) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9081) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007589", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(427)\nacc.deposit(177)\nacc.withdraw(496)\nacc.withdraw(672)\nassert acc.get_balance() == 604\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(427)\nacc.deposit(177)\nassert acc.get_balance() == 604\nacc.withdraw(496)\nassert acc.get_balance() == 108\nacc.withdraw(672)\nassert acc.get_balance() == 108\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007590", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(22, 8) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(22, 8) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007591", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 2, 4, 3, 1, 5]) == [4, 2, 3, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 4, 3, 1, 5]) == [4, 2, 3, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007592", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-3, -43]) == -3\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-3, -43]) == -3\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007593", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(1366) == 36\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1366) == 36\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007594", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(52) == [2, 2, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(52) == [2, 2, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007595", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(80) == [2, 2, 2, 2, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(80) == [2, 2, 2, 2, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007596", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(2254) == 47\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2254) == 47\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007597", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([36, 3, 29, 40, 36, 12, 0, 0]) == [0, 0, 3, 12, 29, 36, 36, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([36, 3, 29, 40, 36, 12, 0, 0]) == [0, 0, 3, 12, 29, 36, 36, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007598", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([10, 43, 48, 57, 71], 48) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 43, 48, 57, 71], 48) == 2\nassert binary_search([10, 43, 48, 57, 71], 10) == 0\nassert binary_search([10, 43, 48, 57, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007599", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(19, 14) == 266\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 14) == 266\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007600", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('20 + 7') == 27\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20 + 7') == 27\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007601", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(24); s.push(0); s.push(1)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(24); s.push(0); s.push(1)\nassert s.peek() == 1\nassert s.pop() == 1\nassert s.pop() == 0\nassert s.is_empty() == False\nassert s.pop() == 24\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007602", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-15, -3, -1, 6, -15, 18]) == -10\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-15, -3, -1, 6, -15, 18]) == -10\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007603", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([1, -2, -2, -5, -6]) == [1, -1, -3, -8, -14]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, -2, -2, -5, -6]) == [1, -1, -3, -8, -14]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007604", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Dog dog cat The cat') == {'dog': 2, 'cat': 2, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog dog cat The cat') == {'dog': 2, 'cat': 2, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007605", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('eecab ch h hcbea hdbffabe ac') == 'hdbffabe'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('eecab ch h hcbea hdbffabe ac') == 'hdbffabe'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007606", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(21) == 'XXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(21) == 'XXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007607", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([38, 37, 39, 23, 34]) == [23, 34, 37, 38, 39]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([38, 37, 39, 23, 34]) == [23, 34, 37, 38, 39]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007608", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(6154) == 78\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6154) == 78\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007609", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(2, 8) == 256\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(2, 8) == 256\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007610", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(46); s.push(49); s.push(53)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(46); s.push(49); s.push(53)\nassert s.peek() == 53\nassert s.pop() == 53\nassert s.pop() == 49\nassert s.is_empty() == False\nassert s.pop() == 46\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007611", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8478) == 27\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8478) == 27\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007612", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 0, 3, 4, 1, 0, 3, 3, 3, 3]) == [5, 0, 3, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 3, 4, 1, 0, 3, 3, 3, 3]) == [5, 0, 3, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007613", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-7, 11, 6, 9]) == 19\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-7, 11, 6, 9]) == 19\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007614", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 4, 0], [1, 1, 0], [3, 2, 0]], [[2, 0, 0], [2, 4, 4], [5, 4, 1]]) == [[18, 16, 16], [4, 4, 4], [10, 8, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 4, 0], [1, 1, 0], [3, 2, 0]], [[2, 0, 0], [2, 4, 4], [5, 4, 1]]) == [[18, 16, 16], [4, 4, 4], [10, 8, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007615", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(423) == 'CDXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(423) == 'CDXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007616", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(1914) == 43\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1914) == 43\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007617", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(23, 2) == 46\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 2) == 46\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007618", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the dog cat cat! cat') == {'the': 1, 'dog': 1, 'cat': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the dog cat cat! cat') == {'the': 1, 'dog': 1, 'cat': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007619", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([21, 5, 20]) == [5, 20, 21]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([21, 5, 20]) == [5, 20, 21]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007620", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([0], [1, 5, 6, 20]) == [0, 1, 5, 6, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0], [1, 5, 6, 20]) == [0, 1, 5, 6, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007621", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=824; host=off; port=412') == {'mode': '824', 'host': 'off', 'port': '412'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=824; host=off; port=412') == {'mode': '824', 'host': 'off', 'port': '412'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007622", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('efff', 'ffef') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efff', 'ffef') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007623", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 4, 0, 8], 7) == [4, 0, 8, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 4, 0, 8], 7) == [4, 0, 8, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007624", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=on; mode=651') == {'user': 'on', 'mode': '651'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=on; mode=651') == {'user': 'on', 'mode': '651'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007625", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('50m18s') == 3018\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('50m18s') == 3018\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007626", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-13, 9, -6, 19, 11]) == 20\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-13, 9, -6, 19, 11]) == 20\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007627", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(9, 57) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(9, 57) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007628", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('acaacbbcaacc', 'aba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acaacbbcaacc', 'aba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007629", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(22) == 'XXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(22) == 'XXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007630", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 7, 'w': 6}, {'w': 5, 'z': 8, 'x': 7}) == {'z': 15, 'w': 11, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7, 'w': 6}, {'w': 5, 'z': 8, 'x': 7}) == {'z': 15, 'w': 11, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007631", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(67) == 27\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(67) == 27\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007632", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 7, 8, 7, 1, 7, 9, 1], 2) == [9, 1, 9, 7, 8, 7, 1, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 7, 8, 7, 1, 7, 9, 1], 2) == [9, 1, 9, 7, 8, 7, 1, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007633", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the dog cat the sat dog the,') == {'the': 3, 'dog': 2, 'cat': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the dog cat the sat dog the,') == {'the': 3, 'dog': 2, 'cat': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007634", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 4, 0, 2, 2, 0, 3]) == [2, 4, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 4, 0, 2, 2, 0, 3]) == [2, 4, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007635", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 64, 'd': 24}) == {64: 'c', 24: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 64, 'd': 24}) == {64: 'c', 24: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007636", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(382943) == 618\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(382943) == 618\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007637", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'z': 1, 'y': 1, 'x': 7}) == {'y': 2, 'z': 1, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'z': 1, 'y': 1, 'x': 7}) == {'y': 2, 'z': 1, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007638", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-32, -10]) == -10\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-32, -10]) == -10\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007639", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(84); s.push(20); s.push(12)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(84); s.push(20); s.push(12)\nassert s.peek() == 12\nassert s.pop() == 12\nassert s.pop() == 20\nassert s.is_empty() == False\nassert s.pop() == 84\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007640", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([2, 5, 4, 7, 7, 6, 0, 6, 1], 3) == [[2, 5, 4], [7, 7, 6], [0, 6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 4, 7, 7, 6, 0, 6, 1], 3) == [[2, 5, 4], [7, 7, 6], [0, 6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007641", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(70, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(70, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007642", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(30) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(30) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007643", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('18') == 18\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('18') == 18\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007644", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(4884) == 4884\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(4884) == 4884\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007645", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'date', 'banana', 'cherry', 'banana', 'apple']) == {'b': ['berry', 'banana', 'banana'], 'd': ['date'], 'c': ['cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'banana', 'cherry', 'banana', 'apple']) == {'b': ['berry', 'banana', 'banana'], 'd': ['date'], 'c': ['cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007646", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('babababababab', 'baba') == 5\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babababababab', 'baba') == 5\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007647", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('baedbdd') == 'baed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('baedbdd') == 'baed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007648", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('}b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007649", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('c,36') == ['c', '36']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,36') == ['c', '36']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007650", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaacc') == 'a3c2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaacc') == 'a3c2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007651", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun ran Dog ran ran cat sat.') == {'sun': 1, 'ran': 3, 'dog': 1, 'cat': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun ran Dog ran ran cat sat.') == {'sun': 1, 'ran': 3, 'dog': 1, 'cat': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007652", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([24, 21, 37, 32, 49, 23, 44]) == [21, 23, 24, 32, 37, 44, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([24, 21, 37, 32, 49, 23, 44]) == [21, 23, 24, 32, 37, 44, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007653", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'd', 'c', 'd', 'b', 'a']) == {'a': 2, 'd': 2, 'c': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'c', 'd', 'b', 'a']) == {'a': 2, 'd': 2, 'c': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007654", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([1, [2], 8, [8, 5]]) == [1, 2, 8, 8, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [2], 8, [8, 5]]) == [1, 2, 8, 8, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007655", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('18 + 1 + 20') == 39\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('18 + 1 + 20') == 39\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007656", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(78); s.push(1); s.push(63)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(78); s.push(1); s.push(63)\nassert s.peek() == 63\nassert s.pop() == 63\nassert s.pop() == 1\nassert s.is_empty() == False\nassert s.pop() == 78\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007657", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2942) == 'MMCMXLII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2942) == 'MMCMXLII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007658", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbbbaaaababb', 'bbab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbaaaababb', 'bbab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007659", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 9, 9], [1, 1, 3, 1, 9]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 9, 9], [1, 1, 3, 1, 9]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007660", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(48); s.push(77); s.push(66)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(48); s.push(77); s.push(66)\nassert s.peek() == 66\nassert s.pop() == 66\nassert s.pop() == 77\nassert s.is_empty() == False\nassert s.pop() == 48\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007661", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'apple', 'cherry', 'date', 'apple', 'avocado']) == {'a': ['avocado', 'apple', 'apple', 'avocado'], 'c': ['cherry', 'cherry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'apple', 'cherry', 'date', 'apple', 'avocado']) == {'a': ['avocado', 'apple', 'apple', 'avocado'], 'c': ['cherry', 'cherry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007662", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('bcaabbaacb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bcaabbaacb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007663", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('[b([))') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[b([))') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007664", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 3, 4, 1, 2], [6, 3, 6, 6]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 3, 4, 1, 2], [6, 3, 6, 6]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007665", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 96, 'b': 28, 'd': 22}) == {96: 'c', 28: 'b', 22: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 96, 'b': 28, 'd': 22}) == {96: 'c', 28: 'b', 22: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007666", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([9, 0, 0, 6, 6, 8, 3], 3) == [[9, 0, 0], [6, 6, 8], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 0, 0, 6, 6, 8, 3], 3) == [[9, 0, 0], [6, 6, 8], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007667", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abaaab', 'abb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abaaab', 'abb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007668", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CXVII') == 117\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXVII') == 117\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007669", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([8, 7, 1], [2, 4, 8, 8, 6]) == [8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 7, 1], [2, 4, 8, 8, 6]) == [8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007670", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[4, -9], [4, 3], [-7, 2]], [[-9, -6], [9, 7], [5, 3]]) == [[-5, -15], [13, 10], [-2, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, -9], [4, 3], [-7, 2]], [[-9, -6], [9, 7], [5, 3]]) == [[-5, -15], [13, 10], [-2, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007671", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(227) == 13\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(227) == 13\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007672", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(6159) == 9516\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6159) == 9516\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007673", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h48m58s') == 20938\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h48m58s') == 20938\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007674", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[4, 1, 1], [4, 1, 3]], [[5, 5, 0], [1, 2, 4], [0, 2, 0]]) == [[21, 24, 4], [21, 28, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 1, 1], [4, 1, 3]], [[5, 5, 0], [1, 2, 4], [0, 2, 0]]) == [[21, 24, 4], [21, 28, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007675", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'date', 'cherry']) == {'b': ['berry'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'cherry']) == {'b': ['berry'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007676", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'f': 11, 'c': 1, 'a': 54, 'd': 68, 'b': 5}) == {11: 'f', 1: 'c', 54: 'a', 68: 'd', 5: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 11, 'c': 1, 'a': 54, 'd': 68, 'b': 5}) == {11: 'f', 1: 'c', 54: 'a', 68: 'd', 5: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007677", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 79, 'b': 11, 'e': 12}) == {79: 'f', 11: 'b', 12: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 79, 'b': 11, 'e': 12}) == {79: 'f', 11: 'b', 12: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007678", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('\"bb,\",c,bbe,bca') == ['bb,', 'c', 'bbe', 'bca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"bb,\",c,bbe,bca') == ['bb,', 'c', 'bbe', 'bca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007679", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(186) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(186) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007680", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'c': 4, 'e': 4}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 4, 'e': 4}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007681", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('efdad', 'efdadc') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efdad', 'efdadc') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007682", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(16, 24) == 8\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(16, 24) == 8\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007683", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(79); s.push(91); s.push(97)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(79); s.push(91); s.push(97)\nassert s.peek() == 97\nassert s.pop() == 97\nassert s.pop() == 91\nassert s.is_empty() == False\nassert s.pop() == 79\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007684", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('fcfd', 'fcfdd') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fcfd', 'fcfdd') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007685", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=533; mode=464; user=off') == {'path': '533', 'mode': '464', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=533; mode=464; user=off') == {'path': '533', 'mode': '464', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007686", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([5, 0, 3, 6, 8, 4, 8, 2, 0, 1], 4) == [[5, 0, 3, 6], [8, 4, 8, 2], [0, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 0, 3, 6, 8, 4, 8, 2, 0, 1], 4) == [[5, 0, 3, 6], [8, 4, 8, 2], [0, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007687", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([11, 26, 27, 50, 75, 93], 11) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([11, 26, 27, 50, 75, 93], 11) == 0\nassert binary_search([11, 26, 27, 50, 75, 93], 11) == 0\nassert binary_search([11, 26, 27, 50, 75, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007688", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code', 11) == 'Nzop'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 11) == 'Nzop'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007689", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('eiyj') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('eiyj') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007690", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(23, 110, 817) == 662\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(23, 110, 817) == 662\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007691", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([2, 4, 4, 1, [2, 0, 5]]) == [2, 4, 4, 1, 2, 0, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, 4, 4, 1, [2, 0, 5]]) == [2, 4, 4, 1, 2, 0, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007692", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 37, 'd': 2}) == {37: 'c', 2: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 37, 'd': 2}) == {37: 'c', 2: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007693", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[4, 1], [3]]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[4, 1], [3]]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007694", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([13, 1, 46]) == [1, 13, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([13, 1, 46]) == [1, 13, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007695", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(8, 10) == 1073741824\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 10) == 1073741824\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007696", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([30, 2, 44, 50, 3]) == [2, 3, 30, 44, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 2, 44, 50, 3]) == [2, 3, 30, 44, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007697", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 98, 'f': 21, 'a': 95}) == {98: 'd', 21: 'f', 95: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 98, 'f': 21, 'a': 95}) == {98: 'd', 21: 'f', 95: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007698", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 3, 1, 5, 9, 9, 4, 2, 8, 5, 7, 8, 5, 8, 1, 9], 5) == [[0, 3, 1, 5, 9], [9, 4, 2, 8, 5], [7, 8, 5, 8, 1], [9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 3, 1, 5, 9, 9, 4, 2, 8, 5, 7, 8, 5, 8, 1, 9], 5) == [[0, 3, 1, 5, 9], [9, 4, 2, 8, 5], [7, 8, 5, 8, 1], [9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007699", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MCCCV') == 1305\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCCCV') == 1305\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007700", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([2, -5, -13, -5]) == -21\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, -5, -13, -5]) == -21\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007701", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([8, 8, 1, -1]) == 16\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([8, 8, 1, -1]) == 16\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007702", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([44, 19, 27, 34, 20, 15]) == [15, 19, 20, 27, 34, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 19, 27, 34, 20, 15]) == [15, 19, 20, 27, 34, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007703", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5], 1, [1, 2, 6, 1]]) == [5, 1, 1, 2, 6, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], 1, [1, 2, 6, 1]]) == [5, 1, 1, 2, 6, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007704", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 6, 4, 9], 5) == [[8, 6, 4, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 6, 4, 9], 5) == [[8, 6, 4, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007705", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1950) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1950) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007706", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(5, 2) == 10\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 2) == 10\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007707", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[5, 4, 4], [5, 5, 4], [0, 1, 3]], [[0, 4, 1], [1, 5, 1], [5, 4, 5]]) == [[24, 56, 29], [25, 61, 30], [16, 17, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 4, 4], [5, 5, 4], [0, 1, 3]], [[0, 4, 1], [1, 5, 1], [5, 4, 5]]) == [[24, 56, 29], [25, 61, 30], [16, 17, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007708", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 58, 'e': 76, 'f': 23}) == {58: 'a', 76: 'e', 23: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 58, 'e': 76, 'f': 23}) == {58: 'a', 76: 'e', 23: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007709", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([49, -35, 31, 7, 47, 28, 17, 31]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([49, -35, 31, 7, 47, 28, 17, 31]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007710", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 79, 'e': 67, 'f': 88, 'b': 92}) == {79: 'a', 67: 'e', 88: 'f', 92: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 79, 'e': 67, 'f': 88, 'b': 92}) == {79: 'a', 67: 'e', 88: 'f', 92: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007711", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([0, 36, 22, 44, 49, 11, 44, 32, 47, 29, 33, 13, 6]) == [0, 6, 11, 13, 22, 29, 32, 33, 36, 44, 44, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 36, 22, 44, 49, 11, 44, 32, 47, 29, 33, 13, 6]) == [0, 6, 11, 13, 22, 29, 32, 33, 36, 44, 44, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007712", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('host=on; path=off; port=102; user=914') == {'host': 'on', 'path': 'off', 'port': '102', 'user': '914'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; path=off; port=102; user=914') == {'host': 'on', 'path': 'off', 'port': '102', 'user': '914'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007713", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([13, 16, 32, 37, 48, 63, 65, 79], 63) == 5\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 16, 32, 37, 48, 63, 65, 79], 63) == 5\nassert binary_search([13, 16, 32, 37, 48, 63, 65, 79], 13) == 0\nassert binary_search([13, 16, 32, 37, 48, 63, 65, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007714", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(967758) == 983\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(967758) == 983\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007715", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h21m3s') == 15663\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h21m3s') == 15663\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007716", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccccccaaaacccccccccccccc') == 'c8a4c14'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccccaaaacccccccccccccc') == 'c8a4c14'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007717", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-4, -9], [8, -1], [9, 9]], [[-8, 5], [-5, -8], [8, -5]]) == [[-12, -4], [3, -9], [17, 4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -9], [8, -1], [9, 9]], [[-8, 5], [-5, -8], [8, -5]]) == [[-12, -4], [3, -9], [17, 4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007718", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([6, 9, 6, 9, 0, 4, 0, 9], [3, 4, 5, 6, 7]) == [6, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 6, 9, 0, 4, 0, 9], [3, 4, 5, 6, 7]) == [6, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007719", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1, 2, 2, 6, 13, 15, 20], [4, 10, 11, 18, 19, 19]) == [1, 2, 2, 4, 6, 10, 11, 13, 15, 18, 19, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 2, 2, 6, 13, 15, 20], [4, 10, 11, 18, 19, 19]) == [1, 2, 2, 4, 6, 10, 11, 13, 15, 18, 19, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007720", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=458; host=on; path=on; user=838') == {'mode': '458', 'host': 'on', 'path': 'on', 'user': '838'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=458; host=on; path=on; user=838') == {'mode': '458', 'host': 'on', 'path': 'on', 'user': '838'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007721", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('57m54s') == 3474\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('57m54s') == 3474\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007722", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[3, 2, 2, 8], [2, 8, 9, 4], [8, 6, 5, 3], [9, 0, 0, 1]]) == [[3, 2, 8, 9], [2, 8, 6, 0], [2, 9, 5, 0], [8, 4, 3, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[3, 2, 2, 8], [2, 8, 9, 4], [8, 6, 5, 3], [9, 0, 0, 1]]) == [[3, 2, 8, 9], [2, 8, 6, 0], [2, 9, 5, 0], [8, 4, 3, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007723", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(792) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(792) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007724", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aaabcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaabcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007725", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([2, 4, 7, 8, 12, 18, 19], [1, 16]) == [1, 2, 4, 7, 8, 12, 16, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 4, 7, 8, 12, 18, 19], [1, 16]) == [1, 2, 4, 7, 8, 12, 16, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007726", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(22, 7) == 154\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 7) == 154\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007727", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(688347) == 829\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(688347) == 829\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007728", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(45, 41) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(45, 41) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007729", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('xyz', 12) == 'jkl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 12) == 'jkl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007730", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([10, 2, 30, 9, 1, 19, 39, 18]) == [1, 2, 9, 10, 18, 19, 30, 39]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 2, 30, 9, 1, 19, 39, 18]) == [1, 2, 9, 10, 18, 19, 30, 39]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007731", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(41, 36) == 1476\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(41, 36) == 1476\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007732", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[[2], 2, [8]], [[4, 5, 5]]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[2], 2, [8]], [[4, 5, 5]]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007733", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(90); s.push(41); s.push(49)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(41); s.push(49)\nassert s.peek() == 49\nassert s.pop() == 49\nassert s.pop() == 41\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007734", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([8, 50, 41, 10, 44, 28, 17, 6]) == [6, 8, 10, 17, 28, 41, 44, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([8, 50, 41, 10, 44, 28, 17, 6]) == [6, 8, 10, 17, 28, 41, 44, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007735", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[6, 2, 2], [6, 8, 7], [6, 6, 4]]) == [[6, 6, 6], [2, 8, 6], [2, 7, 4]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 2, 2], [6, 8, 7], [6, 6, 4]]) == [[6, 6, 6], [2, 8, 6], [2, 7, 4]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007736", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(261) == 'CCLXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(261) == 'CCLXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007737", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(3803) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3803) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007738", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('b[b)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b[b)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007739", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([9, 9, 0, 9, 6]) == [9, 9, 0, 9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 9, 0, 9, 6]) == [9, 9, 0, 9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007740", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(48, 34) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(48, 34) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007741", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'x': 4}, {'y': 8, 'x': 4, 'w': 5}) == {'z': 4, 'x': 8, 'y': 8, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'x': 4}, {'y': 8, 'x': 4, 'w': 5}) == {'z': 4, 'x': 8, 'y': 8, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007742", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['a', 'azzx', 'ayyz']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['a', 'azzx', 'ayyz']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007743", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([3, 7, 1, 7, 1, 9], 5) == [[3, 7, 1, 7, 1], [9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 7, 1, 7, 1, 9], 5) == [[3, 7, 1, 7, 1], [9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007744", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(8567) == 7658\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8567) == 7658\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007745", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(17) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(17) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007746", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bdbeaaecbdede') == 'bdeac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bdbeaaecbdede') == 'bdeac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007747", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran ran the Dog dog sun dog cat the! ran') == {'ran': 3, 'the': 2, 'dog': 3, 'sun': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran ran the Dog dog sun dog cat the! ran') == {'ran': 3, 'the': 2, 'dog': 3, 'sun': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007748", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('cbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007749", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('4h3m50s') == 14630\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h3m50s') == 14630\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007750", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(342) == 'CCCXLII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(342) == 'CCCXLII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007751", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'apple', 'apple', 'coconut', 'date', 'berry', 'date']) == {'c': ['cherry', 'coconut'], 'b': ['berry', 'berry'], 'a': ['apple', 'apple'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'apple', 'apple', 'coconut', 'date', 'berry', 'date']) == {'c': ['cherry', 'coconut'], 'b': ['berry', 'berry'], 'a': ['apple', 'apple'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007752", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 8, 1, 1, 5, 0, 7, 1, 2, 3, 4, 6], 5) == [[8, 8, 1, 1, 5], [0, 7, 1, 2, 3], [4, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 8, 1, 1, 5, 0, 7, 1, 2, 3, 4, 6], 5) == [[8, 8, 1, 1, 5], [0, 7, 1, 2, 3], [4, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007753", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(92652) == 304\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(92652) == 304\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007754", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'berry', 'date', 'date', 'banana', 'avocado', 'apple', 'date']) == {'b': ['banana', 'berry', 'banana'], 'd': ['date', 'date', 'date'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'berry', 'date', 'date', 'banana', 'avocado', 'apple', 'date']) == {'b': ['banana', 'berry', 'banana'], 'd': ['date', 'date', 'date'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007755", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[0], [1], [5, 7]]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0], [1], [5, 7]]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007756", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([5, 1, 7], 3) == [5, 1, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 1, 7], 3) == [5, 1, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007757", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([6, 31, 29]) == [6, 29, 31]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([6, 31, 29]) == [6, 29, 31]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007758", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(3, 4) == 81\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(3, 4) == 81\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007759", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([2, 0, [[3, 9], [5, 9, 2], 9]]) == [2, 0, 3, 9, 5, 9, 2, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([2, 0, [[3, 9], [5, 9, 2], 9]]) == [2, 0, 3, 9, 5, 9, 2, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007760", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'x': 3, 'z': 4}) == {'z': 11, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'x': 3, 'z': 4}) == {'z': 11, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007761", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbcacaccabca', 'caca') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbcacaccabca', 'caca') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007762", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([0, 9]) == [0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, 9]) == [0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007763", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([10, 4, 4, 6]) == 6\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 4, 4, 6]) == 6\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007764", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([29, 35, -48, 4, -16, -25]) == 35\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([29, 35, -48, 4, -16, -25]) == 35\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007765", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(3633) == 15\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3633) == 15\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007766", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 11) == 'lmn'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 11) == 'lmn'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007767", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(5617) == 19\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5617) == 19\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007768", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('accxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('accxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007769", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'apple', 'banana', 'banana', 'date', 'date', 'banana', 'avocado']) == {'a': ['apple', 'apple', 'avocado'], 'b': ['banana', 'banana', 'banana'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'apple', 'banana', 'banana', 'date', 'date', 'banana', 'avocado']) == {'a': ['apple', 'apple', 'avocado'], 'b': ['banana', 'banana', 'banana'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007770", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=616; port=308') == {'user': '616', 'port': '308'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=616; port=308') == {'user': '616', 'port': '308'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007771", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran cat ran. ran ran cat') == {'ran': 4, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran cat ran. ran ran cat') == {'ran': 4, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007772", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('dog sat cat, Sat Sun') == {'dog': 1, 'sat': 2, 'cat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat cat, Sat Sun') == {'dog': 1, 'sat': 2, 'cat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007773", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['zxz', '', 'zy']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zxz', '', 'zy']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007774", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('hbaadfg hbhcfh') == 'hbaadfg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hbaadfg hbhcfh') == 'hbaadfg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007775", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([0, [9, 5, 6], 3, [4, 4, 9]]) == [0, 9, 5, 6, 3, 4, 4, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, [9, 5, 6], 3, [4, 4, 9]]) == [0, 9, 5, 6, 3, 4, 4, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007776", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([8, 16, 27, 68, 71, 73, 88, 97], 134) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 16, 27, 68, 71, 73, 88, 97], 134) == -1\nassert binary_search([8, 16, 27, 68, 71, 73, 88, 97], 8) == 0\nassert binary_search([8, 16, 27, 68, 71, 73, 88, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007777", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'w': 5}, {'y': 2, 'z': 7, 'w': 7}) == {'x': 4, 'w': 12, 'y': 2, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'w': 5}, {'y': 2, 'z': 7, 'w': 7}) == {'x': 4, 'w': 12, 'y': 2, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007778", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(7553) == 86\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7553) == 86\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007779", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([3, [6, 3, 3, 8], 5, 0]) == [3, 6, 3, 3, 8, 5, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [6, 3, 3, 8], 5, 0]) == [3, 6, 3, 3, 8, 5, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007780", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(4455) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4455) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007781", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[5, 2, [7]]]) == [5, 2, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 2, [7]]]) == [5, 2, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007782", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(5212) == 2125\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5212) == 2125\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007783", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(98); s.push(64); s.push(94)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(98); s.push(64); s.push(94)\nassert s.peek() == 94\nassert s.pop() == 94\nassert s.pop() == 64\nassert s.is_empty() == False\nassert s.pop() == 98\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007784", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([12, 18, 19], [6, 12, 15, 16, 17, 17]) == [6, 12, 12, 15, 16, 17, 17, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([12, 18, 19], [6, 12, 15, 16, 17, 17]) == [6, 12, 12, 15, 16, 17, 17, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007785", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaaacccc') == 'a5c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaacccc') == 'a5c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007786", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ccccaaad') == 'c4a3d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccaaad') == 'c4a3d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007787", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([7, 0, 9], [8, 8, 2, 2, 6, 2, 7]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 0, 9], [8, 8, 2, 2, 6, 2, 7]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007788", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([40, 7, 39, 40, 3, 0, 25, 21, 21, 49, 45, 25, 8]) == [0, 3, 7, 8, 21, 21, 25, 25, 39, 40, 40, 45, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 7, 39, 40, 3, 0, 25, 21, 21, 49, 45, 25, 8]) == [0, 3, 7, 8, 21, 21, 25, 25, 39, 40, 40, 45, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007789", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([10, 23, 11, 23, 11]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 23, 11, 23, 11]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007790", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=auto; path=off') == {'host': 'auto', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; path=off') == {'host': 'auto', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007791", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('7 - 4') == 3\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('7 - 4') == 3\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007792", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['b', 'a', 'd']) == {'b': 1, 'a': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'a', 'd']) == {'b': 1, 'a': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007793", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([9, 45, 23, 25, 49, 32, 38]) == [9, 23, 25, 32, 38, 45, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 45, 23, 25, 49, 32, 38]) == [9, 23, 25, 32, 38, 45, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007794", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[2, 8, 7], [1, -3, 2]], [[-7, -9, 4], [1, -7, 4]]) == [[-5, -1, 11], [2, -10, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, 8, 7], [1, -3, 2]], [[-7, -9, 4], [1, -7, 4]]) == [[-5, -1, 11], [2, -10, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007795", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([15, 40, 42, 25, 7, 42, 28, 6, 39, 50, 39, 40]) == [6, 7, 15, 25, 28, 39, 39, 40, 40, 42, 42, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([15, 40, 42, 25, 7, 42, 28, 6, 39, 50, 39, 40]) == [6, 7, 15, 25, 28, 39, 39, 40, 40, 42, 42, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007796", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([14, 25, 23, 32, 48, 34, 34, 0, 38, 32, 27]) == [0, 14, 23, 25, 27, 32, 32, 34, 34, 38, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([14, 25, 23, 32, 48, 34, 34, 0, 38, 32, 27]) == [0, 14, 23, 25, 27, 32, 32, 34, 34, 38, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007797", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('cbce') == 'Cbce'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cbce') == 'Cbce'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007798", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'b': 4, 'd': 4}, 2) == {'b': 4, 'd': 4}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 4, 'd': 4}, 2) == {'b': 4, 'd': 4}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007799", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([46, 48, 33, 44, 33, 26]) == [26, 33, 33, 44, 46, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([46, 48, 33, 44, 33, 26]) == [26, 33, 33, 44, 46, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007800", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([28, 27, 5, 5, 25, 27]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 27, 5, 5, 25, 27]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007801", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('13') == 13\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13') == 13\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007802", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('bbbbbbbddddaaaa') == 'b7d4a4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbddddaaaa') == 'b7d4a4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007803", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 31, 'c': 86}) == {31: 'e', 86: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 31, 'c': 86}) == {31: 'e', 86: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007804", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('aeaceadeee') == 'aecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aeaceadeee') == 'aecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007805", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'e': 6, 'd': 5, 'a': 2, 'b': 1}, 6) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 6, 'd': 5, 'a': 2, 'b': 1}, 6) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007806", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Code Code', 14) == 'Qcrs Qcrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Code', 14) == 'Qcrs Qcrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007807", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[6, 9, 2], [6, 1, 2], [4, 9, 7]]) == [[6, 6, 4], [9, 1, 9], [2, 2, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 9, 2], [6, 1, 2], [4, 9, 7]]) == [[6, 6, 4], [9, 1, 9], [2, 2, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007808", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(403072) == 634\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(403072) == 634\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007809", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(14 - 16 - 5)') == -7\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(14 - 16 - 5)') == -7\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007810", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('30m29s') == 1829\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('30m29s') == 1829\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007811", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[6, -8], [-9, 3]], [[3, 2], [5, -4]]) == [[9, -6], [-4, -1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -8], [-9, 3]], [[3, 2], [5, -4]]) == [[9, -6], [-4, -1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007812", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('maejl') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('maejl') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007813", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sat sun sat! sun dog Ran The sun sat Sat') == {'sat': 4, 'sun': 3, 'dog': 1, 'ran': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun sat! sun dog Ran The sun sat Sat') == {'sat': 4, 'sun': 3, 'dog': 1, 'ran': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007814", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([22, 28, 23, 12, 16, 16, 34]) == [12, 16, 16, 22, 23, 28, 34]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 28, 23, 12, 16, 16, 34]) == [12, 16, 16, 22, 23, 28, 34]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007815", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-6, -9, -5], [-1, 5, 8], [-9, 0, -6]], [[4, -9, 1], [3, 2, 3], [-5, 0, -5]]) == [[-2, -18, -4], [2, 7, 11], [-14, 0, -11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, -9, -5], [-1, 5, 8], [-9, 0, -6]], [[4, -9, 1], [3, 2, 3], [-5, 0, -5]]) == [[-2, -18, -4], [2, 7, 11], [-14, 0, -11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007816", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[0, -9, 5], [8, 7, 6], [-9, -6, 9]], [[0, 9, -7], [-5, -6, 1], [5, -4, 9]]) == [[0, 0, -2], [3, 1, 7], [-4, -10, 18]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[0, -9, 5], [8, 7, 6], [-9, -6, 9]], [[0, 9, -7], [-5, -6, 1], [5, -4, 9]]) == [[0, 0, -2], [3, 1, 7], [-4, -10, 18]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007817", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(12); s.push(17); s.push(10)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(12); s.push(17); s.push(10)\nassert s.peek() == 10\nassert s.pop() == 10\nassert s.pop() == 17\nassert s.is_empty() == False\nassert s.pop() == 12\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007818", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('cazd') == 'dzac'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('cazd') == 'dzac'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007819", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([47, 39, 4, 40, 27, 0, 15, 45, 20, 40, 13]) == [0, 4, 13, 15, 20, 27, 39, 40, 40, 45, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([47, 39, 4, 40, 27, 0, 15, 45, 20, 40, 13]) == [0, 4, 13, 15, 20, 27, 39, 40, 40, 45, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007820", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[3, 5, 1], [4, 1, 7], [5, 1], 2, [7, 7]]) == [3, 5, 1, 4, 1, 7, 5, 1, 2, 7, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 5, 1], [4, 1, 7], [5, 1], 2, [7, 7]]) == [3, 5, 1, 4, 1, 7, 5, 1, 2, 7, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007821", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 0, 4, 9, 9], [8, 4, 0, 7, 8]) == [0, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 0, 4, 9, 9], [8, 4, 0, 7, 8]) == [0, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007822", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(51) == 24\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(51) == 24\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007823", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'e', 'b', 'c', 'd', 'c']) == {'d': 2, 'e': 1, 'b': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'b', 'c', 'd', 'c']) == {'d': 2, 'e': 1, 'b': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007824", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(7312) == 2137\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7312) == 2137\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007825", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('\",a\",a,eeb') == [',a', 'a', 'eeb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\",a\",a,eeb') == [',a', 'a', 'eeb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007826", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([6, 0, 9, 5, 5, 2, 0, 2], 2) == [0, 2, 6, 0, 9, 5, 5, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 0, 9, 5, 5, 2, 0, 2], 2) == [0, 2, 6, 0, 9, 5, 5, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007827", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([25, -35, 29, 29, -13]) == 29\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([25, -35, 29, 29, -13]) == 29\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007828", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMCCLXXXVIII') == 2288\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMCCLXXXVIII') == 2288\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007829", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[5, 2], [0, 4]], [[5, 4], [2, 1]]) == [[29, 22], [8, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 2], [0, 4]], [[5, 4], [2, 1]]) == [[29, 22], [8, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007830", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(4584) == 67\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4584) == 67\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007831", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 4, 6, 7, 7, 4], [4, 7, 1, 1]) == [1, 4, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 4, 6, 7, 7, 4], [4, 7, 1, 1]) == [1, 4, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007832", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-6, -16, 17]) == -5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, -16, 17]) == -5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007833", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([4, 45, 21, 19, 50]) == [4, 19, 21, 45, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([4, 45, 21, 19, 50]) == [4, 19, 21, 45, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007834", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bbbbcccccccccccccbbbbbbbb') == 'b4c13b8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbcccccccccccccbbbbbbbb') == 'b4c13b8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007835", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('eae') == 'eae'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('eae') == 'eae'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007836", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('bbad') == 'bad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbad') == 'bad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007837", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(7996) == 31\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7996) == 31\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007838", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['b', 'a', 'd', 'b', 'e', 'b', 'c']) == {'b': 3, 'a': 1, 'd': 1, 'e': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'a', 'd', 'b', 'e', 'b', 'c']) == {'b': 3, 'a': 1, 'd': 1, 'e': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007839", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('ran the dog. Sat cat sun. sun ran sun') == {'ran': 2, 'the': 1, 'dog': 1, 'sat': 1, 'cat': 1, 'sun': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran the dog. Sat cat sun. sun ran sun') == {'ran': 2, 'the': 1, 'dog': 1, 'sat': 1, 'cat': 1, 'sun': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007840", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([46, 0, 40]) == [0, 40, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 0, 40]) == [0, 40, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_007841", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(667) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(667) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007842", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('bbaabbaabbabbba', 'ab') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaabbaabbabbba', 'ab') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007843", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[3, 8, 9, 6], [1, 0, 9]]) == [3, 8, 9, 6, 1, 0, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 8, 9, 6], [1, 0, 9]]) == [3, 8, 9, 6, 1, 0, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007844", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaabcc', 'cbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaabcc', 'cbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007845", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([50, -10, 18, 12, -1, -1, 19]) == 50\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([50, -10, 18, 12, -1, -1, 19]) == 50\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007846", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([5, 18, 6]) == [5, 6, 18]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([5, 18, 6]) == [5, 6, 18]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007847", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 3}, {'y': 9}) == {'w': 3, 'y': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 3}, {'y': 9}) == {'w': 3, 'y': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007848", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(371) == 45\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(371) == 45\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007849", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([6, 8, 5, 4], [5, 9, 4]) == [5, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 8, 5, 4], [5, 9, 4]) == [5, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007850", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(411825) == 641\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(411825) == 641\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007851", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aaaaecbebcedce') == 'aecbd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aaaaecbebcedce') == 'aecbd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007852", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(761586) == 872\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(761586) == 872\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007853", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([19, 7, 39, 6, 33]) == [6, 7, 19, 33, 39]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([19, 7, 39, 6, 33]) == [6, 7, 19, 33, 39]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007854", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([18, 22, 11]) == [11, 18, 22]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 22, 11]) == [11, 18, 22]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007855", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([4, 7, 2, 5, 4, 9, 6, 1], 5) == [[4, 7, 2, 5, 4], [9, 6, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 7, 2, 5, 4, 9, 6, 1], 5) == [[4, 7, 2, 5, 4], [9, 6, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007856", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([3, 3, 5, 4], 2) == [[3, 3], [5, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 3, 5, 4], 2) == [[3, 3], [5, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007857", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([3, 2, 6], 1) == [6, 3, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 2, 6], 1) == [6, 3, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007858", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=off; port=auto') == {'host': 'off', 'port': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=off; port=auto') == {'host': 'off', 'port': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007859", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=on; path=974') == {'mode': 'on', 'path': '974'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; path=974') == {'mode': 'on', 'path': '974'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007860", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(8, 2) == 64\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 2) == 64\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007861", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([0, 1, 8, 1], 4) == [[0, 1, 8, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 1, 8, 1], 4) == [[0, 1, 8, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007862", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[3, 1, 0], [4, 3, 3]], [[3, 5, 4], [0, 1, 3], [1, 5, 5]]) == [[9, 16, 15], [15, 38, 40]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1, 0], [4, 3, 3]], [[3, 5, 4], [0, 1, 3], [1, 5, 5]]) == [[9, 16, 15], [15, 38, 40]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007863", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(50); s.push(95); s.push(9)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(50); s.push(95); s.push(9)\nassert s.peek() == 9\nassert s.pop() == 9\nassert s.pop() == 95\nassert s.is_empty() == False\nassert s.pop() == 50\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007864", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 5, 7, 2], 4) == [[8, 5, 7, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 5, 7, 2], 4) == [[8, 5, 7, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007865", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([3, 0, 5, 4, 0]) == [3, 0, 5, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 0, 5, 4, 0]) == [3, 0, 5, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007866", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('ran ran ran Dog sat ran cat Dog cat') == {'ran': 4, 'dog': 2, 'sat': 1, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran ran ran Dog sat ran cat Dog cat') == {'ran': 4, 'dog': 2, 'sat': 1, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007867", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([2, 9, 35, 44, 43, 39]) == [2, 9, 35, 39, 43, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 9, 35, 44, 43, 39]) == [2, 9, 35, 39, 43, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007868", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('fd fbe eeceaaeh ecdba adba deacb') == 'eeceaaeh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fd fbe eeceaaeh ecdba adba deacb') == 'eeceaaeh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007869", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([3, 4, 0, 3, 0], 4) == [4, 0, 3, 0, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 4, 0, 3, 0], 4) == [4, 0, 3, 0, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007870", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(1343) == 36\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1343) == 36\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007871", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(35, 20) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 20) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007872", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'c': 61, 'e': 19, 'd': 31, 'a': 26, 'f': 27}) == {61: 'c', 19: 'e', 31: 'd', 26: 'a', 27: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 61, 'e': 19, 'd': 31, 'a': 26, 'f': 27}) == {61: 'c', 19: 'e', 31: 'd', 26: 'a', 27: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007873", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([3], [0, 2, 9]) == [0, 2, 3, 9]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3], [0, 2, 9]) == [0, 2, 3, 9]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007874", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('32m56s') == 1976\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('32m56s') == 1976\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007875", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(98)\nacc.deposit(10)\nacc.withdraw(108)\nacc.withdraw(130)\nassert acc.get_balance() == 108\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(98)\nacc.deposit(10)\nassert acc.get_balance() == 108\nacc.withdraw(108)\nassert acc.get_balance() == 0\nacc.withdraw(130)\nassert acc.get_balance() == 0\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007876", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(6, 48) == 6\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(6, 48) == 6\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007877", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([45, 46, 34, 3, 7, 39]) == [3, 7, 34, 39, 45, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([45, 46, 34, 3, 7, 39]) == [3, 7, 34, 39, 45, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007878", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('adbc,d,bb,da,d') == ['adbc', 'd', 'bb', 'da', 'd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('adbc,d,bb,da,d') == ['adbc', 'd', 'bb', 'da', 'd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007879", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([23, 19, 50, 6]) == [6, 19, 23, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 19, 50, 6]) == [6, 19, 23, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007880", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('uwtmavdwxba') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('uwtmavdwxba') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007881", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 8}, {'w': 3}) == {'y': 8, 'w': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 8}, {'w': 3}) == {'y': 8, 'w': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007882", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([9, 28, 24, 24, 15]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 28, 24, 24, 15]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007883", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([0, 1, 7, 1, 8], [7, 2, 0, 6]) == [0, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 1, 7, 1, 8], [7, 2, 0, 6]) == [0, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007884", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([15, 3, 17, 5, -8]) == 32\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([15, 3, 17, 5, -8]) == 32\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007885", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ccf', 'ccfe') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ccf', 'ccfe') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007886", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[7, 1], [2, 7], 1]) == [7, 1, 2, 7, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7, 1], [2, 7], 1]) == [7, 1, 2, 7, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007887", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Hello Python', 6) == 'Nkrru Veznut'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Python', 6) == 'Nkrru Veznut'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007888", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 72, 'a': 87, 'd': 30, 'e': 4}) == {72: 'f', 87: 'a', 30: 'd', 4: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 72, 'a': 87, 'd': 30, 'e': 4}) == {72: 'f', 87: 'a', 30: 'd', 4: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007889", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Code', 22) == 'Ykza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 22) == 'Ykza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007890", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(25, 60) == 5\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(25, 60) == 5\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007891", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=839; host=on; user=229') == {'mode': '839', 'host': 'on', 'user': '229'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=839; host=on; user=229') == {'mode': '839', 'host': 'on', 'user': '229'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007892", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(6688) == 81\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6688) == 81\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007893", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h59m29s') == 21569\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h59m29s') == 21569\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007894", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(16, 5) == 80\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 5) == 80\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007895", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 33, 'd': 0, 'c': 80, 'f': 28}) == {33: 'b', 0: 'd', 80: 'c', 28: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 33, 'd': 0, 'c': 80, 'f': 28}) == {33: 'b', 0: 'd', 80: 'c', 28: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007896", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([1, 1, [8, 1, 7], 8]) == [1, 1, 8, 1, 7, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, 1, [8, 1, 7], 8]) == [1, 1, 8, 1, 7, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007897", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'c', 'c', 'd', 'c', 'a']) == {'e': 1, 'c': 3, 'd': 1, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'c', 'c', 'd', 'c', 'a']) == {'e': 1, 'c': 3, 'd': 1, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007898", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('19') == 19\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19') == 19\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007899", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(29, 170, 951) == 85\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(29, 170, 951) == 85\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007900", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 4, 5, 6, 17, 18, 19], [0, 5, 9, 10, 18]) == [0, 0, 4, 5, 5, 6, 9, 10, 17, 18, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 4, 5, 6, 17, 18, 19], [0, 5, 9, 10, 18]) == [0, 0, 4, 5, 5, 6, 9, 10, 17, 18, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007901", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=566; mode=420; user=off; host=on') == {'port': '566', 'mode': '420', 'user': 'off', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=566; mode=420; user=off; host=on') == {'port': '566', 'mode': '420', 'user': 'off', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007902", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([28, 1, 7, 20, 25, 44]) == [1, 7, 20, 25, 28, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([28, 1, 7, 20, 25, 44]) == [1, 7, 20, 25, 28, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007903", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(914140) == 956\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(914140) == 956\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007904", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([29, 46, 65, 68, 83, 85], 161) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([29, 46, 65, 68, 83, 85], 161) == -1\nassert binary_search([29, 46, 65, 68, 83, 85], 29) == 0\nassert binary_search([29, 46, 65, 68, 83, 85], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007905", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['c', 'c', 'c', 'e', 'c', 'e', 'd', 'd', 'e', 'e']) == {'c': 4, 'e': 4, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'c', 'c', 'e', 'c', 'e', 'd', 'd', 'e', 'e']) == {'c': 4, 'e': 4, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007906", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([9, 3]) == [9, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([9, 3]) == [9, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007907", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(5, 13) == 65\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 13) == 65\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007908", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 33, 'c': 7, 'a': 11, 'd': 86}) == {33: 'b', 7: 'c', 11: 'a', 86: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 33, 'c': 7, 'a': 11, 'd': 86}) == {33: 'b', 7: 'c', 11: 'a', 86: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007909", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('((12 + 4) + (7 + 1))') == 24\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((12 + 4) + (7 + 1))') == 24\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007910", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('\"a,b\",87') == ['a,b', '87']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"a,b\",87') == ['a,b', '87']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007911", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h25m5s') == 15905\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h25m5s') == 15905\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007912", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(9, 9) == 387420489\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 9) == 387420489\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007913", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([17, 27, 47, 67, 92], 47) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 27, 47, 67, 92], 47) == 2\nassert binary_search([17, 27, 47, 67, 92], 17) == 0\nassert binary_search([17, 27, 47, 67, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007914", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 39, 'f': 95, 'e': 30, 'a': 6, 'd': 96}) == {39: 'b', 95: 'f', 30: 'e', 6: 'a', 96: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 39, 'f': 95, 'e': 30, 'a': 6, 'd': 96}) == {39: 'b', 95: 'f', 30: 'e', 6: 'a', 96: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007915", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=auto; user=off; host=239') == {'port': 'auto', 'user': 'off', 'host': '239'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=auto; user=off; host=239') == {'port': 'auto', 'user': 'off', 'host': '239'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007916", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([47, 14, 45]) == [14, 45, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([47, 14, 45]) == [14, 45, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_007917", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(994) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(994) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007918", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(158) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(158) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007919", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('53m1s') == 3181\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('53m1s') == 3181\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007920", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbbbbbbccccccccaaaaaaaa') == 'b9c8a8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbccccccccaaaaaaaa') == 'b9c8a8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007921", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('36,67,bb') == ['36', '67', 'bb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('36,67,bb') == ['36', '67', 'bb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007922", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 2, 2, 4]) == [3, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 2, 2, 4]) == [3, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007923", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h48m24s') == 13704\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h48m24s') == 13704\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007924", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([6, 8, 1, 8, 8, 8, 6, 7, 9, 9, 3, 6, 0], 4) == [[6, 8, 1, 8], [8, 8, 6, 7], [9, 9, 3, 6], [0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 8, 1, 8, 8, 8, 6, 7, 9, 9, 3, 6, 0], 4) == [[6, 8, 1, 8], [8, 8, 6, 7], [9, 9, 3, 6], [0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007925", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[0, 5, 7], [1], 6, 0, [7, 8]]) == [0, 5, 7, 1, 6, 0, 7, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 5, 7], [1], 6, 0, [7, 8]]) == [0, 5, 7, 1, 6, 0, 7, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007926", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(36, 16) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(36, 16) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007927", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 2, 5, 0, 5, 0], 5) == [2, 5, 0, 5, 0, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 2, 5, 0, 5, 0], 5) == [2, 5, 0, 5, 0, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007928", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([1, 12, 13, 22, 40, 48, 50, 57, 58, 96], 1) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 12, 13, 22, 40, 48, 50, 57, 58, 96], 1) == 0\nassert binary_search([1, 12, 13, 22, 40, 48, 50, 57, 58, 96], 1) == 0\nassert binary_search([1, 12, 13, 22, 40, 48, 50, 57, 58, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007929", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['banana', 'apple', 'avocado', 'cherry', 'date', 'coconut']) == {'b': ['banana'], 'a': ['apple', 'avocado'], 'c': ['cherry', 'coconut'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'avocado', 'cherry', 'date', 'coconut']) == {'b': ['banana'], 'a': ['apple', 'avocado'], 'c': ['cherry', 'coconut'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007930", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('abbbcbbca', 'cc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbcbbca', 'cc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007931", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('qihdkimf') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('qihdkimf') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007932", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=530; user=383; path=off') == {'mode': '530', 'user': '383', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=530; user=383; path=off') == {'mode': '530', 'user': '383', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007933", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([-1, 0, 9, -4]) == [-1, -1, 8, 4]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-1, 0, 9, -4]) == [-1, -1, 8, 4]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007934", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(208) == 'CCVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(208) == 'CCVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007935", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([4, [4, 5], 0]) == [4, 4, 5, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [4, 5], 0]) == [4, 4, 5, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007936", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 5, 3], [1, 1, 4], [5, 4, 4]], [[2, 5], [1, 2], [4, 4]]) == [[19, 27], [19, 23], [30, 49]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5, 3], [1, 1, 4], [5, 4, 4]], [[2, 5], [1, 2], [4, 4]]) == [[19, 27], [19, 23], [30, 49]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007937", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['azyx', 'a', 'axz']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['azyx', 'a', 'axz']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007938", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'd', 'b', 'e', 'a', 'c', 'b', 'd', 'b', 'd']) == {'a': 2, 'd': 3, 'b': 3, 'e': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'b', 'e', 'a', 'c', 'b', 'd', 'b', 'd']) == {'a': 2, 'd': 3, 'b': 3, 'e': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007939", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([29, 8, 7, 4]) == [4, 7, 8, 29]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([29, 8, 7, 4]) == [4, 7, 8, 29]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007940", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'date', 'berry', 'cherry', 'date', 'date', 'banana']) == {'b': ['berry', 'berry', 'banana'], 'd': ['date', 'date', 'date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'date', 'berry', 'cherry', 'date', 'date', 'banana']) == {'b': ['berry', 'berry', 'banana'], 'd': ['date', 'date', 'date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007941", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([5, 2, 27, 20, 47]) == [2, 5, 20, 27, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([5, 2, 27, 20, 47]) == [2, 5, 20, 27, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007942", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('dbbbba', 'dbbbbaa') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dbbbba', 'dbbbbaa') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007943", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(423)\nacc.deposit(65)\nacc.withdraw(486)\nacc.withdraw(583)\nassert acc.get_balance() == 488\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(423)\nacc.deposit(65)\nassert acc.get_balance() == 488\nacc.withdraw(486)\nassert acc.get_balance() == 2\nacc.withdraw(583)\nassert acc.get_balance() == 2\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007944", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'e', 'a', 'b', 'd']) == {'e': 2, 'a': 1, 'b': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'a', 'b', 'd']) == {'e': 2, 'a': 1, 'b': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007945", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(']a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007946", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['cccxy', 'cccz']) == 'ccc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cccxy', 'cccz']) == 'ccc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007947", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([-1, -7, -2, -9, -8]) == [-1, -8, -10, -19, -27]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-1, -7, -2, -9, -8]) == [-1, -8, -10, -19, -27]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007948", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(79); s.push(32); s.push(7)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(79); s.push(32); s.push(7)\nassert s.peek() == 7\nassert s.pop() == 7\nassert s.pop() == 32\nassert s.is_empty() == False\nassert s.pop() == 79\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007949", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([3, 19, -10, -1]) == 11\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([3, 19, -10, -1]) == 11\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007950", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[4, 8], [4, 0], [2, 8]]) == [[4, 4, 2], [8, 0, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 8], [4, 0], [2, 8]]) == [[4, 4, 2], [8, 0, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007951", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(195, 51) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(195, 51) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007952", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(7, 5) == 35\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(7, 5) == 35\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007953", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('dog sat dog sun dog') == {'dog': 3, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat dog sun dog') == {'dog': 3, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007954", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('the the sun, dog the ran Dog sat') == {'the': 3, 'sun': 1, 'dog': 2, 'ran': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the sun, dog the ran Dog sat') == {'the': 3, 'sun': 1, 'dog': 2, 'ran': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007955", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(33); s.push(2); s.push(26)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(33); s.push(2); s.push(26)\nassert s.peek() == 26\nassert s.pop() == 26\nassert s.pop() == 2\nassert s.is_empty() == False\nassert s.pop() == 33\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007956", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'cherry', 'date', 'date']) == {'c': ['cherry', 'cherry'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'cherry', 'date', 'date']) == {'c': ['cherry', 'cherry'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007957", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['cbay', 'cba']) == 'cba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cbay', 'cba']) == 'cba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007958", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(52) == [2, 2, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(52) == [2, 2, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007959", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([0, 7, 1, 2, 0, 9, 1], 5) == [[0, 7, 1, 2, 0], [9, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 7, 1, 2, 0, 9, 1], 5) == [[0, 7, 1, 2, 0], [9, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007960", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('eyffce') == 'ecffye'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('eyffce') == 'ecffye'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007961", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(4, 191, 383) == 1\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(4, 191, 383) == 1\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007962", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([3, 7, 4, 7, 6, 9], 4) == [4, 7, 6, 9, 3, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 7, 4, 7, 6, 9], 4) == [4, 7, 6, 9, 3, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007963", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([4, [9, 4, 3], 4]) == [4, 9, 4, 3, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [9, 4, 3], 4]) == [4, 9, 4, 3, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007964", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('ddddbbbbd') == 'd4b4d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddbbbbd') == 'd4b4d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007965", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-32, -14, -31, 0, 19, -47, -50, -11, -17]) == 19\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-32, -14, -31, 0, 19, -47, -50, -11, -17]) == 19\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007966", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([9, 1, 29, 45, 31, 4, 9, 34]) == [1, 4, 9, 9, 29, 31, 34, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([9, 1, 29, 45, 31, 4, 9, 34]) == [1, 4, 9, 9, 29, 31, 34, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007967", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('d,98,bbbba,\",b,a\",45') == ['d', '98', 'bbbba', ',b,a', '45']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,98,bbbba,\",b,a\",45') == ['d', '98', 'bbbba', ',b,a', '45']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007968", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[{}]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{}]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007969", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-4, 6], [4, -4]], [[-6, -3], [2, 2]]) == [[-10, 3], [6, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, 6], [4, -4]], [[-6, -3], [2, 2]]) == [[-10, 3], [6, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007970", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([2, 4, 4, 7, 3, 0, 0], [1, 1, 1, 8, 4, 7, 7, 2]) == [2, 4, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 4, 4, 7, 3, 0, 0], [1, 1, 1, 8, 4, 7, 7, 2]) == [2, 4, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007971", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('bca,61,27,\",aabb\",19') == ['bca', '61', '27', ',aabb', '19']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bca,61,27,\",aabb\",19') == ['bca', '61', '27', ',aabb', '19']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007972", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([43, 47, 41]) == [41, 43, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([43, 47, 41]) == [41, 43, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007973", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'banana', 'cherry']) == {'a': ['avocado'], 'c': ['cherry', 'cherry'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'banana', 'cherry']) == {'a': ['avocado'], 'c': ['cherry', 'cherry'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007974", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 40, 'a': 79, 'b': 11, 'd': 95, 'c': 35}) == {40: 'f', 79: 'a', 11: 'b', 95: 'd', 35: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 40, 'a': 79, 'b': 11, 'd': 95, 'c': 35}) == {40: 'f', 79: 'a', 11: 'b', 95: 'd', 35: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007975", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'d': 63, 'a': 75, 'c': 35}) == {63: 'd', 75: 'a', 35: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 63, 'a': 75, 'c': 35}) == {63: 'd', 75: 'a', 35: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007976", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-41, 10, -10, 5, -8, 20, -7, -45]) == 20\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-41, 10, -10, 5, -8, 20, -7, -45]) == 20\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007977", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([18, 23, 1, 1, 27, 48]) == [1, 1, 18, 23, 27, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 23, 1, 1, 27, 48]) == [1, 1, 18, 23, 27, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007978", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 5, 3, 4, 4, 4, 2]) == [5, 3, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 3, 4, 4, 4, 2]) == [5, 3, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007979", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(17, 55, 3) == 2\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(17, 55, 3) == 2\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007980", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(28, 12, 880) == 256\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(28, 12, 880) == 256\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007981", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(52) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(52) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_007982", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(34); s.push(54); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(34); s.push(54); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 54\nassert s.is_empty() == False\nassert s.pop() == 34\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007983", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 9, 'x': 9}, {'w': 7, 'x': 7, 'z': 9}) == {'y': 9, 'x': 16, 'w': 7, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9, 'x': 9}, {'w': 7, 'x': 7, 'z': 9}) == {'y': 9, 'x': 16, 'w': 7, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007984", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(83) == 'LXXXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(83) == 'LXXXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007985", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[9, 7, 9], 0]) == [9, 7, 9, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 7, 9], 0]) == [9, 7, 9, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007986", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[1, 6, 3, 5], [4, 6, 6, 7], [1, 0, 0, 3], [6, 9, 5, 0]]) == [[1, 4, 1, 6], [6, 6, 0, 9], [3, 6, 0, 5], [5, 7, 3, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 6, 3, 5], [4, 6, 6, 7], [1, 0, 0, 3], [6, 9, 5, 0]]) == [[1, 4, 1, 6], [6, 6, 0, 9], [3, 6, 0, 5], [5, 7, 3, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007987", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(47, 77, 664) == 159\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(47, 77, 664) == 159\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007988", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'d': 1, 'c': 2, 'e': 0, 'b': 3}, 5) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 1, 'c': 2, 'e': 0, 'b': 3}, 5) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007989", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(18); s.push(19); s.push(82)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(18); s.push(19); s.push(82)\nassert s.peek() == 82\nassert s.pop() == 82\nassert s.pop() == 19\nassert s.is_empty() == False\nassert s.pop() == 18\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007990", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-20, 2, -17, -9, 20]) == -24\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-20, 2, -17, -9, 20]) == -24\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007991", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('abc', 16) == 'qrs'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 16) == 'qrs'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_007992", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(27); s.push(80); s.push(8)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(27); s.push(80); s.push(8)\nassert s.peek() == 8\nassert s.pop() == 8\nassert s.pop() == 80\nassert s.is_empty() == False\nassert s.pop() == 27\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007993", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([27, 15, 4, 10, 20, 27, 21]) == [4, 10, 15, 20, 21, 27, 27]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 15, 4, 10, 20, 27, 21]) == [4, 10, 15, 20, 21, 27, 27]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007994", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([1, 0, 8, 8, 1, 2, 3], 3) == [[1, 0, 8], [8, 1, 2], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 0, 8, 8, 1, 2, 3], 3) == [[1, 0, 8], [8, 1, 2], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_007995", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([0, 8, 3, 9, 9, 6, 8, 8, 6], 3) == [[0, 8, 3], [9, 9, 6], [8, 8, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 8, 3, 9, 9, 6, 8, 8, 6], 3) == [[0, 8, 3], [9, 9, 6], [8, 8, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007996", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(374) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(374) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_007997", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 2, 4, 2, 4, 2, 2, 0]) == [2, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 4, 2, 4, 2, 2, 0]) == [2, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_007998", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(118) == [2, 59]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(118) == [2, 59]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_007999", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([3, 26, 34, 11, 22, 4, 10, 1]) == [1, 3, 4, 10, 11, 22, 26, 34]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([3, 26, 34, 11, 22, 4, 10, 1]) == [1, 3, 4, 10, 11, 22, 26, 34]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008000", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 6, 4, 4, 0, 8, 7, 9], 10) == [7, 9, 0, 6, 4, 4, 0, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 6, 4, 4, 0, 8, 7, 9], 10) == [7, 9, 0, 6, 4, 4, 0, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008001", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun sun ran dog Ran the cat. dog, cat. the.') == {'sun': 2, 'ran': 2, 'dog': 2, 'the': 2, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun ran dog Ran the cat. dog, cat. the.') == {'sun': 2, 'ran': 2, 'dog': 2, 'the': 2, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008002", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([14, 3, 18, 31, 23, 20, 32, 34, 34]) == [3, 14, 18, 20, 23, 31, 32, 34, 34]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 3, 18, 31, 23, 20, 32, 34, 34]) == [3, 14, 18, 20, 23, 31, 32, 34, 34]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008003", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([17, 41, 6, 11, 39, 30]) == [6, 11, 17, 30, 39, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([17, 41, 6, 11, 39, 30]) == [6, 11, 17, 30, 39, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008004", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'e': 8, 'd': 4, 'c': 2}, 3) == {'e': 8, 'd': 4}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 8, 'd': 4, 'c': 2}, 3) == {'e': 8, 'd': 4}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008005", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 4, 3, 3, 1, 6, 0, 2, 0], 5) == [[2, 4, 3, 3, 1], [6, 0, 2, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 4, 3, 3, 1, 6, 0, 2, 0], 5) == [[2, 4, 3, 3, 1], [6, 0, 2, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008006", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 20) == 'rst'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 20) == 'rst'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008007", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('XXIV') == 24\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XXIV') == 24\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008008", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-4, -2, 9, 7], [2, 6, -2, 8]], [[8, -9, -1, -7], [-1, 9, 4, 2]]) == [[4, -11, 8, 0], [1, 15, 2, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-4, -2, 9, 7], [2, 6, -2, 8]], [[8, -9, -1, -7], [-1, 9, 4, 2]]) == [[4, -11, 8, 0], [1, 15, 2, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008009", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('5h14m42s') == 18882\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h14m42s') == 18882\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008010", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([10, 20, 39, 9, 20, 27, 45, 6, 49, 47, 42, 19]) == [6, 9, 10, 19, 20, 20, 27, 39, 42, 45, 47, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([10, 20, 39, 9, 20, 27, 45, 6, 49, 47, 42, 19]) == [6, 9, 10, 19, 20, 20, 27, 39, 42, 45, 47, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008011", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('DC') == 600\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('DC') == 600\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008012", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([48, 42, -19, -4, -45, -40, 24, 2, 36]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([48, 42, -19, -4, -45, -40, 24, 2, 36]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008013", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bacacaacbabbaccc', 'bbac') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bacacaacbabbaccc', 'bbac') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008014", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('adzfdzyba') == 'abyzdfzda'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('adzfdzyba') == 'abyzdfzda'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008015", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(13 - 18) - 17') == -22\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(13 - 18) - 17') == -22\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008016", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([6, 9, 2, 9, 2, 7], [7, 6, 4, 9, 7, 8]) == [6, 9, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 2, 9, 2, 7], [7, 6, 4, 9, 7, 8]) == [6, 9, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008017", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([37, 28, 14]) == [14, 28, 37]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([37, 28, 14]) == [14, 28, 37]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008018", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([17, 3, 31]) == [3, 17, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([17, 3, 31]) == [3, 17, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008019", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat dog sat! sat. sat the. sat! Dog cat.') == {'sat': 5, 'dog': 2, 'the': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat dog sat! sat. sat the. sat! Dog cat.') == {'sat': 5, 'dog': 2, 'the': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008020", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ddedff', 'ddfdfe') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ddedff', 'ddfdfe') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008021", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(24, 9) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(24, 9) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008022", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([20, 16, 9, 13, 26, 27, 20]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 16, 9, 13, 26, 27, 20]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008023", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([2, 27, 30, 37, 63, 85, 86], 86) == 6\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 27, 30, 37, 63, 85, 86], 86) == 6\nassert binary_search([2, 27, 30, 37, 63, 85, 86], 2) == 0\nassert binary_search([2, 27, 30, 37, 63, 85, 86], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008024", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('npoqdvgm') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('npoqdvgm') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008025", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['berry', 'cherry', 'berry', 'date']) == {'b': ['berry', 'berry'], 'c': ['cherry'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'cherry', 'berry', 'date']) == {'b': ['berry', 'berry'], 'c': ['cherry'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008026", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(22, 58, 72) == 40\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(22, 58, 72) == 40\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008027", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(418)\nacc.deposit(194)\nacc.withdraw(112)\nacc.withdraw(784)\nassert acc.get_balance() == 612\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(418)\nacc.deposit(194)\nassert acc.get_balance() == 612\nacc.withdraw(112)\nassert acc.get_balance() == 500\nacc.withdraw(784)\nassert acc.get_balance() == 500\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008028", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Hello Code', 25) == 'Gdkkn Bncd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Code', 25) == 'Gdkkn Bncd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008029", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('Cat The Sun cat ran, dog! the') == {'cat': 2, 'the': 2, 'sun': 1, 'ran': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat The Sun cat ran, dog! the') == {'cat': 2, 'the': 2, 'sun': 1, 'ran': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008030", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CMLXI') == 961\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CMLXI') == 961\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008031", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(91); s.push(70); s.push(22)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(91); s.push(70); s.push(22)\nassert s.peek() == 22\nassert s.pop() == 22\nassert s.pop() == 70\nassert s.is_empty() == False\nassert s.pop() == 91\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008032", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'cherry', 'berry']) == {'d': ['date'], 'c': ['cherry'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'berry']) == {'d': ['date'], 'c': ['cherry'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008033", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([8, 17, 24, 27, 18, 25, 15, 25]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 17, 24, 27, 18, 25, 15, 25]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008034", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(15, 5) == 15\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(15, 5) == 15\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008035", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('57m31s') == 3451\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('57m31s') == 3451\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008036", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(3617) == 17\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3617) == 17\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008037", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[9, 2, 5]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 2, 5]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008038", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('ran. sat cat dog, sat sun') == {'ran': 1, 'sat': 2, 'cat': 1, 'dog': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran. sat cat dog, sat sun') == {'ran': 1, 'sat': 2, 'cat': 1, 'dog': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008039", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran dog dog the sat sat Ran Cat') == {'ran': 2, 'dog': 2, 'the': 1, 'sat': 2, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog dog the sat sat Ran Cat') == {'ran': 2, 'dog': 2, 'the': 1, 'sat': 2, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008040", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([7, 14, 20, 26, 26, 19, 20, 0, 10, 25]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 14, 20, 26, 26, 19, 20, 0, 10, 25]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008041", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=710; path=641; user=229') == {'port': '710', 'path': '641', 'user': '229'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=710; path=641; user=229') == {'port': '710', 'path': '641', 'user': '229'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008042", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(22, 14) == 154\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 14) == 154\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008043", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'apple', 'date', 'cherry', 'avocado']) == {'a': ['avocado', 'apple', 'avocado'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'apple', 'date', 'cherry', 'avocado']) == {'a': ['avocado', 'apple', 'avocado'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008044", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(32, 7) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(32, 7) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008045", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('aa{(b)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('aa{(b)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008046", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'x': 9, 'y': 1, 'z': 7}) == {'y': 7, 'x': 9, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'x': 9, 'y': 1, 'z': 7}) == {'y': 7, 'x': 9, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008047", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([5, 6, 4, 7, 3, 4, 9, 1, 2, 6], 2) == [2, 6, 5, 6, 4, 7, 3, 4, 9, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 6, 4, 7, 3, 4, 9, 1, 2, 6], 2) == [2, 6, 5, 6, 4, 7, 3, 4, 9, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008048", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(3) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(3) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008049", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('dbbacadabab') == 'dbac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbbacadabab') == 'dbac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008050", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens(']}b') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']}b') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008051", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(3, 169, 433) == 22\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(3, 169, 433) == 22\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008052", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'e': 4, 'b': 3, 'c': 7}, 4) == {'c': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 4, 'b': 3, 'c': 7}, 4) == {'c': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008053", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([30, 6]) == 30\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([30, 6]) == 30\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008054", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('host=auto; port=auto; path=616; mode=auto') == {'host': 'auto', 'port': 'auto', 'path': '616', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; port=auto; path=616; mode=auto') == {'host': 'auto', 'port': 'auto', 'path': '616', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008055", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens(')a[(})') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')a[(})') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008056", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 44, 'f': 38, 'c': 82, 'a': 23}) == {44: 'd', 38: 'f', 82: 'c', 23: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 44, 'f': 38, 'c': 82, 'a': 23}) == {44: 'd', 38: 'f', 82: 'c', 23: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008057", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[0, 5], [7, 4, 6, 2], [9, 9, 0, 1], 5, [1, 6, 5]]) == [0, 5, 7, 4, 6, 2, 9, 9, 0, 1, 5, 1, 6, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 5], [7, 4, 6, 2], [9, 9, 0, 1], 5, [1, 6, 5]]) == [0, 5, 7, 4, 6, 2, 9, 9, 0, 1, 5, 1, 6, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008058", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('16 * 14 * 17') == 3808\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('16 * 14 * 17') == 3808\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008059", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(90) == [2, 3, 3, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(90) == [2, 3, 3, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008060", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(1686) == 6861\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1686) == 6861\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008061", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('adbfyf') == 'fyfbda'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('adbfyf') == 'fyfbda'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008062", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('dog sat. sat Ran sun ran ran, The') == {'dog': 1, 'sat': 2, 'ran': 3, 'sun': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sat. sat Ran sun ran ran, The') == {'dog': 1, 'sat': 2, 'ran': 3, 'sun': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008063", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(38); s.push(69); s.push(56)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(38); s.push(69); s.push(56)\nassert s.peek() == 56\nassert s.pop() == 56\nassert s.pop() == 69\nassert s.is_empty() == False\nassert s.pop() == 38\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008064", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([41, 0, 48, 13, 11, 46]) == [0, 11, 13, 41, 46, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 0, 48, 13, 11, 46]) == [0, 11, 13, 41, 46, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008065", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([0, 4, 7, 13], [9, 18]) == [0, 4, 7, 9, 13, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 4, 7, 13], [9, 18]) == [0, 4, 7, 9, 13, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008066", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(83); s.push(50); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(50); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 50\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008067", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(16) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(16) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008068", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['aacx', 'aac', 'aacyxz', 'aacy']) == 'aac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['aacx', 'aac', 'aacyxz', 'aacy']) == 'aac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008069", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=on; mode=339; path=458') == {'host': 'on', 'mode': '339', 'path': '458'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=on; mode=339; path=458') == {'host': 'on', 'mode': '339', 'path': '458'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008070", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([8, [7], 5, [1]]) == [8, 7, 5, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [7], 5, [1]]) == [8, 7, 5, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008071", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCCLXV') == 365\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXV') == 365\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008072", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[2, 7, 5], [4, 2, 1]]) == [[2, 4], [7, 2], [5, 1]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 7, 5], [4, 2, 1]]) == [[2, 4], [7, 2], [5, 1]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008073", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([16, 38, 44, 35, 46]) == [16, 35, 38, 44, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([16, 38, 44, 35, 46]) == [16, 35, 38, 44, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008074", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['aaayx', 'aaaxz']) == 'aaa'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['aaayx', 'aaaxz']) == 'aaa'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008075", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(272) == 'CCLXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(272) == 'CCLXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008076", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([21, 9, 46, 43, 17]) == [9, 17, 21, 43, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([21, 9, 46, 43, 17]) == [9, 17, 21, 43, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008077", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(4, 9) == 262144\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(4, 9) == 262144\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008078", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([9, 11, 31, 32, 60, 70, 96], 179) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([9, 11, 31, 32, 60, 70, 96], 179) == -1\nassert binary_search([9, 11, 31, 32, 60, 70, 96], 9) == 0\nassert binary_search([9, 11, 31, 32, 60, 70, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008079", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('1h14m56s') == 4496\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h14m56s') == 4496\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008080", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([7, 9, 13, 19, 20, 20], [2, 15, 18]) == [2, 7, 9, 13, 15, 18, 19, 20, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7, 9, 13, 19, 20, 20], [2, 15, 18]) == [2, 7, 9, 13, 15, 18, 19, 20, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008081", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('aedb') == 'aedb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aedb') == 'aedb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008082", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 5, 'z': 5}, {'y': 2, 'z': 5, 'x': 5}) == {'y': 7, 'z': 10, 'x': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 5, 'z': 5}, {'y': 2, 'z': 5, 'x': 5}) == {'y': 7, 'z': 10, 'x': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008083", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([17, 11, 27]) == [11, 17, 27]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([17, 11, 27]) == [11, 17, 27]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008084", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('c,bab') == ['c', 'bab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('c,bab') == ['c', 'bab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008085", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(82); s.push(92); s.push(97)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(82); s.push(92); s.push(97)\nassert s.peek() == 97\nassert s.pop() == 97\nassert s.pop() == 92\nassert s.is_empty() == False\nassert s.pop() == 82\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008086", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dade') == 'dae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dade') == 'dae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008087", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(38, 11) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(38, 11) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008088", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[2, 2, 7], [7]], 8]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[2, 2, 7], [7]], 8]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008089", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ebdb') == 'ebd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebdb') == 'ebd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008090", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aabbccc') == 'a2b2c3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aabbccc') == 'a2b2c3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008091", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('dcbac') == 'Dcbac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('dcbac') == 'Dcbac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008092", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 6, 8], [0, 0, 3], [5, 4, 8]]) == [[7, 0, 5], [6, 0, 4], [8, 3, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 6, 8], [0, 0, 3], [5, 4, 8]]) == [[7, 0, 5], [6, 0, 4], [8, 3, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008093", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([16, 18, 25, 41, 50, 59, 68, 72, 90, 98], 125) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 18, 25, 41, 50, 59, 68, 72, 90, 98], 125) == -1\nassert binary_search([16, 18, 25, 41, 50, 59, 68, 72, 90, 98], 16) == 0\nassert binary_search([16, 18, 25, 41, 50, 59, 68, 72, 90, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008094", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([8, 28, 7, 23, 7, 8]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 28, 7, 23, 7, 8]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008095", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ccccb') == 'c4b1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccb') == 'c4b1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008096", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(19); s.push(1); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(19); s.push(1); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 1\nassert s.is_empty() == False\nassert s.pop() == 19\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008097", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([13, 15, 26, 47, 31, 21, 31, 22, 29, 46, 19, 14, 39, 22]) == [13, 14, 15, 19, 21, 22, 22, 26, 29, 31, 31, 39, 46, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([13, 15, 26, 47, 31, 21, 31, 22, 29, 46, 19, 14, 39, 22]) == [13, 14, 15, 19, 21, 22, 22, 26, 29, 31, 31, 39, 46, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008098", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[2, 4, 3], [3, 1, 4]], [[1, 4, 4], [4, 2, 1], [3, 2, 5]]) == [[27, 22, 27], [19, 22, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 4, 3], [3, 1, 4]], [[1, 4, 4], [4, 2, 1], [3, 2, 5]]) == [[27, 22, 27], [19, 22, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008099", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 3}, {'w': 1}) == {'x': 3, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3}, {'w': 1}) == {'x': 3, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008100", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('dzyx') == 'xyzd'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('dzyx') == 'xyzd'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008101", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([11, 42, 9, 49]) == [9, 11, 42, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 42, 9, 49]) == [9, 11, 42, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008102", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran sat ran! sun') == {'ran': 2, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat ran! sun') == {'ran': 2, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008103", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([22, 22, 13, 2, 27]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 22, 13, 2, 27]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008104", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCXLVI') == 246\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXLVI') == 246\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008105", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(165) == 111\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(165) == 111\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008106", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['zx', 'xzy', '', '']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zx', 'xzy', '', '']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008107", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=on; host=380') == {'path': 'on', 'host': '380'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; host=380') == {'path': 'on', 'host': '380'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008108", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CDVIII') == 408\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDVIII') == 408\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008109", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['baz', 'bax', 'bayyz', 'bayxx']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['baz', 'bax', 'bayyz', 'bayxx']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008110", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([13, -17, -16, 24, -24]) == 24\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([13, -17, -16, 24, -24]) == 24\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008111", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(17, 3) == 51\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 3) == 51\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008112", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([30, 26, 4, 42, 36, 2, 6, 27]) == [2, 4, 6, 26, 27, 30, 36, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 26, 4, 42, 36, 2, 6, 27]) == [2, 4, 6, 26, 27, 30, 36, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008113", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 1, 1, 3, 9, 9, 8, 0, 8, 6], 2) == [8, 6, 2, 1, 1, 3, 9, 9, 8, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 1, 1, 3, 9, 9, 8, 0, 8, 6], 2) == [8, 6, 2, 1, 1, 3, 9, 9, 8, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008114", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 0, 5, 5, 1, 2, 1, 2]) == [1, 0, 5, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 0, 5, 5, 1, 2, 1, 2]) == [1, 0, 5, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008115", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([12, 13, 18], [17]) == [12, 13, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([12, 13, 18], [17]) == [12, 13, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008116", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([3, 11, 28, 32, 42, 53, 58, 61, 67, 92], 182) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([3, 11, 28, 32, 42, 53, 58, 61, 67, 92], 182) == -1\nassert binary_search([3, 11, 28, 32, 42, 53, 58, 61, 67, 92], 3) == 0\nassert binary_search([3, 11, 28, 32, 42, 53, 58, 61, 67, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008117", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([5, -10, 3, 5, 17]) == 20\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([5, -10, 3, 5, 17]) == 20\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008118", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 1}, {'x': 6, 'z': 6, 'w': 5}) == {'y': 1, 'x': 6, 'z': 6, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1}, {'x': 6, 'z': 6, 'w': 5}) == {'y': 1, 'x': 6, 'z': 6, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008119", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('caaf', 'afac') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('caaf', 'afac') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008120", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(13 + 15 + (11 + 3))') == 42\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(13 + 15 + (11 + 3))') == 42\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008121", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('user=21; host=516') == {'user': '21', 'host': '516'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=21; host=516') == {'user': '21', 'host': '516'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008122", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('aeecb bbe e ccac') == 'Aeecb Bbe E Ccac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('aeecb bbe e ccac') == 'Aeecb Bbe E Ccac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008123", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=off; path=842; port=954; user=875') == {'mode': 'off', 'path': '842', 'port': '954', 'user': '875'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=off; path=842; port=954; user=875') == {'mode': 'off', 'path': '842', 'port': '954', 'user': '875'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008124", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat sun! Ran sat Cat') == {'sat': 2, 'sun': 1, 'ran': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun! Ran sat Cat') == {'sat': 2, 'sun': 1, 'ran': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008125", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(4799) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4799) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008126", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 1, 5], [4, 3, 4], [0, 5, 2]], [[2, 3, 2], [5, 0, 1], [2, 5, 1]]) == [[17, 28, 8], [31, 32, 15], [29, 10, 7]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 5], [4, 3, 4], [0, 5, 2]], [[2, 3, 2], [5, 0, 1], [2, 5, 1]]) == [[17, 28, 8], [31, 32, 15], [29, 10, 7]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008127", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bbaaabbbbb') == 'b2a3b5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbaaabbbbb') == 'b2a3b5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008128", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[5], 5]) == 10\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5], 5]) == 10\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008129", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the the. sun sun ran') == {'the': 2, 'sun': 2, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the. sun sun ran') == {'the': 2, 'sun': 2, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008130", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 3, 'z': 6, 'w': 2}, {'w': 3, 'x': 2, 'z': 6}) == {'y': 3, 'z': 12, 'w': 5, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3, 'z': 6, 'w': 2}, {'w': 3, 'x': 2, 'z': 6}) == {'y': 3, 'z': 12, 'w': 5, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008131", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 6, 'z': 8}, {'z': 5, 'x': 5}) == {'x': 11, 'z': 13}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 6, 'z': 8}, {'z': 5, 'x': 5}) == {'x': 11, 'z': 13}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008132", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, 5], [8, 3]], [[0, 4], [9, -7]]) == [[-7, 9], [17, -4]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 5], [8, 3]], [[0, 4], [9, -7]]) == [[-7, 9], [17, -4]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008133", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(465) == 15\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(465) == 15\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008134", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(8101) == 10\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8101) == 10\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008135", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['berry', 'apple', 'banana', 'apple', 'banana', 'cherry', 'avocado']) == {'b': ['berry', 'banana', 'banana'], 'a': ['apple', 'apple', 'avocado'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'apple', 'banana', 'apple', 'banana', 'cherry', 'avocado']) == {'b': ['berry', 'banana', 'banana'], 'a': ['apple', 'apple', 'avocado'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008136", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(119) == [7, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(119) == [7, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008137", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sun! dog sun! Dog dog!') == {'sun': 2, 'dog': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun! dog sun! Dog dog!') == {'sun': 2, 'dog': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008138", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([7, 6, 5, 3, 9, 0, 0, 5, 6], 6) == [3, 9, 0, 0, 5, 6, 7, 6, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 6, 5, 3, 9, 0, 0, 5, 6], 6) == [3, 9, 0, 0, 5, 6, 7, 6, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008139", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['yz', 'yy']) == 'y'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['yz', 'yy']) == 'y'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008140", "instruction": "Create function is_palindrome(s) returning True for palindromes, False otherwise.\n\nExample:\nassert is_palindrome('cbbcaacbbc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbbcaacbbc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008141", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(39, 195, 265) == 129\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(39, 195, 265) == 129\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008142", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(95) == 105\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(95) == 105\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008143", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('aceaecda') == 'aced'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aceaecda') == 'aced'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008144", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(241) == 21\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(241) == 21\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008145", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([3, 3, [9, 2, 1]]) == [3, 3, 9, 2, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, 3, [9, 2, 1]]) == [3, 3, 9, 2, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008146", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 1) == 'bcd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008147", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([8, 31, 36, 61, 65, 69, 84], 8) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 31, 36, 61, 65, 69, 84], 8) == 0\nassert binary_search([8, 31, 36, 61, 65, 69, 84], 8) == 0\nassert binary_search([8, 31, 36, 61, 65, 69, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008148", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(72) == [2, 2, 2, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(72) == [2, 2, 2, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008149", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sat Sat sun ran! dog The') == {'sat': 2, 'sun': 1, 'ran': 1, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat Sat sun ran! dog The') == {'sat': 2, 'sun': 1, 'ran': 1, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008150", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 35, 'a': 44}) == {35: 'c', 44: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 35, 'a': 44}) == {35: 'c', 44: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008151", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(611) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(611) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008152", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(98)\nacc.deposit(156)\nacc.withdraw(177)\nacc.withdraw(398)\nassert acc.get_balance() == 254\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(98)\nacc.deposit(156)\nassert acc.get_balance() == 254\nacc.withdraw(177)\nassert acc.get_balance() == 77\nacc.withdraw(398)\nassert acc.get_balance() == 77\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008153", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dadca') == 'dac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dadca') == 'dac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008154", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('caedcdca') == 'caed'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('caedcdca') == 'caed'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008155", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('5h21m55s') == 19315\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h21m55s') == 19315\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008156", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('babbbbbabbbb', 'babb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbbbbabbbb', 'babb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008157", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(57, 32) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(57, 32) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008158", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([4, 10, 14], [11]) == [4, 10, 11, 14]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 10, 14], [11]) == [4, 10, 11, 14]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008159", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('2') == 2\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('2') == 2\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008160", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([6, 25, 50, 30, 10, 41, 3, 23, 30]) == [3, 6, 10, 23, 25, 30, 30, 41, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([6, 25, 50, 30, 10, 41, 3, 23, 30]) == [3, 6, 10, 23, 25, 30, 30, 41, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008161", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(17); s.push(97); s.push(72)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(17); s.push(97); s.push(72)\nassert s.peek() == 72\nassert s.pop() == 72\nassert s.pop() == 97\nassert s.is_empty() == False\nassert s.pop() == 17\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008162", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('44,abec,\"abb,,\",dbaa,\"ba,,b\"') == ['44', 'abec', 'abb,,', 'dbaa', 'ba,,b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('44,abec,\"abb,,\",dbaa,\"ba,,b\"') == ['44', 'abec', 'abb,,', 'dbaa', 'ba,,b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008163", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(3, 185, 501) == 84\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(3, 185, 501) == 84\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008164", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('bbeeacda') == 'beacd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbeeacda') == 'beacd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008165", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['date', 'banana', 'apple', 'banana', 'avocado', 'avocado', 'coconut']) == {'d': ['date'], 'b': ['banana', 'banana'], 'a': ['apple', 'avocado', 'avocado'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'banana', 'apple', 'banana', 'avocado', 'avocado', 'coconut']) == {'d': ['date'], 'b': ['banana', 'banana'], 'a': ['apple', 'avocado', 'avocado'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008166", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([44, 9, 35, 20]) == [9, 20, 35, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 9, 35, 20]) == [9, 20, 35, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_008167", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([11], [1, 3, 5, 5, 17, 18]) == [1, 3, 5, 5, 11, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([11], [1, 3, 5, 5, 17, 18]) == [1, 3, 5, 5, 11, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008168", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 2, 5, 0, 5, 5, 2]) == [2, 5, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 5, 0, 5, 5, 2]) == [2, 5, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008169", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(278) == 'CCLXXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(278) == 'CCLXXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008170", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sat dog. the the sat Dog') == {'sat': 2, 'dog': 2, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat dog. the the sat Dog') == {'sat': 2, 'dog': 2, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008171", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['avocado', 'apple', 'avocado', 'avocado', 'berry']) == {'a': ['avocado', 'apple', 'avocado', 'avocado'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'apple', 'avocado', 'avocado', 'berry']) == {'a': ['avocado', 'apple', 'avocado', 'avocado'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008172", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([48, 34, 5, 40]) == [5, 34, 40, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([48, 34, 5, 40]) == [5, 34, 40, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008173", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(410) == 'CDX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(410) == 'CDX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008174", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(63); s.push(52); s.push(18)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(63); s.push(52); s.push(18)\nassert s.peek() == 18\nassert s.pop() == 18\nassert s.pop() == 52\nassert s.is_empty() == False\nassert s.pop() == 63\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008175", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-22, -27, -16, 44, 3]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-22, -27, -16, 44, 3]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008176", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([18, 7, 42, 34, 11, 26, 45, 42, 31, 46, 42, 7, 34]) == [7, 7, 11, 18, 26, 31, 34, 34, 42, 42, 42, 45, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 7, 42, 34, 11, 26, 45, 42, 31, 46, 42, 7, 34]) == [7, 7, 11, 18, 26, 31, 34, 34, 42, 42, 42, 45, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008177", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0, 0], 3, 2, 9]) == [0, 0, 3, 2, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 0], 3, 2, 9]) == [0, 0, 3, 2, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008178", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(62) == [2, 31]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(62) == [2, 31]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008179", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([4, 21, 19, 15, 9]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([4, 21, 19, 15, 9]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008180", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(22); s.push(39); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(22); s.push(39); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 39\nassert s.is_empty() == False\nassert s.pop() == 22\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008181", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(152) == 23\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(152) == 23\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008182", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('yeaycd') == 'dcyaey'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('yeaycd') == 'dcyaey'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008183", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'avocado', 'berry']) == {'b': ['berry', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'avocado', 'berry']) == {'b': ['berry', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008184", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[5, 5, 6], [-6, 1, -3], [-3, 2, -9]], [[-7, -5, -1], [0, 0, 4], [-4, 0, 2]]) == [[-2, 0, 5], [-6, 1, 1], [-7, 2, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[5, 5, 6], [-6, 1, -3], [-3, 2, -9]], [[-7, -5, -1], [0, 0, 4], [-4, 0, 2]]) == [[-2, 0, 5], [-6, 1, 1], [-7, 2, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008185", "instruction": "Define title_case converting a string to title case.\n\nExample:\nassert title_case('cceea') == 'Cceea'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('cceea') == 'Cceea'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008186", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([14, 19, 30, 45, 45]) == [14, 19, 30, 45, 45]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 19, 30, 45, 45]) == [14, 19, 30, 45, 45]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008187", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 68, 'a': 89, 'e': 14}) == {68: 'f', 89: 'a', 14: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 68, 'a': 89, 'e': 14}) == {68: 'f', 89: 'a', 14: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008188", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 2, 5], [4, 4, 4]], [[1, 2, 0], [5, 4, 3], [1, 5, 3]]) == [[17, 37, 21], [28, 44, 24]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 2, 5], [4, 4, 4]], [[1, 2, 0], [5, 4, 3], [1, 5, 3]]) == [[17, 37, 21], [28, 44, 24]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008189", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([28, 12, 8, 12, 6]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 12, 8, 12, 6]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008190", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([7, -4, -6]) == -3\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([7, -4, -6]) == -3\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008191", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(33); s.push(67); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(33); s.push(67); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 67\nassert s.is_empty() == False\nassert s.pop() == 33\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008192", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[4, 0, 4], [7, 2, 2], [5, 7, 4], [3, 0, 0]]) == [[4, 7, 5, 3], [0, 2, 7, 0], [4, 2, 4, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[4, 0, 4], [7, 2, 2], [5, 7, 4], [3, 0, 0]]) == [[4, 7, 5, 3], [0, 2, 7, 0], [4, 2, 4, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008193", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[0, 1, 5, 2], 6, [5], [0]]) == [0, 1, 5, 2, 6, 5, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 1, 5, 2], 6, [5], [0]]) == [0, 1, 5, 2, 6, 5, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008194", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[5, 4, 0], [8, 1], 5, [7, 1, 0]]) == [5, 4, 0, 8, 1, 5, 7, 1, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 4, 0], [8, 1], 5, [7, 1, 0]]) == [5, 4, 0, 8, 1, 5, 7, 1, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008195", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(7, 10) == 282475249\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 10) == 282475249\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008196", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ebd', 'ebda') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ebd', 'ebda') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008197", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['b', 'bzx']) == 'b'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['b', 'bzx']) == 'b'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008198", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('cccbbccccacc', 'cabb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cccbbccccacc', 'cabb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008199", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aaacxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaacxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008200", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([12, 19, 27, 12, 17, 22, 13, 19]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 19, 27, 12, 17, 22, 13, 19]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008201", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('ffd hgcgd hhhffbd f geh') == 'hhhffbd'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ffd hgcgd hhhffbd f geh') == 'hhhffbd'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008202", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 8, 9, 4, 4, 7, 4, 0], [1, 6, 5]) == [6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 8, 9, 4, 4, 7, 4, 0], [1, 6, 5]) == [6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008203", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('the sat! Dog sun! ran! the dog ran, ran cat.') == {'the': 2, 'sat': 1, 'dog': 2, 'sun': 1, 'ran': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the sat! Dog sun! ran! the dog ran, ran cat.') == {'the': 2, 'sat': 1, 'dog': 2, 'sun': 1, 'ran': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008204", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(28, 42) == 14\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 42) == 14\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008205", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([50, 12, 32]) == [12, 32, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([50, 12, 32]) == [12, 32, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008206", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('dog dog dog sun! Cat ran ran, The dog the') == {'dog': 4, 'sun': 1, 'cat': 1, 'ran': 2, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog dog dog sun! Cat ran ran, The dog the') == {'dog': 4, 'sun': 1, 'cat': 1, 'ran': 2, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008207", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[5, 2], [4, 5]]) == [[5, 4], [2, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 2], [4, 5]]) == [[5, 4], [2, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008208", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('adeeda a c') == 'Adeeda A C'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('adeeda a c') == 'Adeeda A C'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008209", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'a': 9, 'd': 7, 'e': 3}, 5) == {'a': 9, 'd': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 9, 'd': 7, 'e': 3}, 5) == {'a': 9, 'd': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008210", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MDCCLXXIII') == 1773\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDCCLXXIII') == 1773\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008211", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['a', 'a', 'a']) == {'a': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'a', 'a']) == {'a': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008212", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=110; port=272; mode=auto') == {'user': '110', 'port': '272', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=110; port=272; mode=auto') == {'user': '110', 'port': '272', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008213", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([23, 34, 22, 45, 50, 6]) == [6, 22, 23, 34, 45, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([23, 34, 22, 45, 50, 6]) == [6, 22, 23, 34, 45, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008214", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(6193) == 78\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6193) == 78\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008215", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([5, 7, 9, 10], [0, 3, 4, 8, 11, 16, 18]) == [0, 3, 4, 5, 7, 8, 9, 10, 11, 16, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 7, 9, 10], [0, 3, 4, 8, 11, 16, 18]) == [0, 3, 4, 5, 7, 8, 9, 10, 11, 16, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008216", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'cherry', 'coconut', 'avocado', 'avocado', 'coconut']) == {'c': ['cherry', 'cherry', 'coconut', 'coconut'], 'b': ['berry'], 'a': ['avocado', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'cherry', 'coconut', 'avocado', 'avocado', 'coconut']) == {'c': ['cherry', 'cherry', 'coconut', 'coconut'], 'b': ['berry'], 'a': ['avocado', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008217", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('cbd', 'cbdc') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cbd', 'cbdc') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008218", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(29, 144) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(29, 144) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008219", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python World', 4) == 'Tcxlsr Asvph'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python World', 4) == 'Tcxlsr Asvph'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008220", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([3, 8, 4, 3, 2, 2, 7, 8], [1, 7, 5, 8]) == [8, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 8, 4, 3, 2, 2, 7, 8], [1, 7, 5, 8]) == [8, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008221", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(92) == [2, 2, 23]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(92) == [2, 2, 23]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008222", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(156) == 'CLVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(156) == 'CLVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008223", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, -8, -6], [1, 9, 2]], [[-8, -2, 4], [3, -2, 7]]) == [[-2, -10, -2], [4, 7, 9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -8, -6], [1, 9, 2]], [[-8, -2, 4], [3, -2, 7]]) == [[-2, -10, -2], [4, 7, 9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008224", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[4, 1, 1], 0]) == [4, 1, 1, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 1, 1], 0]) == [4, 1, 1, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008225", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([10, 27, 14, 4, 5, 4, 19, 8]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([10, 27, 14, 4, 5, 4, 19, 8]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008226", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('acccaaccccbc', 'accc') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acccaaccccbc', 'accc') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008227", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(21, 49) == 7\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(21, 49) == 7\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008228", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=759; port=478; host=231') == {'mode': '759', 'port': '478', 'host': '231'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=759; port=478; host=231') == {'mode': '759', 'port': '478', 'host': '231'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008229", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 4, 3, 3, 2, 2]) == [4, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 3, 3, 2, 2]) == [4, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008230", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([40, 36, 11, -46, 42, -10]) == 42\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([40, 36, 11, -46, 42, -10]) == 42\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008231", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CIII') == 103\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CIII') == 103\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008232", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(81); s.push(19); s.push(77)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(81); s.push(19); s.push(77)\nassert s.peek() == 77\nassert s.pop() == 77\nassert s.pop() == 19\nassert s.is_empty() == False\nassert s.pop() == 81\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008233", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[6, 6], 1, [2, 4, 8, 3]]) == [6, 6, 1, 2, 4, 8, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[6, 6], 1, [2, 4, 8, 3]]) == [6, 6, 1, 2, 4, 8, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008234", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 5, 1, 4, 1, 5, 8, 3], 6) == [1, 4, 1, 5, 8, 3, 9, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 5, 1, 4, 1, 5, 8, 3], 6) == [1, 4, 1, 5, 8, 3, 9, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008235", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(27, 48) == 432\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(27, 48) == 432\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008236", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([3, 9, 6], 1) == [6, 3, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 9, 6], 1) == [6, 3, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008237", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('f afaaaagg cagf') == 'afaaaagg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('f afaaaagg cagf') == 'afaaaagg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008238", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'d': 8, 'a': 1, 'c': 5, 'b': 0}, 5) == {'d': 8}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 8, 'a': 1, 'c': 5, 'b': 0}, 5) == {'d': 8}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008239", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(59) == [59]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(59) == [59]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008240", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('jiirfdnngz') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('jiirfdnngz') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008241", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(568) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(568) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008242", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(54, 21) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(54, 21) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008243", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([10, 15, 16, 38, 40, 49, 51, 61, 74, 76, 93], 179) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 15, 16, 38, 40, 49, 51, 61, 74, 76, 93], 179) == -1\nassert binary_search([10, 15, 16, 38, 40, 49, 51, 61, 74, 76, 93], 10) == 0\nassert binary_search([10, 15, 16, 38, 40, 49, 51, 61, 74, 76, 93], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008244", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['a', 'ayx', 'ax', 'a']) == 'a'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['a', 'ayx', 'ax', 'a']) == 'a'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008245", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('79,adc,96,aea,dec') == ['79', 'adc', '96', 'aea', 'dec']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('79,adc,96,aea,dec') == ['79', 'adc', '96', 'aea', 'dec']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008246", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(6003) == 3006\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6003) == 3006\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008247", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(4015) == 10\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4015) == 10\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008248", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('acabbbcc', 'ca') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acabbbcc', 'ca') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008249", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Code', 18) == 'Ugvw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 18) == 'Ugvw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008250", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(353) == 125\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(353) == 125\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008251", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([9, 3, 0, 2, 3], [4, 6, 8, 7, 5, 6]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 3, 0, 2, 3], [4, 6, 8, 7, 5, 6]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008252", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(15, 93, 573) == 309\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(15, 93, 573) == 309\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008253", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([2, 9, 5], 3) == [2, 9, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 9, 5], 3) == [2, 9, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008254", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([24, 18, 40, 21, 29, 44, 24, 32, 2, 38, 32]) == [2, 18, 21, 24, 24, 29, 32, 32, 38, 40, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 18, 40, 21, 29, 44, 24, 32, 2, 38, 32]) == [2, 18, 21, 24, 24, 29, 32, 32, 38, 40, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008255", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([18, 24, 6, 13, 14, 25, 20]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([18, 24, 6, 13, 14, 25, 20]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008256", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('XXV') == 25\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XXV') == 25\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008257", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h50m44s') == 10244\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h50m44s') == 10244\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008258", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([15, 15, 26, 27, 26]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 15, 26, 27, 26]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008259", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 4, 2, 3]) == [4, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 2, 3]) == [4, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008260", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 13) == 'klm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 13) == 'klm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008261", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fehgchfg bfa fc c dcdh b') == 'fehgchfg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fehgchfg bfa fc c dcdh b') == 'fehgchfg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008262", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(28, 53) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(28, 53) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008263", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([6, 3, 2, 1, 6, 9, 4, 5, 0, 0], 11) == [0, 6, 3, 2, 1, 6, 9, 4, 5, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 3, 2, 1, 6, 9, 4, 5, 0, 0], 11) == [0, 6, 3, 2, 1, 6, 9, 4, 5, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008264", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-13, 0, 19, 9, -10]) == 5\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-13, 0, 19, 9, -10]) == 5\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008265", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([10, -8]) == 2\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([10, -8]) == 2\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008266", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([47, 48, 29, 4, 19, 9, 3, 30, 43]) == [3, 4, 9, 19, 29, 30, 43, 47, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([47, 48, 29, 4, 19, 9, 3, 30, 43]) == [3, 4, 9, 19, 29, 30, 43, 47, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008267", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(4595) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4595) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008268", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([16, 23, -40, 12]) == 23\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([16, 23, -40, 12]) == 23\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008269", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-5, 1], [3, 5]], [[-7, 6], [9, 0]]) == [[-12, 7], [12, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-5, 1], [3, 5]], [[-7, 6], [9, 0]]) == [[-12, 7], [12, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008270", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([4, 2, 4, 2]) == [4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 4, 2]) == [4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008271", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 1, 3, 3, 0, 1], 3) == [[8, 1, 3], [3, 0, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 3, 3, 0, 1], 3) == [[8, 1, 3], [3, 0, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008272", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([7, 3, 3, 2, 0, 6, 8], 7) == [7, 3, 3, 2, 0, 6, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 3, 3, 2, 0, 6, 8], 7) == [7, 3, 3, 2, 0, 6, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008273", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(39) == [3, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(39) == [3, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008274", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(45, 11) == 495\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(45, 11) == 495\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008275", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['berry', 'berry', 'apple', 'coconut']) == {'b': ['berry', 'berry'], 'a': ['apple'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'apple', 'coconut']) == {'b': ['berry', 'berry'], 'a': ['apple'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008276", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 5, 8, 8], [4, 0, 5, 3, 2, 4, 5]) == [2, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 5, 8, 8], [4, 0, 5, 3, 2, 4, 5]) == [2, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008277", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(181) == 'CLXXXI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(181) == 'CLXXXI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008278", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(2094) == 'MMXCIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2094) == 'MMXCIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008279", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 3, 4, 2]) == [1, 3, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 4, 2]) == [1, 3, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008280", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(82) == [2, 41]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(82) == [2, 41]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008281", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('acadebb') == 'acdeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('acadebb') == 'acdeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008282", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[7, 5, 6], [7]]) == 25\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[7, 5, 6], [7]]) == 25\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008283", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ddacdecaba') == 'daceb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddacdecaba') == 'daceb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008284", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(34) == 13\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(34) == 13\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008285", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([6, 6, 5, 6, 8, 4, 8], [3, 4, 1, 8]) == [8, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 6, 5, 6, 8, 4, 8], [3, 4, 1, 8]) == [8, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008286", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('XCIV') == 94\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XCIV') == 94\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008287", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(316) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(316) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008288", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([26, 15, 15, 24]) == [15, 15, 24, 26]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([26, 15, 15, 24]) == [15, 15, 24, 26]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_008289", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('yybdzzxca') == 'acxzzdbyy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('yybdzzxca') == 'acxzzdbyy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008290", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('bccb') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bccb') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008291", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([25, 22, 7, 25, 25, 14, 7]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 22, 7, 25, 25, 14, 7]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008292", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaccccccccc') == 'a2c9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaccccccccc') == 'a2c9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008293", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(119) == [7, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(119) == [7, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008294", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'y': 3}, {'z': 5}) == {'w': 6, 'y': 3, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'y': 3}, {'z': 5}) == {'w': 6, 'y': 3, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008295", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(38, 57) == 19\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(38, 57) == 19\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008296", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(31, 59, 674) == 581\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(31, 59, 674) == 581\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008297", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('dabc,54,bb,d') == ['dabc', '54', 'bb', 'd']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('dabc,54,bb,d') == ['dabc', '54', 'bb', 'd']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008298", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=501; mode=991') == {'port': '501', 'mode': '991'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=501; mode=991') == {'port': '501', 'mode': '991'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008299", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([4, 6, 3, 8, 7, 9, 6], 2) == [[4, 6], [3, 8], [7, 9], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 6, 3, 8, 7, 9, 6], 2) == [[4, 6], [3, 8], [7, 9], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008300", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'y': 6, 'x': 6}, {'w': 4, 'y': 7, 'z': 9}) == {'z': 13, 'y': 13, 'x': 6, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'y': 6, 'x': 6}, {'w': 4, 'y': 7, 'z': 9}) == {'z': 13, 'y': 13, 'x': 6, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008301", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 9, 9, 2, 6], 4) == [[1, 9, 9, 2], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 9, 9, 2, 6], 4) == [[1, 9, 9, 2], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008302", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([6, 7, 7, 8], 4) == [[6, 7, 7, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 7, 7, 8], 4) == [[6, 7, 7, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008303", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([2, 17, 23, 11, 2]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 17, 23, 11, 2]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008304", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 3, 'w': 5, 'x': 5}, {'z': 1}) == {'z': 4, 'w': 5, 'x': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3, 'w': 5, 'x': 5}, {'z': 1}) == {'z': 4, 'w': 5, 'x': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008305", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([4, 1, 7, 0, 6], 5) == [[4, 1, 7, 0, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 1, 7, 0, 6], 5) == [[4, 1, 7, 0, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008306", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([5, 2, 3, 3, 4, 2, 0, 0, 2]) == [5, 2, 3, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 3, 3, 4, 2, 0, 0, 2]) == [5, 2, 3, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008307", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(303)\nacc.deposit(163)\nacc.withdraw(303)\nacc.withdraw(543)\nassert acc.get_balance() == 466\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(303)\nacc.deposit(163)\nassert acc.get_balance() == 466\nacc.withdraw(303)\nassert acc.get_balance() == 163\nacc.withdraw(543)\nassert acc.get_balance() == 163\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008308", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([19, 5, 0, 36, 24, 17, 24]) == [0, 5, 17, 19, 24, 24, 36]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([19, 5, 0, 36, 24, 17, 24]) == [0, 5, 17, 19, 24, 24, 36]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008309", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 23, 41, 53, 69, 95], 23) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 23, 41, 53, 69, 95], 23) == 1\nassert binary_search([5, 23, 41, 53, 69, 95], 5) == 0\nassert binary_search([5, 23, 41, 53, 69, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008310", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'d': 64, 'f': 50, 'e': 15, 'a': 81}) == {64: 'd', 50: 'f', 15: 'e', 81: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 64, 'f': 50, 'e': 15, 'a': 81}) == {64: 'd', 50: 'f', 15: 'e', 81: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008311", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 6, 1, 6, 6, 2, 1], 2) == [2, 1, 4, 6, 1, 6, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 6, 1, 6, 6, 2, 1], 2) == [2, 1, 4, 6, 1, 6, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008312", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(744) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(744) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008313", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(18, 32, 777) == 534\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 32, 777) == 534\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008314", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[[4], [6, 4, 0]]]) == [4, 6, 4, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[4], [6, 4, 0]]]) == [4, 6, 4, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008315", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 1, 9, 4, 8, 8, 3, 7], [4, 1, 3, 1, 2]) == [1, 4, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 1, 9, 4, 8, 8, 3, 7], [4, 1, 3, 1, 2]) == [1, 4, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008316", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbbcbab', 'abac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbcbab', 'abac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008317", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 8, 0, 7, 9, 4], [5, 7, 5, 3, 8, 1, 2]) == [8, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 8, 0, 7, 9, 4], [5, 7, 5, 3, 8, 1, 2]) == [8, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008318", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('ddb,ccc,ab') == ['ddb', 'ccc', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ddb,ccc,ab') == ['ddb', 'ccc', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008319", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 40, 'b': 42, 'c': 41, 'f': 61}) == {40: 'a', 42: 'b', 41: 'c', 61: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 40, 'b': 42, 'c': 41, 'f': 61}) == {40: 'a', 42: 'b', 41: 'c', 61: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008320", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([1, 38, 44, 26, 0, 50, 24, 9, 6, 2, 25, 38, 27, 7]) == [0, 1, 2, 6, 7, 9, 24, 25, 26, 27, 38, 38, 44, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([1, 38, 44, 26, 0, 50, 24, 9, 6, 2, 25, 38, 27, 7]) == [0, 1, 2, 6, 7, 9, 24, 25, 26, 27, 38, 38, 44, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008321", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 32, 'b': 35, 'c': 60, 'a': 10, 'd': 36}) == {32: 'f', 35: 'b', 60: 'c', 10: 'a', 36: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 32, 'b': 35, 'c': 60, 'a': 10, 'd': 36}) == {32: 'f', 35: 'b', 60: 'c', 10: 'a', 36: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008322", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('20') == 20\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('20') == 20\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008323", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cddaeabd') == 'cdaeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cddaeabd') == 'cdaeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008324", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('wvhhrblvccnsim') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('wvhhrblvccnsim') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008325", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 5, 2, 0, 1]) == [2, 5, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 5, 2, 0, 1]) == [2, 5, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008326", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(887922) == 942\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(887922) == 942\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008327", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(281) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(281) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008328", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([22, -2, -34, 39, 44, 43, 20, 39, -41]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([22, -2, -34, 39, 44, 43, 20, 39, -41]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008329", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(319) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(319) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008330", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8860) == 22\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8860) == 22\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008331", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[3, 4, 0], [1, 3, 3]], [[1, 0, 0], [3, 5, 0], [2, 0, 4]]) == [[15, 20, 0], [16, 15, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 4, 0], [1, 3, 3]], [[1, 0, 0], [3, 5, 0], [2, 0, 4]]) == [[15, 20, 0], [16, 15, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008332", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('43m56s') == 2636\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('43m56s') == 2636\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008333", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([9, 4, 8, 5, 0, 2, 6, 4, 7], 4) == [2, 6, 4, 7, 9, 4, 8, 5, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 4, 8, 5, 0, 2, 6, 4, 7], 4) == [2, 6, 4, 7, 9, 4, 8, 5, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008334", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(6624) == 4266\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6624) == 4266\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008335", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 2}, {'w': 5}) == {'w': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2}, {'w': 5}) == {'w': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008336", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(79, 193) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(79, 193) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008337", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ababd', 'ababde') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ababd', 'ababde') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008338", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['avocado', 'banana', 'cherry', 'coconut']) == {'a': ['avocado'], 'b': ['banana'], 'c': ['cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'banana', 'cherry', 'coconut']) == {'a': ['avocado'], 'b': ['banana'], 'c': ['cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008339", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('16,aea,\"b,a\",\",a\"') == ['16', 'aea', 'b,a', ',a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('16,aea,\"b,a\",\",a\"') == ['16', 'aea', 'b,a', ',a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008340", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('dceddbe', 'dceddbef') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dceddbe', 'dceddbef') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008341", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat cat the sun dog dog') == {'cat': 2, 'the': 1, 'sun': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat cat the sun dog dog') == {'cat': 2, 'the': 1, 'sun': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008342", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(6469) == 9646\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6469) == 9646\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008343", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(108, 173) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(108, 173) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008344", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'e', 'c', 'c']) == {'d': 1, 'e': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'c', 'c']) == {'d': 1, 'e': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008345", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(75); s.push(22); s.push(43)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(75); s.push(22); s.push(43)\nassert s.peek() == 43\nassert s.pop() == 43\nassert s.pop() == 22\nassert s.is_empty() == False\nassert s.pop() == 75\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008346", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([4, 30, 5]) == [4, 5, 30]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 30, 5]) == [4, 5, 30]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_008347", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([29, 9, 20]) == [9, 20, 29]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([29, 9, 20]) == [9, 20, 29]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_008348", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([23, 24, 14, 29, 10, 29]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 24, 14, 29, 10, 29]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008349", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(94); s.push(93); s.push(94)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(94); s.push(93); s.push(94)\nassert s.peek() == 94\nassert s.pop() == 94\nassert s.pop() == 93\nassert s.is_empty() == False\nassert s.pop() == 94\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 0.857} {"id": "stagec_008350", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(47, 31) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(47, 31) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008351", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(24, 21) == 168\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 21) == 168\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008352", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 98, 'd': 13, 'e': 63, 'c': 97}) == {98: 'f', 13: 'd', 63: 'e', 97: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 98, 'd': 13, 'e': 63, 'c': 97}) == {98: 'f', 13: 'd', 63: 'e', 97: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008353", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 1, 9, 0], [7, 4, 6, 9, 2, 0]) == [4, 9, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 1, 9, 0], [7, 4, 6, 9, 2, 0]) == [4, 9, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008354", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(10, 165, 87) == 85\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(10, 165, 87) == 85\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008355", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('adbdabca') == 'adbc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adbdabca') == 'adbc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008356", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['avocado', 'avocado', 'apple', 'banana', 'date']) == {'a': ['avocado', 'avocado', 'apple'], 'b': ['banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'avocado', 'apple', 'banana', 'date']) == {'a': ['avocado', 'avocado', 'apple'], 'b': ['banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008357", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([4, 0, 2, [0, 1], [3, 9, 3]]) == [4, 0, 2, 0, 1, 3, 9, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, 0, 2, [0, 1], [3, 9, 3]]) == [4, 0, 2, 0, 1, 3, 9, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008358", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bcbcaaaaabcccc', 'baba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcbcaaaaabcccc', 'baba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008359", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([3, [[2, 6]], 9]) == [3, 2, 6, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([3, [[2, 6]], 9]) == [3, 2, 6, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008360", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-9, 6, 2], [-9, 7, -5], [1, -5, 4]], [[7, 4, -5], [3, 0, -6], [2, 3, -7]]) == [[-2, 10, -3], [-6, 7, -11], [3, -2, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, 6, 2], [-9, 7, -5], [1, -5, 4]], [[7, 4, -5], [3, 0, -6], [2, 3, -7]]) == [[-2, 10, -3], [-6, 7, -11], [3, -2, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008361", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sat sun cat Ran dog cat') == {'sat': 1, 'sun': 1, 'cat': 2, 'ran': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat sun cat Ran dog cat') == {'sat': 1, 'sun': 1, 'cat': 2, 'ran': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008362", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([30, 20, 6, 19, -26, -39, -8]) == 30\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([30, 20, 6, 19, -26, -39, -8]) == 30\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008363", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(19, 45) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(19, 45) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008364", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['cherry', 'cherry', 'apple', 'date', 'avocado', 'berry']) == {'c': ['cherry', 'cherry'], 'a': ['apple', 'avocado'], 'd': ['date'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'cherry', 'apple', 'date', 'avocado', 'berry']) == {'c': ['cherry', 'cherry'], 'a': ['apple', 'avocado'], 'd': ['date'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008365", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 1, 8, 5, 0, 5, 8, 9, 0, 3], 5) == [[8, 1, 8, 5, 0], [5, 8, 9, 0, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 8, 5, 0, 5, 8, 9, 0, 3], 5) == [[8, 1, 8, 5, 0], [5, 8, 9, 0, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008366", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([7, 26, 12, 25, 10, 26]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([7, 26, 12, 25, 10, 26]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008367", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([4, 8, 3, 0, 7, 1, 4], [7, 6, 7, 4]) == [4, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 8, 3, 0, 7, 1, 4], [7, 6, 7, 4]) == [4, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008368", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(22145) == 148\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(22145) == 148\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008369", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([8, 3, 1, 7, 5], 4) == [3, 1, 7, 5, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 3, 1, 7, 5], 4) == [3, 1, 7, 5, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008370", "instruction": "Write is_palindrome(s) -> bool: palindrome check.\n\nExample:\nassert is_palindrome('aabbaa') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aabbaa') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008371", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([32, 40, 14, -38, 15, 41, 4, 0, 29]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([32, 40, 14, -38, 15, 41, 4, 0, 29]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008372", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 5, 5, 4, 5, 5, 3, 1, 3, 5, 4, 2]) == [3, 5, 4, 1, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 5, 4, 5, 5, 3, 1, 3, 5, 4, 2]) == [3, 5, 4, 1, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008373", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('()()[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('()()[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008374", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([38, 26, 43, 33, 1, 19, 21, 10, 49, 47, 18, 13, 6, 3]) == [1, 3, 6, 10, 13, 18, 19, 21, 26, 33, 38, 43, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([38, 26, 43, 33, 1, 19, 21, 10, 49, 47, 18, 13, 6, 3]) == [1, 3, 6, 10, 13, 18, 19, 21, 26, 33, 38, 43, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008375", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens(')b}]}ba') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')b}]}ba') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008376", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[5, 1, 8, 1], [6, 4, 8, 0]]) == [[5, 6], [1, 4], [8, 8], [1, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 1, 8, 1], [6, 4, 8, 0]]) == [[5, 6], [1, 4], [8, 8], [1, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008377", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([7, 39, 2, 27, 9, 3, 40, 28]) == [2, 3, 7, 9, 27, 28, 39, 40]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([7, 39, 2, 27, 9, 3, 40, 28]) == [2, 3, 7, 9, 27, 28, 39, 40]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008378", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 17) == 'rst'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 17) == 'rst'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008379", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(90); s.push(99); s.push(68)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(99); s.push(68)\nassert s.peek() == 68\nassert s.pop() == 68\nassert s.pop() == 99\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008380", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-8, -5, 8, 7, 6, 7, 3]) == [-8, -13, -5, 2, 8, 15, 18]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, -5, 8, 7, 6, 7, 3]) == [-8, -13, -5, 2, 8, 15, 18]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008381", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(1826) == 6281\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1826) == 6281\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008382", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([0, [3]]) == [0, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([0, [3]]) == [0, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008383", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('a{()') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a{()') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008384", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('baecdbce') == 'baecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('baecdbce') == 'baecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008385", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('(()[])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(()[])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008386", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['e', 'e', 'd', 'b', 'd', 'e']) == {'e': 3, 'd': 2, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'e', 'd', 'b', 'd', 'e']) == {'e': 3, 'd': 2, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008387", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[3, 4], [0, 9], 8]) == [3, 4, 0, 9, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 4], [0, 9], 8]) == [3, 4, 0, 9, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008388", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Hello Code', 21) == 'Czggj Xjyz'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello Code', 21) == 'Czggj Xjyz'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008389", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([20, 25, 30, 25, 40, 23, 30, 36, 39, 28, 17]) == [17, 20, 23, 25, 25, 28, 30, 30, 36, 39, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 25, 30, 25, 40, 23, 30, 36, 39, 28, 17]) == [17, 20, 23, 25, 25, 28, 30, 30, 36, 39, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008390", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(29, 28) == 812\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(29, 28) == 812\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008391", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('port=491; path=241') == {'port': '491', 'path': '241'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=491; path=241') == {'port': '491', 'path': '241'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008392", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([31, 9, 13, 44]) == [9, 13, 31, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([31, 9, 13, 44]) == [9, 13, 31, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008393", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(3776) == 6773\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(3776) == 6773\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008394", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([8, 4, 8, 9, 6, 9, 0, 6, 9], 2) == [6, 9, 8, 4, 8, 9, 6, 9, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 4, 8, 9, 6, 9, 0, 6, 9], 2) == [6, 9, 8, 4, 8, 9, 6, 9, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008395", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('15') == 15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('15') == 15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008396", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([1, 3, 8, 19, 40, 44, 64, 74, 76, 97], 200) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([1, 3, 8, 19, 40, 44, 64, 74, 76, 97], 200) == -1\nassert binary_search([1, 3, 8, 19, 40, 44, 64, 74, 76, 97], 1) == 0\nassert binary_search([1, 3, 8, 19, 40, 44, 64, 74, 76, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008397", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'a': 86, 'b': 20, 'c': 9, 'f': 30}) == {86: 'a', 20: 'b', 9: 'c', 30: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 86, 'b': 20, 'c': 9, 'f': 30}) == {86: 'a', 20: 'b', 9: 'c', 30: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008398", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('dbad') == 'dba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbad') == 'dba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008399", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([9, 8, 9, 6, 0, 7, 0, 8, 8], 4) == [7, 0, 8, 8, 9, 8, 9, 6, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 8, 9, 6, 0, 7, 0, 8, 8], 4) == [7, 0, 8, 8, 9, 8, 9, 6, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008400", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bcacbccbaabb', 'acc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bcacbccbaabb', 'acc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008401", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('aebb') == 'aeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aebb') == 'aeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008402", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'e': 52, 'a': 77, 'c': 35, 'b': 74}) == {52: 'e', 77: 'a', 35: 'c', 74: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 52, 'a': 77, 'c': 35, 'b': 74}) == {52: 'e', 77: 'a', 35: 'c', 74: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008403", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(59, 15) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 15) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008404", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-6, 8, -1, 8], [7, 0, 4, 6], [9, 3, -4, 2]], [[1, -3, 1, -4], [-1, 8, 5, 0], [-8, 3, 4, 9]]) == [[-5, 5, 0, 4], [6, 8, 9, 6], [1, 6, 0, 11]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-6, 8, -1, 8], [7, 0, 4, 6], [9, 3, -4, 2]], [[1, -3, 1, -4], [-1, 8, 5, 0], [-8, 3, 4, 9]]) == [[-5, 5, 0, 4], [6, 8, 9, 6], [1, 6, 0, 11]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008405", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaabbbbbc') == 'a3b5c1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaabbbbbc') == 'a3b5c1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008406", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([3, [0, 3], 4]) == [3, 0, 3, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [0, 3], 4]) == [3, 0, 3, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008407", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([5, 4, 0, 0, 3, 3, 1, 1]) == [5, 4, 0, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 0, 0, 3, 3, 1, 1]) == [5, 4, 0, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008408", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(45, 18) == 90\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(45, 18) == 90\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008409", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([8, 41, 58, 61, 87, 96], 196) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 41, 58, 61, 87, 96], 196) == -1\nassert binary_search([8, 41, 58, 61, 87, 96], 8) == 0\nassert binary_search([8, 41, 58, 61, 87, 96], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008410", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ccbe') == 'cbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ccbe') == 'cbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008411", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([15, 47, 7, 17, 20, 34, 4, 7]) == [4, 7, 7, 15, 17, 20, 34, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([15, 47, 7, 17, 20, 34, 4, 7]) == [4, 7, 7, 15, 17, 20, 34, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008412", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'cherry', 'coconut', 'apple', 'berry', 'apple', 'date']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'coconut'], 'a': ['apple', 'apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'cherry', 'coconut', 'apple', 'berry', 'apple', 'date']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'coconut'], 'a': ['apple', 'apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008413", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 6, 9, 6, 9, 4, 8, 3, 2, 4], 15) == [4, 8, 3, 2, 4, 0, 6, 9, 6, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 6, 9, 6, 9, 4, 8, 3, 2, 4], 15) == [4, 8, 3, 2, 4, 0, 6, 9, 6, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008414", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([10, 19, 48, 49, 82, 89, 94], 48) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 19, 48, 49, 82, 89, 94], 48) == 2\nassert binary_search([10, 19, 48, 49, 82, 89, 94], 10) == 0\nassert binary_search([10, 19, 48, 49, 82, 89, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008415", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ccaba', 'caabc') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ccaba', 'caabc') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008416", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('bbzbxd') == 'dxbzbb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bbzbxd') == 'dxbzbb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008417", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'y': 3, 'x': 2}, {'y': 4, 'w': 2, 'z': 3}) == {'z': 12, 'y': 7, 'x': 2, 'w': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'y': 3, 'x': 2}, {'y': 4, 'w': 2, 'z': 3}) == {'z': 12, 'y': 7, 'x': 2, 'w': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008418", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(24, 21) == 168\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 21) == 168\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008419", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(11, 6) == 66\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(11, 6) == 66\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008420", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 4, 0, 3]) == [0, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 4, 0, 3]) == [0, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008421", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aacbc', 'aac') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aacbc', 'aac') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008422", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('onbw') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('onbw') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008423", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(2868) == 8682\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2868) == 8682\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008424", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(14); s.push(2); s.push(91)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(14); s.push(2); s.push(91)\nassert s.peek() == 91\nassert s.pop() == 91\nassert s.pop() == 2\nassert s.is_empty() == False\nassert s.pop() == 14\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008425", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(70) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(70) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008426", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('bbce') == 'bce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbce') == 'bce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008427", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('((13 - 9) - 7)') == -3\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((13 - 9) - 7)') == -3\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008428", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(39, 20) == 780\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(39, 20) == 780\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008429", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fecb chac') == 'fecb'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fecb chac') == 'fecb'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008430", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(4578) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4578) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008431", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([45, 14]) == 45\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([45, 14]) == 45\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008432", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('aeadedcd') == 'aedc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aeadedcd') == 'aedc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008433", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([6, 3, 4, 0], [2, 7, 7, 8]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 3, 4, 0], [2, 7, 7, 8]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008434", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[0, 6, 9, 1], [8, 9, 2, 3], [8, 1, 5, 3], [5, 0, 6, 5]]) == [[0, 8, 8, 5], [6, 9, 1, 0], [9, 2, 5, 6], [1, 3, 3, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 6, 9, 1], [8, 9, 2, 3], [8, 1, 5, 3], [5, 0, 6, 5]]) == [[0, 8, 8, 5], [6, 9, 1, 0], [9, 2, 5, 6], [1, 3, 3, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008435", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([14, 18], [20]) == [14, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([14, 18], [20]) == [14, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008436", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([40, 50, 35, 3, 1, 38, 19, 23, 4]) == [1, 3, 4, 19, 23, 35, 38, 40, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([40, 50, 35, 3, 1, 38, 19, 23, 4]) == [1, 3, 4, 19, 23, 35, 38, 40, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008437", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([41, 12, 9, 47, 1, 7]) == [1, 7, 9, 12, 41, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([41, 12, 9, 47, 1, 7]) == [1, 7, 9, 12, 41, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008438", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 9}, {'x': 6}) == {'x': 15}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9}, {'x': 6}) == {'x': 15}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008439", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['c', 'b', 'd', 'a', 'c', 'd', 'c', 'a', 'c']) == {'c': 4, 'b': 1, 'd': 2, 'a': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'b', 'd', 'a', 'c', 'd', 'c', 'a', 'c']) == {'c': 4, 'b': 1, 'd': 2, 'a': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008440", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCCLXXX') == 380\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCLXXX') == 380\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008441", "instruction": "Define binary_search performing binary search.\n\nExample:\nassert binary_search([16, 30, 32, 49, 88], 30) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([16, 30, 32, 49, 88], 30) == 1\nassert binary_search([16, 30, 32, 49, 88], 16) == 0\nassert binary_search([16, 30, 32, 49, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008442", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('abaee') == 'abe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abaee') == 'abe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008443", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 4, 5, 1, 2, 7, 6, 9, 0, 0, 0, 0, 5, 2, 6, 8], 3) == [[8, 4, 5], [1, 2, 7], [6, 9, 0], [0, 0, 0], [5, 2, 6], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 4, 5, 1, 2, 7, 6, 9, 0, 0, 0, 0, 5, 2, 6, 8], 3) == [[8, 4, 5], [1, 2, 7], [6, 9, 0], [0, 0, 0], [5, 2, 6], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008444", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(55) == [5, 11]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(55) == [5, 11]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008445", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([13, 11, 4, 28, 4, 28, 42, 29]) == [4, 4, 11, 13, 28, 28, 29, 42]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([13, 11, 4, 28, 4, 28, 42, 29]) == [4, 4, 11, 13, 28, 28, 29, 42]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008446", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('caceb edbcaa ec b') == 'Caceb Edbcaa Ec B'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('caceb edbcaa ec b') == 'Caceb Edbcaa Ec B'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008447", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(22, 13) == 286\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(22, 13) == 286\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008448", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['cba', 'cbazz', 'cbayyz', 'cba']) == 'cba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cba', 'cbazz', 'cbayyz', 'cba']) == 'cba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008449", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([22, 29, 42, 26, 7, 8]) == [7, 8, 22, 26, 29, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 29, 42, 26, 7, 8]) == [7, 8, 22, 26, 29, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008450", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['bb', 'bb', 'bb', 'bbyzy']) == 'bb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bb', 'bb', 'bb', 'bbyzy']) == 'bb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008451", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([2, 0, 2], 3) == [2, 0, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 0, 2], 3) == [2, 0, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008452", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('33m58s') == 2038\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('33m58s') == 2038\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008453", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([44, 19, 8, 15, 1, 8, 17, 27]) == [1, 8, 8, 15, 17, 19, 27, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([44, 19, 8, 15, 1, 8, 17, 27]) == [1, 8, 8, 15, 17, 19, 27, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008454", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([20, 4, 9]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([20, 4, 9]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008455", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(3, 3) == 27\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(3, 3) == 27\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008456", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('fdc', 'dfc') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('fdc', 'dfc') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008457", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[7], [6, 4]]) == [7, 6, 4]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7], [6, 4]]) == [7, 6, 4]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008458", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 9, 'y': 7}, {'y': 7}) == {'w': 9, 'y': 14}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9, 'y': 7}, {'y': 7}) == {'w': 9, 'y': 14}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008459", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(5, 20) == 20\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 20) == 20\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008460", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([0, 47, 36, 49, 38, 47, 37, 40, 43, 16, 22]) == [0, 16, 22, 36, 37, 38, 40, 43, 47, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([0, 47, 36, 49, 38, 47, 37, 40, 43, 16, 22]) == [0, 16, 22, 36, 37, 38, 40, 43, 47, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008461", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('beaed') == 'bead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beaed') == 'bead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008462", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[2, 2], [1, 3], [4, 4]], [[2, 3, 4], [4, 4, 5]]) == [[12, 14, 18], [14, 15, 19], [24, 28, 36]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 2], [1, 3], [4, 4]], [[2, 3, 4], [4, 4, 5]]) == [[12, 14, 18], [14, 15, 19], [24, 28, 36]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008463", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([3, 46, 26, 44]) == [3, 26, 44, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([3, 46, 26, 44]) == [3, 26, 44, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008464", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([3, 5, -9, -7, -1, 7, -8]) == [3, 8, -1, -8, -9, -2, -10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 5, -9, -7, -1, 7, -8]) == [3, 8, -1, -8, -9, -2, -10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008465", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h17m27s') == 8247\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h17m27s') == 8247\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008466", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=off; mode=auto; user=145; path=off') == {'host': 'off', 'mode': 'auto', 'user': '145', 'path': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=off; mode=auto; user=145; path=off') == {'host': 'off', 'mode': 'auto', 'user': '145', 'path': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008467", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'berry', 'cherry', 'berry', 'date', 'apple', 'cherry', 'berry']) == {'b': ['berry', 'berry', 'berry', 'berry'], 'c': ['cherry', 'cherry'], 'd': ['date'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'cherry', 'berry', 'date', 'apple', 'cherry', 'berry']) == {'b': ['berry', 'berry', 'berry', 'berry'], 'c': ['cherry', 'cherry'], 'd': ['date'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008468", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('cabcbcbccbbcb', 'acb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cabcbcbccbbcb', 'acb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008469", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([6, 8, 3, 1, 3, 2, 3, 4, 3], 5) == [[6, 8, 3, 1, 3], [2, 3, 4, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 8, 3, 1, 3, 2, 3, 4, 3], 5) == [[6, 8, 3, 1, 3], [2, 3, 4, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008470", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 5, 5, 0, 5, 4, 1]) == [5, 0, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 5, 5, 0, 5, 4, 1]) == [5, 0, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008471", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([26, 7, 4, 36]) == [4, 7, 26, 36]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([26, 7, 4, 36]) == [4, 7, 26, 36]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008472", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[4, 2], [2, 1]], [[3, 1], [5, 3]]) == [[22, 10], [11, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2], [2, 1]], [[3, 1], [5, 3]]) == [[22, 10], [11, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008473", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[5, 0], [2, 5]], [[3, 4], [4, 5]]) == [[15, 20], [26, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 0], [2, 5]], [[3, 4], [4, 5]]) == [[15, 20], [26, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008474", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([17, 22, 2, 18]) == [2, 17, 18, 22]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([17, 22, 2, 18]) == [2, 17, 18, 22]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008475", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(17 + 20) - 16 * 2') == 5\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(17 + 20) - 16 * 2') == 5\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008476", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('abebgaga cfab edegb ghah') == 'abebgaga'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('abebgaga cfab edegb ghah') == 'abebgaga'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008477", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun Dog sun the. dog dog, ran dog. sun ran') == {'sun': 3, 'dog': 4, 'the': 1, 'ran': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun Dog sun the. dog dog, ran dog. sun ran') == {'sun': 3, 'dog': 4, 'the': 1, 'ran': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008478", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(86); s.push(8); s.push(57)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(86); s.push(8); s.push(57)\nassert s.peek() == 57\nassert s.pop() == 57\nassert s.pop() == 8\nassert s.is_empty() == False\nassert s.pop() == 86\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008479", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[6, 9, 6], [1, 2]]) == [6, 9, 6, 1, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[6, 9, 6], [1, 2]]) == [6, 9, 6, 1, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008480", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{}({}[])') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{}({}[])') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008481", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([6, 27, 18, 27, 2, 9]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([6, 27, 18, 27, 2, 9]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008482", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([24, 9, 34, 0, 19]) == [0, 9, 19, 24, 34]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([24, 9, 34, 0, 19]) == [0, 9, 19, 24, 34]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008483", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(890) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(890) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008484", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 2, 7, 9, 7, 5], [3, 1, 6, 9, 4, 0, 9, 4]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 2, 7, 9, 7, 5], [3, 1, 6, 9, 4, 0, 9, 4]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008485", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 4}, {'x': 2, 'y': 5, 'w': 1}) == {'w': 5, 'x': 2, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 4}, {'x': 2, 'y': 5, 'w': 1}) == {'w': 5, 'x': 2, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008486", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abbbabb', 'baaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbabb', 'baaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008487", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'a': 29, 'b': 9, 'e': 53, 'f': 38, 'c': 19}) == {29: 'a', 9: 'b', 53: 'e', 38: 'f', 19: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 29, 'b': 9, 'e': 53, 'f': 38, 'c': 19}) == {29: 'a', 9: 'b', 53: 'e', 38: 'f', 19: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008488", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'e': 70, 'd': 65}) == {70: 'e', 65: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 70, 'd': 65}) == {70: 'e', 65: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008489", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[2], [6], [8]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2], [6], [8]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008490", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 9, 4, 2, 7, 9, 8, 5], [4, 8, 2, 6]) == [2, 4, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 9, 4, 2, 7, 9, 8, 5], [4, 8, 2, 6]) == [2, 4, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008491", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(441183) == 664\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(441183) == 664\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008492", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'w': 7, 'y': 1}, {'z': 9, 'y': 7, 'w': 4}) == {'x': 4, 'w': 11, 'y': 8, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'w': 7, 'y': 1}, {'z': 9, 'y': 7, 'w': 4}) == {'x': 4, 'w': 11, 'y': 8, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008493", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(5909) == 9095\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5909) == 9095\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008494", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Python Hello', 6) == 'Veznut Nkrru'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Hello', 6) == 'Veznut Nkrru'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008495", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(16, 17) == 272\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 17) == 272\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008496", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('baaabbbbbaabbb', 'aa') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaabbbbbaabbb', 'aa') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008497", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CDXXXVIII') == 438\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXXVIII') == 438\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008498", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('bgcypvdgollalw') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('bgcypvdgollalw') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008499", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(7895) == 29\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7895) == 29\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008500", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(83); s.push(36); s.push(2)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(36); s.push(2)\nassert s.peek() == 2\nassert s.pop() == 2\nassert s.pop() == 36\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008501", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(77348) == 278\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(77348) == 278\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008502", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(15 - 6) - 17') == -8\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(15 - 6) - 17') == -8\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008503", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(71); s.push(8); s.push(28)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(71); s.push(8); s.push(28)\nassert s.peek() == 28\nassert s.pop() == 28\nassert s.pop() == 8\nassert s.is_empty() == False\nassert s.pop() == 71\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008504", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['a', 'd', 'd', 'a']) == {'a': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['a', 'd', 'd', 'a']) == {'a': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008505", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['avocado', 'date', 'apple', 'cherry', 'apple', 'cherry', 'avocado']) == {'a': ['avocado', 'apple', 'apple', 'avocado'], 'd': ['date'], 'c': ['cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'date', 'apple', 'cherry', 'apple', 'cherry', 'avocado']) == {'a': ['avocado', 'apple', 'apple', 'avocado'], 'd': ['date'], 'c': ['cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008506", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[7, 7], [-1, 3]], [[-2, 6], [5, 5]]) == [[5, 13], [4, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 7], [-1, 3]], [[-2, 6], [5, 5]]) == [[5, 13], [4, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008507", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([8, 9], [0, 1, 4, 5, 8, 9]) == [0, 1, 4, 5, 8, 8, 9, 9]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([8, 9], [0, 1, 4, 5, 8, 9]) == [0, 1, 4, 5, 8, 8, 9, 9]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008508", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ebcaddbbda') == 'ebcad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebcaddbbda') == 'ebcad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008509", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([9, [9, 1, 9], 6]) == [9, 9, 1, 9, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([9, [9, 1, 9], 6]) == [9, 9, 1, 9, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008510", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([6, 9, 6, 1, 0, 5, 9], 3) == [[6, 9, 6], [1, 0, 5], [9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 6, 1, 0, 5, 9], 3) == [[6, 9, 6], [1, 0, 5], [9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008511", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(269) == [269]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(269) == [269]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008512", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([5, 24, 24, 22, 14]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 24, 24, 22, 14]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008513", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('10 - 9 + 3 + 3') == 7\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('10 - 9 + 3 + 3') == 7\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008514", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([8, 29, 47, 59, 63, 73, 80, 95], 63) == 4\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([8, 29, 47, 59, 63, 73, 80, 95], 63) == 4\nassert binary_search([8, 29, 47, 59, 63, 73, 80, 95], 8) == 0\nassert binary_search([8, 29, 47, 59, 63, 73, 80, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008515", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('bbbabbaaababab', 'bbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbabbaaababab', 'bbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008516", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'c': 15, 'e': 66}) == {15: 'c', 66: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 15, 'e': 66}) == {15: 'c', 66: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008517", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('ssszy') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ssszy') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008518", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([33, 45, 7]) == [7, 33, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([33, 45, 7]) == [7, 33, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008519", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('gtvfzhaxtdks') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('gtvfzhaxtdks') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008520", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 3], [7, 5]]) == [[7, 7], [3, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 3], [7, 5]]) == [[7, 7], [3, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008521", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([22, 24, 24, 37]) == [22, 24, 24, 37]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 24, 24, 37]) == [22, 24, 24, 37]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_008522", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(42, 58) == 1218\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(42, 58) == 1218\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008523", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(119, 108) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(119, 108) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008524", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[8, 3, -1], [9, 2, -5], [-7, -5, -8]], [[9, -9, -6], [2, -8, -6], [3, 9, 3]]) == [[17, -6, -7], [11, -6, -11], [-4, 4, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 3, -1], [9, 2, -5], [-7, -5, -8]], [[9, -9, -6], [2, -8, -6], [3, 9, 3]]) == [[17, -6, -7], [11, -6, -11], [-4, 4, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008525", "instruction": "Define a function reverse_string that takes a string and returns it reversed.\n\nExample:\nassert reverse_string('ycdzzyedxa') == 'axdeyzzdcy'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ycdzzyedxa') == 'axdeyzzdcy'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008526", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([9, 2, 2, 1, 7, 7, 8, 9, 7], 5) == [[9, 2, 2, 1, 7], [7, 8, 9, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 2, 2, 1, 7, 7, 8, 9, 7], 5) == [[9, 2, 2, 1, 7], [7, 8, 9, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008527", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 8, 'w': 4}, {'x': 2, 'w': 6}) == {'z': 8, 'w': 10, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8, 'w': 4}, {'x': 2, 'w': 6}) == {'z': 8, 'w': 10, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008528", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('dcccc') == 'd1c4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dcccc') == 'd1c4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008529", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('XXI') == 21\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XXI') == 21\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008530", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[9, 1, [7, 4, 9]], 3]) == 33\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 1, [7, 4, 9]], 3]) == 33\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008531", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('43m31s') == 2611\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('43m31s') == 2611\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008532", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ddaaa') == 'd2a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddaaa') == 'd2a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008533", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[3, 3], [0, 2]], [[2, 2], [4, 1]]) == [[18, 9], [8, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 3], [0, 2]], [[2, 2], [4, 1]]) == [[18, 9], [8, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008534", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(903) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(903) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008535", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(59, 60) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(59, 60) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008536", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([0, 2, 3, 0]) == [0, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 3, 0]) == [0, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008537", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'x': 3}, {'y': 2}) == {'z': 9, 'x': 3, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'x': 3}, {'y': 2}) == {'z': 9, 'x': 3, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008538", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[0, 0], [2, 5], [3, 1]], [[1, 4, 3], [5, 2, 4]]) == [[0, 0, 0], [27, 18, 26], [8, 14, 13]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 0], [2, 5], [3, 1]], [[1, 4, 3], [5, 2, 4]]) == [[0, 0, 0], [27, 18, 26], [8, 14, 13]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008539", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[3, 0], [7], [8, 2], [3, 7, 6, 3], 6]) == [3, 0, 7, 8, 2, 3, 7, 6, 3, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 0], [7], [8, 2], [3, 7, 6, 3], 6]) == [3, 0, 7, 8, 2, 3, 7, 6, 3, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008540", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([1, 2, 4, 6, 2, 2, 3, 4, 7, 1], 5) == [[1, 2, 4, 6, 2], [2, 3, 4, 7, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 2, 4, 6, 2, 2, 3, 4, 7, 1], 5) == [[1, 2, 4, 6, 2], [2, 3, 4, 7, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008541", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(243) == 'CCXLIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(243) == 'CCXLIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008542", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 6, 'y': 7}, {'x': 9, 'y': 2, 'w': 9}) == {'w': 15, 'y': 9, 'x': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6, 'y': 7}, {'x': 9, 'y': 2, 'w': 9}) == {'w': 15, 'y': 9, 'x': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008543", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('hlpohaxxczlfek') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hlpohaxxczlfek') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008544", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([20, 23, 30, 40, 22]) == [20, 22, 23, 30, 40]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([20, 23, 30, 40, 22]) == [20, 22, 23, 30, 40]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 0.889} {"id": "stagec_008545", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['apple', 'coconut', 'coconut', 'banana', 'date', 'date', 'banana']) == {'a': ['apple'], 'c': ['coconut', 'coconut'], 'b': ['banana', 'banana'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'coconut', 'coconut', 'banana', 'date', 'date', 'banana']) == {'a': ['apple'], 'c': ['coconut', 'coconut'], 'b': ['banana', 'banana'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008546", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('cccddd') == 'c3d3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccddd') == 'c3d3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008547", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(35) == 13\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(35) == 13\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008548", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('eeadcea') == 'eadc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeadcea') == 'eadc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008549", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([23, 13, 22, 11]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 13, 22, 11]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008550", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([5, 5]) == [5, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 5]) == [5, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008551", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(72) == [2, 2, 2, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(72) == [2, 2, 2, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008552", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('bczyxxbz') == 'zbxxyzcb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bczyxxbz') == 'zbxxyzcb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008553", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('Dog Sat sun. sat, ran sun cat dog. sun. Sun') == {'dog': 2, 'sat': 2, 'sun': 4, 'ran': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog Sat sun. sat, ran sun cat dog. sun. Sun') == {'dog': 2, 'sat': 2, 'sun': 4, 'ran': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008554", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-7, -7, 9], [3, -7, 7], [4, -5, -8]], [[6, -9, 2], [2, 0, 8], [1, 1, -1]]) == [[-1, -16, 11], [5, -7, 15], [5, -4, -9]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, -7, 9], [3, -7, 7], [4, -5, -8]], [[6, -9, 2], [2, 0, 8], [1, 1, -1]]) == [[-1, -16, 11], [5, -7, 15], [5, -4, -9]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008555", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('aacdeed') == 'acde'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aacdeed') == 'acde'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008556", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CCCXXX') == 330\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXXX') == 330\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008557", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 9, 'c': 7}, 7) == {'b': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 9, 'c': 7}, 7) == {'b': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008558", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('sat the, Cat the, cat. sun, sat,') == {'sat': 2, 'the': 2, 'cat': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat the, Cat the, cat. sun, sat,') == {'sat': 2, 'the': 2, 'cat': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008559", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran sat ran ran cat sat, Dog') == {'ran': 3, 'sat': 2, 'cat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat ran ran cat sat, Dog') == {'ran': 3, 'sat': 2, 'cat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008560", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(92) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(92) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008561", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=184; mode=243') == {'port': '184', 'mode': '243'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=184; mode=243') == {'port': '184', 'mode': '243'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008562", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 89, 'd': 68, 'b': 0}) == {89: 'e', 68: 'd', 0: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 89, 'd': 68, 'b': 0}) == {89: 'e', 68: 'd', 0: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008563", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('88,b,\",aa\"') == ['88', 'b', ',aa']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('88,b,\",aa\"') == ['88', 'b', ',aa']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008564", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(19, 58) == 1102\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 58) == 1102\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008565", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(388)\nacc.deposit(118)\nacc.withdraw(52)\nacc.withdraw(510)\nassert acc.get_balance() == 506\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(388)\nacc.deposit(118)\nassert acc.get_balance() == 506\nacc.withdraw(52)\nassert acc.get_balance() == 454\nacc.withdraw(510)\nassert acc.get_balance() == 454\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008566", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(73); s.push(8); s.push(87)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(73); s.push(8); s.push(87)\nassert s.peek() == 87\nassert s.pop() == 87\nassert s.pop() == 8\nassert s.is_empty() == False\nassert s.pop() == 73\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008567", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[1, 5, 9], [6, 3, 5], [9, 3, 2]]) == [[1, 6, 9], [5, 3, 3], [9, 5, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[1, 5, 9], [6, 3, 5], [9, 3, 2]]) == [[1, 6, 9], [5, 3, 3], [9, 5, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008568", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([34, 11, 4, 46, 39, 39, 16, 5, 46, 33]) == [4, 5, 11, 16, 33, 34, 39, 39, 46, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([34, 11, 4, 46, 39, 39, 16, 5, 46, 33]) == [4, 5, 11, 16, 33, 34, 39, 39, 46, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008569", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(8, 4) == 4096\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(8, 4) == 4096\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008570", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([7, 3, 15, 40, 39, 31, 38, 13]) == [3, 7, 13, 15, 31, 38, 39, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 3, 15, 40, 39, 31, 38, 13]) == [3, 7, 13, 15, 31, 38, 39, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008571", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(57)\nacc.deposit(92)\nacc.withdraw(32)\nacc.withdraw(163)\nassert acc.get_balance() == 149\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(57)\nacc.deposit(92)\nassert acc.get_balance() == 149\nacc.withdraw(32)\nassert acc.get_balance() == 117\nacc.withdraw(163)\nassert acc.get_balance() == 117\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008572", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('bbaaaabbbb', 'abb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbaaaabbbb', 'abb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008573", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(388)\nacc.deposit(251)\nacc.withdraw(379)\nacc.withdraw(674)\nassert acc.get_balance() == 639\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(388)\nacc.deposit(251)\nassert acc.get_balance() == 639\nacc.withdraw(379)\nassert acc.get_balance() == 260\nacc.withdraw(674)\nassert acc.get_balance() == 260\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008574", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([23, 26, 37, 41, 55, 63, 70], 109) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([23, 26, 37, 41, 55, 63, 70], 109) == -1\nassert binary_search([23, 26, 37, 41, 55, 63, 70], 23) == 0\nassert binary_search([23, 26, 37, 41, 55, 63, 70], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008575", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive(0) == [0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive(0) == [0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008576", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([39, 29, 32, 34, 4, 0]) == [0, 4, 29, 32, 34, 39]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([39, 29, 32, 34, 4, 0]) == [0, 4, 29, 32, 34, 39]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008577", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[4, 4], [7, 8], [9]]) == [4, 4, 7, 8, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 4], [7, 8], [9]]) == [4, 4, 7, 8, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008578", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([3, 3, 1, 2, 3, 8, 6], 5) == [[3, 3, 1, 2, 3], [8, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 3, 1, 2, 3, 8, 6], 5) == [[3, 3, 1, 2, 3], [8, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008579", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('2') == 2\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('2') == 2\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008580", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('\",bbb,\",27,e,ab') == [',bbb,', '27', 'e', 'ab']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\",bbb,\",27,e,ab') == [',bbb,', '27', 'e', 'ab']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008581", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([4, 5, 8, 9, 20], [9]) == [4, 5, 8, 9, 9, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([4, 5, 8, 9, 20], [9]) == [4, 5, 8, 9, 9, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008582", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-2, 4, -1, -9]) == -8\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-2, 4, -1, -9]) == -8\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008583", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'y': 4, 'w': 2}, {'z': 8, 'w': 8}) == {'y': 4, 'w': 10, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 4, 'w': 2}, {'z': 8, 'w': 8}) == {'y': 4, 'w': 10, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008584", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-23, 22, -23, -27, -21]) == 22\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-23, 22, -23, -27, -21]) == 22\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008585", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([9, 5, [9, 4], [8, 8]]) == [9, 5, 9, 4, 8, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, 5, [9, 4], [8, 8]]) == [9, 5, 9, 4, 8, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008586", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([6, 7, 0, 4], 1) == [4, 6, 7, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 7, 0, 4], 1) == [4, 6, 7, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008587", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([24, 36, 38]) == [24, 36, 38]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 36, 38]) == [24, 36, 38]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008588", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h37m7s') == 16627\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h37m7s') == 16627\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008589", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([4, 2, 9, 2, 1, 5, 0, 7, 1, 6], 2) == [[4, 2], [9, 2], [1, 5], [0, 7], [1, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([4, 2, 9, 2, 1, 5, 0, 7, 1, 6], 2) == [[4, 2], [9, 2], [1, 5], [0, 7], [1, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008590", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('3h28m9s') == 12489\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h28m9s') == 12489\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008591", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['ccx', 'cc', 'ccy', 'ccxxz']) == 'cc'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ccx', 'cc', 'ccy', 'ccxxz']) == 'cc'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008592", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=868; mode=off; path=auto') == {'host': '868', 'mode': 'off', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=868; mode=off; path=auto') == {'host': '868', 'mode': 'off', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008593", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{](b{') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{](b{') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008594", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(316) == 'CCCXVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(316) == 'CCCXVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008595", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(48, 20) == 240\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(48, 20) == 240\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008596", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 3, 'z': 8}, {'w': 4, 'y': 1, 'x': 3}) == {'w': 7, 'z': 8, 'y': 1, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 3, 'z': 8}, {'w': 4, 'y': 1, 'x': 3}) == {'w': 7, 'z': 8, 'y': 1, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008597", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 4, 0], [0, 0, 1]], [[5, 0, 3], [0, 2, 5], [4, 2, 2]]) == [[5, 8, 23], [4, 2, 2]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4, 0], [0, 0, 1]], [[5, 0, 3], [0, 2, 5], [4, 2, 2]]) == [[5, 8, 23], [4, 2, 2]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008598", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[9, 8], [9]]) == 26\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 8], [9]]) == 26\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008599", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-7, 7], [4, 3]], [[-9, 2], [-3, -9]]) == [[-16, 9], [1, -6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-7, 7], [4, 3]], [[-9, 2], [-3, -9]]) == [[-16, 9], [1, -6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008600", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([1, [3]]) == [1, 3]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1, [3]]) == [1, 3]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008601", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['banana', 'cherry', 'coconut', 'cherry', 'berry', 'cherry', 'coconut']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'coconut', 'cherry', 'cherry', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'cherry', 'coconut', 'cherry', 'berry', 'cherry', 'coconut']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'coconut', 'cherry', 'cherry', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008602", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[2, 3, 0], [0, 0, 1], [3, 4, 3]], [[3, 4, 2], [0, 2, 5], [4, 2, 1]]) == [[6, 14, 19], [4, 2, 1], [21, 26, 29]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 3, 0], [0, 0, 1], [3, 4, 3]], [[3, 4, 2], [0, 2, 5], [4, 2, 1]]) == [[6, 14, 19], [4, 2, 1], [21, 26, 29]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008603", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(56); s.push(63); s.push(37)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(56); s.push(63); s.push(37)\nassert s.peek() == 37\nassert s.pop() == 37\nassert s.pop() == 63\nassert s.is_empty() == False\nassert s.pop() == 56\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008604", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 2, 'x': 6}, {'y': 3, 'x': 5}) == {'y': 5, 'x': 11}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2, 'x': 6}, {'y': 3, 'x': 5}) == {'y': 5, 'x': 11}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008605", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['cba', 'cbayxz']) == 'cba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cba', 'cbayxz']) == 'cba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008606", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(2610) == 9\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2610) == 9\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008607", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[1, 4], [0, 1]], [[0, 5, 3], [2, 1, 5]]) == [[8, 9, 23], [2, 1, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4], [0, 1]], [[0, 5, 3], [2, 1, 5]]) == [[8, 9, 23], [2, 1, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008608", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=402; path=180; mode=auto') == {'host': '402', 'path': '180', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=402; path=180; mode=auto') == {'host': '402', 'path': '180', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008609", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['apple', 'avocado', 'coconut', 'banana']) == {'a': ['apple', 'avocado'], 'c': ['coconut'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'avocado', 'coconut', 'banana']) == {'a': ['apple', 'avocado'], 'c': ['coconut'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008610", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([7], [4, 20]) == [4, 7, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([7], [4, 20]) == [4, 7, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008611", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(113) == 311\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(113) == 311\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008612", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('host=auto; port=on; path=on; mode=770') == {'host': 'auto', 'port': 'on', 'path': 'on', 'mode': '770'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=auto; port=on; path=on; mode=770') == {'host': 'auto', 'port': 'on', 'path': 'on', 'mode': '770'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008613", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([22, 1, 14]) == 14\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([22, 1, 14]) == 14\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008614", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(560) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(560) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008615", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(19, 114, 382) == 109\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(19, 114, 382) == 109\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008616", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(7658) == 8567\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7658) == 8567\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008617", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([21, 21, 43, 10, 42, 42, 41, 46, 36]) == [10, 21, 21, 36, 41, 42, 42, 43, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([21, 21, 43, 10, 42, 42, 41, 46, 36]) == [10, 21, 21, 36, 41, 42, 42, 43, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008618", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('(6 * 17)') == 102\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(6 * 17)') == 102\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008619", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaaabaaaaba', 'baaa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaabaaaaba', 'baaa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008620", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 4], [5, 4], [2, 2]], [[5, 1], [0, 2]]) == [[15, 11], [25, 13], [10, 6]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 4], [5, 4], [2, 2]], [[5, 1], [0, 2]]) == [[15, 11], [25, 13], [10, 6]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008621", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, -3, 2], [7, -6, 8], [-8, -5, 3], [-6, -8, -1]], [[3, 8, -5], [-2, 7, -3], [5, 2, -3], [-3, -6, -4]]) == [[9, 5, -3], [5, 1, 5], [-3, -3, 0], [-9, -14, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -3, 2], [7, -6, 8], [-8, -5, 3], [-6, -8, -1]], [[3, 8, -5], [-2, 7, -3], [5, 2, -3], [-3, -6, -4]]) == [[9, 5, -3], [5, 1, 5], [-3, -3, 0], [-9, -14, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008622", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'berry', 'date', 'banana', 'cherry', 'apple']) == {'a': ['apple', 'apple'], 'b': ['berry', 'banana'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'berry', 'date', 'banana', 'cherry', 'apple']) == {'a': ['apple', 'apple'], 'b': ['berry', 'banana'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008623", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('beccbb') == 'bec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beccbb') == 'bec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008624", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('abcccbcbbcca', 'accc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abcccbcbbcca', 'accc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008625", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-43, 25, 2, -38, 47]) == 47\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-43, 25, 2, -38, 47]) == 47\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008626", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([8, 8, 9, 9, 5, 2, 3, 2], [4, 8, 1]) == [8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 8, 9, 9, 5, 2, 3, 2], [4, 8, 1]) == [8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008627", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([9, 45, 1, 38, 36]) == [1, 9, 36, 38, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([9, 45, 1, 38, 36]) == [1, 9, 36, 38, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008628", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([24, 32, 46]) == [24, 32, 46]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 32, 46]) == [24, 32, 46]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008629", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([2, 6, 9, 3, -2, 6]) == [2, 8, 17, 20, 18, 24]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([2, 6, 9, 3, -2, 6]) == [2, 8, 17, 20, 18, 24]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008630", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(37)\nacc.deposit(220)\nacc.withdraw(208)\nacc.withdraw(437)\nassert acc.get_balance() == 257\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(37)\nacc.deposit(220)\nassert acc.get_balance() == 257\nacc.withdraw(208)\nassert acc.get_balance() == 49\nacc.withdraw(437)\nassert acc.get_balance() == 49\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008631", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(3780) == 61\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3780) == 61\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008632", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([0, 21, 29, 39, 52], 104) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 21, 29, 39, 52], 104) == -1\nassert binary_search([0, 21, 29, 39, 52], 0) == 0\nassert binary_search([0, 21, 29, 39, 52], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008633", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('port=off; host=on') == {'port': 'off', 'host': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=off; host=on') == {'port': 'off', 'host': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008634", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCXXXIII') == 233\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCXXXIII') == 233\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008635", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(18, 42, 694) == 256\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 42, 694) == 256\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008636", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 7, 'y': 3}, {'y': 7, 'w': 9}) == {'w': 16, 'y': 10}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7, 'y': 3}, {'y': 7, 'w': 9}) == {'w': 16, 'y': 10}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008637", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[5, 3], [3, 2], [0, 1]], [[3, 1, 3], [2, 3, 3]]) == [[21, 14, 24], [13, 9, 15], [2, 3, 3]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3], [3, 2], [0, 1]], [[3, 1, 3], [2, 3, 3]]) == [[21, 14, 24], [13, 9, 15], [2, 3, 3]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008638", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('host=765; path=125') == {'host': '765', 'path': '125'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=765; path=125') == {'host': '765', 'path': '125'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008639", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 1, 4, 2, 4]) == [5, 1, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 4, 2, 4]) == [5, 1, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008640", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([7]) == 7\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([7]) == 7\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008641", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('zfihaomwath') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('zfihaomwath') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008642", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('8') == 8\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('8') == 8\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008643", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 7, 'z': 1, 'y': 5}, {'x': 4, 'w': 7, 'y': 6}) == {'x': 11, 'z': 1, 'y': 11, 'w': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7, 'z': 1, 'y': 5}, {'x': 4, 'w': 7, 'y': 6}) == {'x': 11, 'z': 1, 'y': 11, 'w': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008644", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(11) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(11) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008645", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('adfdefa', 'adfdefab') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('adfdefa', 'adfdefab') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008646", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([10, 12, 44, 45, 51, 59, 91, 92], 118) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 12, 44, 45, 51, 59, 91, 92], 118) == -1\nassert binary_search([10, 12, 44, 45, 51, 59, 91, 92], 10) == 0\nassert binary_search([10, 12, 44, 45, 51, 59, 91, 92], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008647", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([0, 3, 11], [17]) == [0, 3, 11, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 3, 11], [17]) == [0, 3, 11, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008648", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[{()}]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[{()}]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008649", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(672310) == 819\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(672310) == 819\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008650", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h21m40s') == 12100\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h21m40s') == 12100\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008651", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([0, 4, 1, 4, 0, 8, 4, 9, 6], 3) == [[0, 4, 1], [4, 0, 8], [4, 9, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 4, 1, 4, 0, 8, 4, 9, 6], 3) == [[0, 4, 1], [4, 0, 8], [4, 9, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008652", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[0], [0], [8, 2]]) == [0, 0, 8, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0], [0], [8, 2]]) == [0, 0, 8, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008653", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([7, 8, [[9, 6, 7]]]) == [7, 8, 9, 6, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([7, 8, [[9, 6, 7]]]) == [7, 8, 9, 6, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008654", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[1, 5], [0, 3], [2, 0]], [[4, 5, 4], [1, 1, 1]]) == [[9, 10, 9], [3, 3, 3], [8, 10, 8]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 5], [0, 3], [2, 0]], [[4, 5, 4], [1, 1, 1]]) == [[9, 10, 9], [3, 3, 3], [8, 10, 8]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008655", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('babbbabb', 'ab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbbabb', 'ab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008656", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'date', 'apple', 'apple', 'cherry', 'coconut', 'berry']) == {'c': ['coconut', 'cherry', 'coconut'], 'd': ['date'], 'a': ['apple', 'apple'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'date', 'apple', 'apple', 'cherry', 'coconut', 'berry']) == {'c': ['coconut', 'cherry', 'coconut'], 'd': ['date'], 'a': ['apple', 'apple'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008657", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('e,c,\"aa,\",bbaa') == ['e', 'c', 'aa,', 'bbaa']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('e,c,\"aa,\",bbaa') == ['e', 'c', 'aa,', 'bbaa']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008658", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('cbbcbbcbbc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('cbbcbbcbbc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008659", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('abyc') == 'cyba'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('abyc') == 'cyba'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008660", "instruction": "Function reverse_string: input a string, output the same characters backwards.\n\nExample:\nassert reverse_string('bab') == 'bab'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bab') == 'bab'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008661", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(35) == [5, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(35) == [5, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008662", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 8, 7, 0, 5, 1, 2], [7, 8, 9, 6, 6, 4, 8, 8]) == [8, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 8, 7, 0, 5, 1, 2], [7, 8, 9, 6, 6, 4, 8, 8]) == [8, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008663", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('[]{}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008664", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(53, 54) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(53, 54) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008665", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('xnhya') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('xnhya') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008666", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('6 - 12 - (2 - 12)') == 4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('6 - 12 - (2 - 12)') == 4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008667", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('3h17m20s') == 11840\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h17m20s') == 11840\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008668", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('4') == 4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('4') == 4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008669", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5], [9, 2, 4]]) == [5, 9, 2, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], [9, 2, 4]]) == [5, 9, 2, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008670", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('dddddddd') == 'd8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddddd') == 'd8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008671", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([31, 42, 5, 30, 13]) == [5, 13, 30, 31, 42]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([31, 42, 5, 30, 13]) == [5, 13, 30, 31, 42]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008672", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 90, 'a': 26}) == {90: 'e', 26: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 90, 'a': 26}) == {90: 'e', 26: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008673", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('eedaac') == 'edac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eedaac') == 'edac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008674", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 3, 'x': 8}, {'w': 6}) == {'y': 3, 'x': 8, 'w': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3, 'x': 8}, {'w': 6}) == {'y': 3, 'x': 8, 'w': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008675", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCI') == 201\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCI') == 201\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008676", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(48, 29) == 1392\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(48, 29) == 1392\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008677", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(9, 12) == 36\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 12) == 36\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008678", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[9, 5, 2], [4, 7, 5]]) == [[9, 4], [5, 7], [2, 5]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[9, 5, 2], [4, 7, 5]]) == [[9, 4], [5, 7], [2, 5]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008679", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 0], [6, 2], [4, 6]]) == [[7, 6, 4], [0, 2, 6]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 0], [6, 2], [4, 6]]) == [[7, 6, 4], [0, 2, 6]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008680", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([20], [3, 11, 13]) == [3, 11, 13, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([20], [3, 11, 13]) == [3, 11, 13, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008681", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('ran sat, cat the, dog, Sun sun,') == {'ran': 1, 'sat': 1, 'cat': 1, 'the': 1, 'dog': 1, 'sun': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat, cat the, dog, Sun sun,') == {'ran': 1, 'sat': 1, 'cat': 1, 'the': 1, 'dog': 1, 'sun': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008682", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(364)\nacc.deposit(123)\nacc.withdraw(131)\nacc.withdraw(566)\nassert acc.get_balance() == 487\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(364)\nacc.deposit(123)\nassert acc.get_balance() == 487\nacc.withdraw(131)\nassert acc.get_balance() == 356\nacc.withdraw(566)\nassert acc.get_balance() == 356\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008683", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('ran dog. sat dog ran sun. dog!') == {'ran': 2, 'dog': 3, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog. sat dog ran sun. dog!') == {'ran': 2, 'dog': 3, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008684", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('user=270; host=318; mode=on') == {'user': '270', 'host': '318', 'mode': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=270; host=318; mode=on') == {'user': '270', 'host': '318', 'mode': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008685", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-7, 2, 5, -7, 4, -7, 5, 5]) == [-7, -5, 0, -7, -3, -10, -5, 0]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-7, 2, 5, -7, 4, -7, 5, 5]) == [-7, -5, 0, -7, -3, -10, -5, 0]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008686", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('czxafycda') == 'adcyfaxzc'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('czxafycda') == 'adcyfaxzc'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008687", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('dog sun, dog sat!') == {'dog': 2, 'sun': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sun, dog sat!') == {'dog': 2, 'sun': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008688", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('ecfaeed', 'adceeef') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ecfaeed', 'adceeef') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008689", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([1, 6, 6, 8, 7, 3, 1], [8, 6, 4, 6, 2, 5, 4]) == [6, 8]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 6, 6, 8, 7, 3, 1], [8, 6, 4, 6, 2, 5, 4]) == [6, 8]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008690", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gehbfg fggddac bbhhb begdehe cbeecbgg fcbhee') == 'cbeecbgg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gehbfg fggddac bbhhb begdehe cbeecbgg fcbhee') == 'cbeecbgg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008691", "instruction": "Implement lcm(a, b): LCM of two integers.\n\nExample:\nassert lcm(24, 8) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(24, 8) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008692", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[1, 4], [3, 1], [5, 0]], [[3, 1], [0, 3]]) == [[3, 13], [9, 6], [15, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 4], [3, 1], [5, 0]], [[3, 1], [0, 3]]) == [[3, 13], [9, 6], [15, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008693", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CXXIX') == 129\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXXIX') == 129\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008694", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 3, 2, 0, 5, 4]) == [0, 3, 2, 5, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 3, 2, 0, 5, 4]) == [0, 3, 2, 5, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008695", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 1, 2, 3]) == [3, 1, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 1, 2, 3]) == [3, 1, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008696", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(116) == [2, 2, 29]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(116) == [2, 2, 29]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008697", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[1], [3, 3], [6, 9]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[1], [3, 3], [6, 9]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008698", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([3, 3, 1, 5, 3, 0, 4, 1, 4, 0]) == [3, 1, 5, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 1, 5, 3, 0, 4, 1, 4, 0]) == [3, 1, 5, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008699", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 3, 8, 15, 18, 20], [2, 14]) == [1, 2, 3, 8, 14, 15, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 3, 8, 15, 18, 20], [2, 14]) == [1, 2, 3, 8, 14, 15, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008700", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{[]}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{[]}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008701", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('{(){}}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{(){}}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008702", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[2, 5, 5], [5, 0, 0]], [[1, 2, 1], [4, 3, 3], [1, 1, 0]]) == [[27, 24, 17], [5, 10, 5]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 5, 5], [5, 0, 0]], [[1, 2, 1], [4, 3, 3], [1, 1, 0]]) == [[27, 24, 17], [5, 10, 5]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008703", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(23) == 15\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(23) == 15\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008704", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('host=776; user=27') == {'host': '776', 'user': '27'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=776; user=27') == {'host': '776', 'user': '27'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008705", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('edccdbb') == 'edcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('edccdbb') == 'edcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008706", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(37); s.push(90); s.push(52)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(37); s.push(90); s.push(52)\nassert s.peek() == 52\nassert s.pop() == 52\nassert s.pop() == 90\nassert s.is_empty() == False\nassert s.pop() == 37\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008707", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 4, 5, 4, 0, 1, 4, 1]) == [4, 5, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 4, 5, 4, 0, 1, 4, 1]) == [4, 5, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008708", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-8, 4, 5]) == [-8, -4, 1]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, 4, 5]) == [-8, -4, 1]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008709", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(1842) == 'MDCCCXLII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1842) == 'MDCCCXLII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008710", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 7, 7, 8, 6], [7, 5, 4]) == [5, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 7, 7, 8, 6], [7, 5, 4]) == [5, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008711", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([0, -6]) == [0, -6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([0, -6]) == [0, -6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008712", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(29, 17) == 493\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(29, 17) == 493\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008713", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('dece', 'dcee') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('dece', 'dcee') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008714", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aabbbbbbbbbbccccccc') == 'a2b10c7'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aabbbbbbbbbbccccccc') == 'a2b10c7'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008715", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 96, 'c': 99, 'd': 15, 'a': 1}) == {96: 'e', 99: 'c', 15: 'd', 1: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 96, 'c': 99, 'd': 15, 'a': 1}) == {96: 'e', 99: 'c', 15: 'd', 1: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008716", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('35m11s') == 2111\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('35m11s') == 2111\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008717", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 1, 4, 4, 0, 0]) == [1, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 4, 4, 0, 0]) == [1, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008718", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('a e de') == 'A E De'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('a e de') == 'A E De'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008719", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([8, 7, -1, 5, -5]) == [8, 15, 14, 19, 14]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([8, 7, -1, 5, -5]) == [8, 15, 14, 19, 14]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008720", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cdebda') == 'cdeba'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdebda') == 'cdeba'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008721", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(13, 3) == 39\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(13, 3) == 39\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008722", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([1, 4, 3, 5, 4, 3, 5, 1]) == [1, 4, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 3, 5, 4, 3, 5, 1]) == [1, 4, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008723", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('bb') == 'b2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bb') == 'b2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008724", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(1245) == 35\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(1245) == 35\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008725", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('path=on; mode=auto; host=auto') == {'path': 'on', 'mode': 'auto', 'host': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; mode=auto; host=auto') == {'path': 'on', 'mode': 'auto', 'host': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008726", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 6, 4, 0, 3], [8, 9, 3, 2]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 6, 4, 0, 3], [8, 9, 3, 2]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008727", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(14) == [2, 7]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(14) == [2, 7]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008728", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(97) == 118\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(97) == 118\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008729", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([11, 24, 6, 28, 11, 10, 24, 10]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 24, 6, 28, 11, 10, 24, 10]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008730", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ecddaeca') == 'ecda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecddaeca') == 'ecda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008731", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ebdcdcdbbc') == 'ebdc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebdcdcdbbc') == 'ebdc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008732", "instruction": "Write a Python function longest_common_prefix(strs) returning the longest common prefix of the strings.\n\nExample:\nassert longest_common_prefix(['abyy', 'abxy']) == 'ab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abyy', 'abxy']) == 'ab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008733", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['e', 'a', 'e', 'b', 'e', 'a', 'd', 'b', 'd', 'a']) == {'e': 3, 'a': 3, 'b': 2, 'd': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'e', 'b', 'e', 'a', 'd', 'b', 'd', 'a']) == {'e': 3, 'a': 3, 'b': 2, 'd': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008734", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([4, 1, 0], [9, 3, 4, 0]) == [4, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 1, 0], [9, 3, 4, 0]) == [4, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008735", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(94)\nacc.deposit(20)\nacc.withdraw(90)\nacc.withdraw(175)\nassert acc.get_balance() == 114\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(94)\nacc.deposit(20)\nassert acc.get_balance() == 114\nacc.withdraw(90)\nassert acc.get_balance() == 24\nacc.withdraw(175)\nassert acc.get_balance() == 24\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008736", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('aadddddddddddddddddddddcccccccccb') == 'a2d21c9b1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aadddddddddddddddddddddcccccccccb') == 'a2d21c9b1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008737", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[1, -3, -3], [2, 1, 6], [-7, -3, 0]], [[3, -1, -8], [4, 2, 7], [-4, -6, 3]]) == [[4, -4, -11], [6, 3, 13], [-11, -9, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -3, -3], [2, 1, 6], [-7, -3, 0]], [[3, -1, -8], [4, 2, 7], [-4, -6, 3]]) == [[4, -4, -11], [6, 3, 13], [-11, -9, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008738", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aabaaabbabaaba', 'bb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaaabbabaaba', 'bb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008739", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(6337) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6337) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008740", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(629) == 'DCXXIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(629) == 'DCXXIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008741", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ffb', 'bff') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ffb', 'bff') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008742", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[8, 0, 1, 5], [4], [7], 4, [3, 7, 2, 5]]) == [8, 0, 1, 5, 4, 7, 4, 3, 7, 2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 0, 1, 5], [4], [7], 4, [3, 7, 2, 5]]) == [8, 0, 1, 5, 4, 7, 4, 3, 7, 2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008743", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[8, 4, 1, -3], [-9, -9, -5, 4]], [[-3, -4, 2, -1], [0, -2, 6, 1]]) == [[5, 0, 3, -4], [-9, -11, 1, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, 4, 1, -3], [-9, -9, -5, 4]], [[-3, -4, 2, -1], [0, -2, 6, 1]]) == [[5, 0, 3, -4], [-9, -11, 1, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008744", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{{}(())}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{{}(())}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008745", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['coconut', 'avocado', 'banana', 'avocado', 'coconut', 'apple', 'apple', 'coconut']) == {'c': ['coconut', 'coconut', 'coconut'], 'a': ['avocado', 'avocado', 'apple', 'apple'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'avocado', 'banana', 'avocado', 'coconut', 'apple', 'apple', 'coconut']) == {'c': ['coconut', 'coconut', 'coconut'], 'a': ['avocado', 'avocado', 'apple', 'apple'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008746", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('host=386; port=off; user=on; path=651') == {'host': '386', 'port': 'off', 'user': 'on', 'path': '651'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('host=386; port=off; user=on; path=651') == {'host': '386', 'port': 'off', 'user': 'on', 'path': '651'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008747", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('deeeb', 'ebede') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('deeeb', 'ebede') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008748", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([23, 23, 27, 29]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 23, 27, 29]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008749", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([24, 37, 1, 18, 32, 9, 13, 45, 49, 17, 10]) == [1, 9, 10, 13, 17, 18, 24, 32, 37, 45, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 37, 1, 18, 32, 9, 13, 45, 49, 17, 10]) == [1, 9, 10, 13, 17, 18, 24, 32, 37, 45, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008750", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([18, 2, 7, 22, 35, 44]) == [2, 7, 18, 22, 35, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([18, 2, 7, 22, 35, 44]) == [2, 7, 18, 22, 35, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008751", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'apple', 'coconut']) == {'d': ['date'], 'a': ['apple'], 'c': ['coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'coconut']) == {'d': ['date'], 'a': ['apple'], 'c': ['coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008752", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([8, 2, 8, 9], 1) == [9, 8, 2, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 2, 8, 9], 1) == [9, 8, 2, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008753", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('1h54m45s') == 6885\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h54m45s') == 6885\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008754", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(656) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(656) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008755", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbabaaaba', 'bb') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbabaaaba', 'bb') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008756", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('({b}}((}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('({b}}((}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008757", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog dog, sat dog The') == {'dog': 3, 'sat': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog dog, sat dog The') == {'dog': 3, 'sat': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008758", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(2068) == 16\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(2068) == 16\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008759", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1716) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1716) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008760", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([19, 27, 8]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([19, 27, 8]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008761", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cdaa', 'cdaac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cdaa', 'cdaac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008762", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(320) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(320) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008763", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('5h49m22s') == 20962\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h49m22s') == 20962\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008764", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 4, 'w': 1}, {'z': 8, 'w': 4}) == {'y': 4, 'w': 5, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 4, 'w': 1}, {'z': 8, 'w': 4}) == {'y': 4, 'w': 5, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008765", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([1, 4, 4, 10, 14], [11, 16, 18, 20]) == [1, 4, 4, 10, 11, 14, 16, 18, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 4, 4, 10, 14], [11, 16, 18, 20]) == [1, 4, 4, 10, 11, 14, 16, 18, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008766", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[5, 0, 4, 8], [3, 5, 7, 2]]) == [[5, 3], [0, 5], [4, 7], [8, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[5, 0, 4, 8], [3, 5, 7, 2]]) == [[5, 3], [0, 5], [4, 7], [8, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008767", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(8, 53) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(8, 53) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008768", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([25, 7, 40, 2, 19, 20, 22]) == [2, 7, 19, 20, 22, 25, 40]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([25, 7, 40, 2, 19, 20, 22]) == [2, 7, 19, 20, 22, 25, 40]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008769", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['c', 'd', 'c', 'b', 'b']) == {'c': 2, 'd': 1, 'b': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'd', 'c', 'b', 'b']) == {'c': 2, 'd': 1, 'b': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008770", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([41, 50, 71], 71) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([41, 50, 71], 71) == 2\nassert binary_search([41, 50, 71], 41) == 0\nassert binary_search([41, 50, 71], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008771", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 1, 1, 4, 0, 4, 3, 1]) == [4, 1, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 1, 1, 4, 0, 4, 3, 1]) == [4, 1, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008772", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(68); s.push(18); s.push(48)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(68); s.push(18); s.push(48)\nassert s.peek() == 48\nassert s.pop() == 48\nassert s.pop() == 18\nassert s.is_empty() == False\nassert s.pop() == 68\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008773", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([1]) == [1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1]) == [1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008774", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(7679) == 29\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7679) == 29\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008775", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([15, 30, 38, 0, 49, 13, 11, 18, 38, 0, 39]) == [0, 0, 11, 13, 15, 18, 30, 38, 38, 39, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([15, 30, 38, 0, 49, 13, 11, 18, 38, 0, 39]) == [0, 0, 11, 13, 15, 18, 30, 38, 38, 39, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008776", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 99, 'c': 83, 'a': 5}) == {99: 'd', 83: 'c', 5: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 99, 'c': 83, 'a': 5}) == {99: 'd', 83: 'c', 5: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008777", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([8, 2, -7, -4, -9]) == [8, 10, 3, -1, -10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([8, 2, -7, -4, -9]) == [8, 10, 3, -1, -10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008778", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(90); s.push(62); s.push(21)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(62); s.push(21)\nassert s.peek() == 21\nassert s.pop() == 21\nassert s.pop() == 62\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008779", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('dbac') == 'dbac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbac') == 'dbac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008780", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(19) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(19) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008781", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(1659) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1659) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008782", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(6, 154) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(6, 154) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008783", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([1, [[5, 9]], [9, 9, 2]]) == [1, 5, 9, 9, 9, 2]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([1, [[5, 9]], [9, 9, 2]]) == [1, 5, 9, 9, 9, 2]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008784", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('cabcbcccbbcbaa', 'bccc') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cabcbcccbbcbaa', 'bccc') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008785", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([1, 4, 0, 3]) == [1, 4, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 0, 3]) == [1, 4, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008786", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 63, 'f': 62}) == {63: 'c', 62: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 63, 'f': 62}) == {63: 'c', 62: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008787", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Python Code', 25) == 'Oxsgnm Bncd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Code', 25) == 'Oxsgnm Bncd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008788", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([5, 6, 9, 16, 16, 18], [1, 5, 6, 10]) == [1, 5, 5, 6, 6, 9, 10, 16, 16, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 6, 9, 16, 16, 18], [1, 5, 6, 10]) == [1, 5, 5, 6, 6, 9, 10, 16, 16, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008789", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 2, 'x': 4, 'w': 5}, {'z': 9, 'y': 1}) == {'y': 3, 'x': 4, 'w': 5, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 2, 'x': 4, 'w': 5}, {'z': 9, 'y': 1}) == {'y': 3, 'x': 4, 'w': 5, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008790", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([28, 10, 10, 16, 28]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 10, 10, 16, 28]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008791", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('2h29m51s') == 8991\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h29m51s') == 8991\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008792", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('sat! dog ran sat dog! sun dog, sat ran') == {'sat': 3, 'dog': 3, 'ran': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sat! dog ran sat dog! sun dog, sat ran') == {'sat': 3, 'dog': 3, 'ran': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008793", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([5, 18, 18, 8, 2, 5]) == 8\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 18, 18, 8, 2, 5]) == 8\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008794", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['apple', 'banana', 'apple', 'coconut', 'avocado', 'avocado', 'coconut', 'date']) == {'a': ['apple', 'apple', 'avocado', 'avocado'], 'b': ['banana'], 'c': ['coconut', 'coconut'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'banana', 'apple', 'coconut', 'avocado', 'avocado', 'coconut', 'date']) == {'a': ['apple', 'apple', 'avocado', 'avocado'], 'b': ['banana'], 'c': ['coconut', 'coconut'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008795", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('bexyef') == 'feyxeb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('bexyef') == 'feyxeb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008796", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 4, 2], 1) == [2, 2, 4]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 4, 2], 1) == [2, 2, 4]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008797", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(528779) == 727\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(528779) == 727\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008798", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('LI') == 51\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LI') == 51\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008799", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([3, 8, 9, 0, 0, 4, 7, 5, 4, 9, 5, 8], 4) == [[3, 8, 9, 0], [0, 4, 7, 5], [4, 9, 5, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 8, 9, 0, 0, 4, 7, 5, 4, 9, 5, 8], 4) == [[3, 8, 9, 0], [0, 4, 7, 5], [4, 9, 5, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008800", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([1, 6, 1, 8], [2, 3, 7, 1, 6, 1]) == [1, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 6, 1, 8], [2, 3, 7, 1, 6, 1]) == [1, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008801", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[aa') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[aa') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008802", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([1, [9, 2, 5]]) == [1, 9, 2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [9, 2, 5]]) == [1, 9, 2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008803", "instruction": "Create the function reverse_string(s) which reverses its string argument.\n\nExample:\nassert reverse_string('ddxzadzya') == 'ayzdazxdd'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('ddxzadzya') == 'ayzdazxdd'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008804", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([2, 8, 18, 18, 19], [3, 15]) == [2, 3, 8, 15, 18, 18, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 8, 18, 18, 19], [3, 15]) == [2, 3, 8, 15, 18, 18, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008805", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('{()}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{()}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008806", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([2, 2, 0, 3, 1]) == [2, 0, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 2, 0, 3, 1]) == [2, 0, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008807", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'e': 83, 'a': 98, 'b': 28}) == {83: 'e', 98: 'a', 28: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 83, 'a': 98, 'b': 28}) == {83: 'e', 98: 'a', 28: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008808", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([7, 27, 35, 46], 27) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 27, 35, 46], 27) == 1\nassert binary_search([7, 27, 35, 46], 7) == 0\nassert binary_search([7, 27, 35, 46], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008809", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([9, [0, 4, 3], [0, 4], 7]) == [9, 0, 4, 3, 0, 4, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [0, 4, 3], [0, 4], 7]) == [9, 0, 4, 3, 0, 4, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008810", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 3, 3, 3, 3]) == [5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 3, 3, 3, 3]) == [5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008811", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([5, 1, 5, 1, 9, 1, 5, 0, 1], 9) == [5, 1, 5, 1, 9, 1, 5, 0, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 1, 5, 1, 9, 1, 5, 0, 1], 9) == [5, 1, 5, 1, 9, 1, 5, 0, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008812", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(309)\nacc.deposit(293)\nacc.withdraw(547)\nacc.withdraw(724)\nassert acc.get_balance() == 602\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(309)\nacc.deposit(293)\nassert acc.get_balance() == 602\nacc.withdraw(547)\nassert acc.get_balance() == 55\nacc.withdraw(724)\nassert acc.get_balance() == 55\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008813", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(288) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(288) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008814", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('cbcccbbaaaaca', 'abcc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbcccbbaaaaca', 'abcc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008815", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(1760) == 671\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(1760) == 671\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008816", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 10, 'b': 10}, 5) == {'d': 10, 'b': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 10, 'b': 10}, 5) == {'d': 10, 'b': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008817", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[0, 1, 4], [4, 0, 4]], [[5, 4, 1], [2, 0, 0], [4, 0, 3]]) == [[18, 0, 12], [36, 16, 16]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 1, 4], [4, 0, 4]], [[5, 4, 1], [2, 0, 0], [4, 0, 3]]) == [[18, 0, 12], [36, 16, 16]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008818", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('adeaaca') == 'adec'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('adeaaca') == 'adec'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008819", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(0)\nacc.deposit(12)\nacc.withdraw(12)\nacc.withdraw(164)\nassert acc.get_balance() == 12\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(0)\nacc.deposit(12)\nassert acc.get_balance() == 12\nacc.withdraw(12)\nassert acc.get_balance() == 0\nacc.withdraw(164)\nassert acc.get_balance() == 0\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008820", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(6282) == 79\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6282) == 79\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008821", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([20, 10, 41, 38, 30]) == [10, 20, 30, 38, 41]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([20, 10, 41, 38, 30]) == [10, 20, 30, 38, 41]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008822", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(8) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(8) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008823", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(105) == 38\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(105) == 38\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008824", "instruction": "Implement flatten_recursive(x): deep flatten.\n\nExample:\nassert flatten_recursive([[2, 3, 7]]) == [2, 3, 7]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[2, 3, 7]]) == [2, 3, 7]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008825", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([2, 6, 6, 8, 3], 5) == [2, 6, 6, 8, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 6, 6, 8, 3], 5) == [2, 6, 6, 8, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008826", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[-3, -8], [1, 8]], [[2, 6], [-4, -2]]) == [[-1, -2], [-3, 6]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, -8], [1, 8]], [[2, 6], [-4, -2]]) == [[-1, -2], [-3, 6]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008827", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaa') == 'a8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaa') == 'a8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008828", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([7, 6, 0, 8, 2, 4, 1, 1], [4, 9, 6]) == [6, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 6, 0, 8, 2, 4, 1, 1], [4, 9, 6]) == [6, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008829", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([7, [9], 0]) == [7, 9, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([7, [9], 0]) == [7, 9, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008830", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('xyz', 4) == 'bcd'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 4) == 'bcd'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008831", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([25, 35, 55, 58, 79, 83, 94], 179) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([25, 35, 55, 58, 79, 83, 94], 179) == -1\nassert binary_search([25, 35, 55, 58, 79, 83, 94], 25) == 0\nassert binary_search([25, 35, 55, 58, 79, 83, 94], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008832", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'b': 5, 'e': 8, 'a': 6, 'c': 3}, 2) == {'b': 5, 'e': 8, 'a': 6, 'c': 3}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 5, 'e': 8, 'a': 6, 'c': 3}, 2) == {'b': 5, 'e': 8, 'a': 6, 'c': 3}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008833", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9228) == 96\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9228) == 96\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008834", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('the the cat ran the! Sat Dog cat dog.') == {'the': 3, 'cat': 2, 'ran': 1, 'sat': 1, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the cat ran the! Sat Dog cat dog.') == {'the': 3, 'cat': 2, 'ran': 1, 'sat': 1, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008835", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('htlaqlzepelpp') == 3\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('htlaqlzepelpp') == 3\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008836", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(5104) == 71\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5104) == 71\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008837", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('baaaaabbba', 'bbbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaaaabbba', 'bbbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008838", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-7, 20]) == 13\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-7, 20]) == 13\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008839", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat! cat dog. ran Cat sat') == {'cat': 3, 'dog': 1, 'ran': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat! cat dog. ran Cat sat') == {'cat': 3, 'dog': 1, 'ran': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008840", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([4, 49, 30, 1]) == [1, 4, 30, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([4, 49, 30, 1]) == [1, 4, 30, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008841", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(104) == [2, 2, 2, 13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(104) == [2, 2, 2, 13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008842", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5, 6], [4, 2], [4, 4, 0], 2, 4]) == [5, 6, 4, 2, 4, 4, 0, 2, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 6], [4, 2], [4, 4, 0], 2, 4]) == [5, 6, 4, 2, 4, 4, 0, 2, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008843", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(190, 70) == 10\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(190, 70) == 10\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008844", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([50, 45, 45, 30, 31, 16, 36, 39, 18]) == [16, 18, 30, 31, 36, 39, 45, 45, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([50, 45, 45, 30, 31, 16, 36, 39, 18]) == [16, 18, 30, 31, 36, 39, 45, 45, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008845", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(148) == 'CXLVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(148) == 'CXLVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008846", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([3, 4, 11, 38, 18, 14]) == [3, 4, 11, 14, 18, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([3, 4, 11, 38, 18, 14]) == [3, 4, 11, 14, 18, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008847", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('24m15s') == 1455\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('24m15s') == 1455\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008848", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([29, 25, 25, 21, 21, 19]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 25, 25, 21, 21, 19]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008849", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[8, -1, -2], [-7, 2, -9]], [[7, 7, 6], [-5, 7, 7]]) == [[15, 6, 4], [-12, 9, -2]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[8, -1, -2], [-7, 2, -9]], [[7, 7, 6], [-5, 7, 7]]) == [[15, 6, 4], [-12, 9, -2]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008850", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(15, 16) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(15, 16) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008851", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(8, 29) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(8, 29) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008852", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(549) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(549) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008853", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CDVII') == 407\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDVII') == 407\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008854", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(24) == [2, 2, 2, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(24) == [2, 2, 2, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008855", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([0, -2, -6]) == [0, -2, -8]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([0, -2, -6]) == [0, -2, -8]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008856", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([31, 5, 22, 23, 42, 31, 48, 26]) == [5, 22, 23, 26, 31, 31, 42, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([31, 5, 22, 23, 42, 31, 48, 26]) == [5, 22, 23, 26, 31, 31, 42, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008857", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('18,3,aaca') == ['18', '3', 'aaca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('18,3,aaca') == ['18', '3', 'aaca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008858", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([28, 28, 11, 18, 4]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([28, 28, 11, 18, 4]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008859", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('Dog the Sat ran! dog dog ran Cat the ran,') == {'dog': 3, 'the': 2, 'sat': 1, 'ran': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Dog the Sat ran! dog dog ran Cat the ran,') == {'dog': 3, 'the': 2, 'sat': 1, 'ran': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008860", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('dcebbebb') == 'dceb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcebbebb') == 'dceb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008861", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('21m47s') == 1307\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('21m47s') == 1307\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008862", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[7], 1]) == [7, 1]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7], 1]) == [7, 1]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008863", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-30, 48, 46, 41, 18, 21, 28, -27]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-30, 48, 46, 41, 18, 21, 28, -27]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008864", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(3774) == 'MMMDCCLXXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3774) == 'MMMDCCLXXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008865", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([2, 5, 4, 5, 2, 2, 0, 0]) == [2, 5, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 5, 4, 5, 2, 2, 0, 0]) == [2, 5, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008866", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(27451) == 165\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(27451) == 165\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008867", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 5, 2, 1]) == [2, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 5, 2, 1]) == [2, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008868", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('abbcxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('abbcxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008869", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'y': 4, 'w': 5}, {'w': 9, 'z': 9, 'y': 8}) == {'x': 3, 'y': 12, 'w': 14, 'z': 9}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'y': 4, 'w': 5}, {'w': 9, 'z': 9, 'y': 8}) == {'x': 3, 'y': 12, 'w': 14, 'z': 9}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008870", "instruction": "Implement list_sum(nums): sum all elements.\n\nExample:\nassert list_sum([2, -11]) == -9\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([2, -11]) == -9\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008871", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('ynhdobq') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('ynhdobq') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008872", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(268)\nacc.deposit(251)\nacc.withdraw(480)\nacc.withdraw(530)\nassert acc.get_balance() == 519\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(268)\nacc.deposit(251)\nassert acc.get_balance() == 519\nacc.withdraw(480)\nassert acc.get_balance() == 39\nacc.withdraw(530)\nassert acc.get_balance() == 39\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008873", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('{{}}') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{{}}') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008874", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([5, 6, 16, 17], [1, 6, 14]) == [1, 5, 6, 6, 14, 16, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([5, 6, 16, 17], [1, 6, 14]) == [1, 5, 6, 6, 14, 16, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008875", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'w': 2}, {'w': 8, 'y': 2}) == {'w': 10, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 2}, {'w': 8, 'y': 2}) == {'w': 10, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008876", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([4, 3, 3, 3, 5, 1, 3, 0, 2, 0, 3]) == [4, 3, 5, 1, 0, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 3, 3, 3, 5, 1, 3, 0, 2, 0, 3]) == [4, 3, 5, 1, 0, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008877", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=on; path=869; user=486; port=464') == {'mode': 'on', 'path': '869', 'user': '486', 'port': '464'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=on; path=869; user=486; port=464') == {'mode': 'on', 'path': '869', 'user': '486', 'port': '464'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008878", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([17, 19, 19], [1, 2, 8, 16]) == [1, 2, 8, 16, 17, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([17, 19, 19], [1, 2, 8, 16]) == [1, 2, 8, 16, 17, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008879", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('fczad') == 'dazcf'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('fczad') == 'dazcf'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008880", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=auto; user=on; host=689') == {'mode': 'auto', 'user': 'on', 'host': '689'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=auto; user=on; host=689') == {'mode': 'auto', 'user': 'on', 'host': '689'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008881", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(3867) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(3867) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008882", "instruction": "Create function count_vowels(s) that returns how many of aeiou appear in s.\n\nExample:\nassert count_vowels('pznc') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('pznc') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008883", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('XCVII') == 97\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('XCVII') == 97\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008884", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-17, -24, 44]) == 44\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-17, -24, 44]) == 44\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008885", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([15, 15, 16, 29, 5, 15, 3]) == 16\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 15, 16, 29, 5, 15, 3]) == 16\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008886", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([6, 9, 5, 6, 7, 4, 9], 6) == [9, 5, 6, 7, 4, 9, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 9, 5, 6, 7, 4, 9], 6) == [9, 5, 6, 7, 4, 9, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008887", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('sun Cat sun sat Dog the,') == {'sun': 2, 'cat': 1, 'sat': 1, 'dog': 1, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun Cat sun sat Dog the,') == {'sun': 2, 'cat': 1, 'sat': 1, 'dog': 1, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008888", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 2}, {'w': 4}) == {'x': 2, 'w': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 2}, {'w': 4}) == {'x': 2, 'w': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008889", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 1, 3, 6, 4, 0, 9], [1, 0, 3, 6, 8]) == [0, 1, 3, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 1, 3, 6, 4, 0, 9], [1, 0, 3, 6, 8]) == [0, 1, 3, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008890", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CDXXXVII') == 437\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CDXXXVII') == 437\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008891", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=497; user=on') == {'mode': '497', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=497; user=on') == {'mode': '497', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008892", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ceceae') == 'cea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceceae') == 'cea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008893", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(3, 98, 164) == 9\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(3, 98, 164) == 9\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008894", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['date', 'cherry', 'cherry', 'coconut', 'banana']) == {'d': ['date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'cherry', 'cherry', 'coconut', 'banana']) == {'d': ['date'], 'c': ['cherry', 'cherry', 'coconut'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008895", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('dog sun, sat sat! the dog, the dog Ran the.') == {'dog': 3, 'sun': 1, 'sat': 2, 'the': 3, 'ran': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog sun, sat sat! the dog, the dog Ran the.') == {'dog': 3, 'sun': 1, 'sat': 2, 'the': 3, 'ran': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008896", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([14, 19, 23, 10, 20, 20, 10, 19]) == 20\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 19, 23, 10, 20, 20, 10, 19]) == 20\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008897", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('e,aeca,\"a,b\",a,84') == ['e', 'aeca', 'a,b', 'a', '84']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('e,aeca,\"a,b\",a,84') == ['e', 'aeca', 'a,b', 'a', '84']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008898", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccbbbb') == 'c4b4'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccbbbb') == 'c4b4'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008899", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([1, 10]) == 11\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([1, 10]) == 11\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008900", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('byfbaedfcx') == 'xcfdeabfyb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('byfbaedfcx') == 'xcfdeabfyb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008901", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('udzk') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('udzk') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008902", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('afdayed') == 'deyadfa'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('afdayed') == 'deyadfa'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008903", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([5, 5, 5, 27, 7, 7]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([5, 5, 5, 27, 7, 7]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008904", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(21); s.push(73); s.push(16)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(21); s.push(73); s.push(16)\nassert s.peek() == 16\nassert s.pop() == 16\nassert s.pop() == 73\nassert s.is_empty() == False\nassert s.pop() == 21\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008905", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(141, 122) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(141, 122) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008906", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('babbbabababaa', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbbabababaa', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008907", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 4, 2, 2, 5, 2, 3, 4]) == [1, 4, 2, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 2, 2, 5, 2, 3, 4]) == [1, 4, 2, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008908", "instruction": "Create recursive function pow_recursive(a, e): a to the e.\n\nExample:\nassert pow_recursive(3, 11) == 177147\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(3, 11) == 177147\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008909", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([0, 8, 6, 8, 4, 9, 7, 1], [2, 5, 6, 2, 0, 4, 4, 2]) == [0, 6, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 8, 6, 8, 4, 9, 7, 1], [2, 5, 6, 2, 0, 4, 4, 2]) == [0, 6, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008910", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([1, [9, 2], [8, 5, 3]]) == 28\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([1, [9, 2], [8, 5, 3]]) == 28\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008911", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['cbbxzy', 'cbbyx', 'cbbzx']) == 'cbb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cbbxzy', 'cbbyx', 'cbbzx']) == 'cbb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008912", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('5h29m10s') == 19750\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h29m10s') == 19750\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008913", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([18, 7, 12, 0, 49, 13, 5, 26]) == [0, 5, 7, 12, 13, 18, 26, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([18, 7, 12, 0, 49, 13, 5, 26]) == [0, 5, 7, 12, 13, 18, 26, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008914", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('[]{}()') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[]{}()') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008915", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(18, 24) == 72\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(18, 24) == 72\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008916", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([1, 3, 5, 7, 18, 19], [8, 19, 19]) == [1, 3, 5, 7, 8, 18, 19, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 3, 5, 7, 18, 19], [8, 19, 19]) == [1, 3, 5, 7, 8, 18, 19, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008917", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(40, 76) == 4\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(40, 76) == 4\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008918", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CLXXV') == 175\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLXXV') == 175\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008919", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'e': 6, 'a': 7}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 6, 'a': 7}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008920", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([0, 3, 4, -14, -14]) == -21\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([0, 3, 4, -14, -14]) == -21\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008921", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([6]) == [6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([6]) == [6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008922", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dbdbbadaadcdaa') == 'dbac'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dbdbbadaadcdaa') == 'dbac'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008923", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('acaccccccbabbcab', 'bab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('acaccccccbabbcab', 'bab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008924", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 4}, {'y': 5, 'z': 8}) == {'z': 12, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4}, {'y': 5, 'z': 8}) == {'z': 12, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008925", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('xfxfbruz') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('xfxfbruz') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008926", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(62); s.push(81); s.push(59)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(62); s.push(81); s.push(59)\nassert s.peek() == 59\nassert s.pop() == 59\nassert s.pop() == 81\nassert s.is_empty() == False\nassert s.pop() == 62\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008927", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(5181) == 71\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5181) == 71\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008928", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('orujapxeozsqai') == 7\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('orujapxeozsqai') == 7\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008929", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dcbe') == 'dcbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcbe') == 'dcbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008930", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 1, 1, 3, 4, 3, 2, 1]) == [5, 1, 3, 4, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 1, 3, 4, 3, 2, 1]) == [5, 1, 3, 4, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008931", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Code', 23) == 'Zlab'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 23) == 'Zlab'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008932", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'f': 86, 'c': 4}) == {86: 'f', 4: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 86, 'c': 4}) == {86: 'f', 4: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008933", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('the dog. ran Ran sat. Cat sat the ran Cat') == {'the': 2, 'dog': 1, 'ran': 3, 'sat': 2, 'cat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the dog. ran Ran sat. Cat sat the ran Cat') == {'the': 2, 'dog': 1, 'ran': 3, 'sat': 2, 'cat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008934", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=139; port=on; host=159; path=339') == {'mode': '139', 'port': 'on', 'host': '159', 'path': '339'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=139; port=on; host=159; path=339') == {'mode': '139', 'port': 'on', 'host': '159', 'path': '339'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008935", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('abc', 17) == 'rst'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 17) == 'rst'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008936", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(23, 23) == 23\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(23, 23) == 23\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008937", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 3, 'w': 4, 'z': 8}, {'x': 3}) == {'y': 3, 'w': 4, 'z': 8, 'x': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 3, 'w': 4, 'z': 8}, {'x': 3}) == {'y': 3, 'w': 4, 'z': 8, 'x': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008938", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('dddddddaaaadddddddddaaaaa') == 'd7a4d9a5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddddaaaadddddddddaaaaa') == 'd7a4d9a5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008939", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 2, 5, 0, 2, 4, 0, 4, 5, 4, 1, 3]) == [0, 2, 5, 4, 1, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 5, 0, 2, 4, 0, 4, 5, 4, 1, 3]) == [0, 2, 5, 4, 1, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008940", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(983) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(983) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008941", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(26, 101, 292) == 44\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(26, 101, 292) == 44\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008942", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1806) == 'MDCCCVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1806) == 'MDCCCVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008943", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 8, 'w': 9, 'y': 6}, {'z': 2, 'w': 7, 'y': 2}) == {'x': 8, 'w': 16, 'y': 8, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 8, 'w': 9, 'y': 6}, {'z': 2, 'w': 7, 'y': 2}) == {'x': 8, 'w': 16, 'y': 8, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008944", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('dgha gheb') == 'dgha'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('dgha gheb') == 'dgha'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008945", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([14, 14, 10, 24, 15, 15, 14]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 14, 10, 24, 15, 15, 14]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008946", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(380)\nacc.deposit(245)\nacc.withdraw(445)\nacc.withdraw(748)\nassert acc.get_balance() == 625\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(380)\nacc.deposit(245)\nassert acc.get_balance() == 625\nacc.withdraw(445)\nassert acc.get_balance() == 180\nacc.withdraw(748)\nassert acc.get_balance() == 180\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008947", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(495) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(495) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_008948", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([3, 1, 3, 7, 1, 1, 4, 1, 7], 4) == [[3, 1, 3, 7], [1, 1, 4, 1], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 1, 3, 7, 1, 1, 4, 1, 7], 4) == [[3, 1, 3, 7], [1, 1, 4, 1], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008949", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('abc', 24) == 'yza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 24) == 'yza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008950", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('bdc', 'bdcb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bdc', 'bdcb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008951", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(4963) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4963) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008952", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 93, 'a': 64, 'b': 82, 'e': 20}) == {93: 'f', 64: 'a', 82: 'b', 20: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 93, 'a': 64, 'b': 82, 'e': 20}) == {93: 'f', 64: 'a', 82: 'b', 20: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008953", "instruction": "Write cumulative_sum(nums) -> list: prefix sums.\n\nExample:\nassert cumulative_sum([5, -8, 9, 4, -5, 5, -4]) == [5, -3, 6, 10, 5, 10, 6]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([5, -8, 9, 4, -5, 5, -4]) == [5, -3, 6, 10, 5, 10, 6]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008954", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[5], 6]) == 11\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[5], 6]) == 11\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008955", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(170800) == 413\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(170800) == 413\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008956", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[-8, -6], [2, 0]], [[9, -5], [6, 5]]) == [[1, -11], [8, 5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -6], [2, 0]], [[9, -5], [6, 5]]) == [[1, -11], [8, 5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008957", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h7m4s') == 11224\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h7m4s') == 11224\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008958", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 60, 'f': 77}) == {60: 'e', 77: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 60, 'f': 77}) == {60: 'e', 77: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008959", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'c': 6, 'e': 2, 'b': 5, 'a': 0}, 7) == {}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 6, 'e': 2, 'b': 5, 'a': 0}, 7) == {}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008960", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(63)\nacc.deposit(189)\nacc.withdraw(181)\nacc.withdraw(326)\nassert acc.get_balance() == 252\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(63)\nacc.deposit(189)\nassert acc.get_balance() == 252\nacc.withdraw(181)\nassert acc.get_balance() == 71\nacc.withdraw(326)\nassert acc.get_balance() == 71\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008961", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[7, 9, 5, 3], [8, 4, 7, 1], [4, 4, 7, 6], [5, 6, 2, 8]]) == [[7, 8, 4, 5], [9, 4, 4, 6], [5, 7, 7, 2], [3, 1, 6, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 9, 5, 3], [8, 4, 7, 1], [4, 4, 7, 6], [5, 6, 2, 8]]) == [[7, 8, 4, 5], [9, 4, 4, 6], [5, 7, 7, 2], [3, 1, 6, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008962", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(13, 110, 947) == 914\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(13, 110, 947) == 914\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008963", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([7, 8, 0, 1, 5, 1, 5, 0, 8], 5) == [[7, 8, 0, 1, 5], [1, 5, 0, 8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 8, 0, 1, 5, 1, 5, 0, 8], 5) == [[7, 8, 0, 1, 5], [1, 5, 0, 8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008964", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['cherry', 'apple', 'coconut', 'apple', 'cherry', 'berry']) == {'c': ['cherry', 'coconut', 'cherry'], 'a': ['apple', 'apple'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'apple', 'coconut', 'apple', 'cherry', 'berry']) == {'c': ['cherry', 'coconut', 'cherry'], 'a': ['apple', 'apple'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008965", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('((2 + 4) + 19)') == 25\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('((2 + 4) + 19)') == 25\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_008966", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5, 7, 0], 7, [7, 6, 7], 8]) == [5, 7, 0, 7, 7, 6, 7, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 7, 0], 7, [7, 6, 7], 8]) == [5, 7, 0, 7, 7, 6, 7, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008967", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(3, 20) == 60\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(3, 20) == 60\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008968", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(5248) == 72\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(5248) == 72\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008969", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'c': 65, 'e': 52, 'a': 0, 'b': 34}) == {65: 'c', 52: 'e', 0: 'a', 34: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 65, 'e': 52, 'a': 0, 'b': 34}) == {65: 'c', 52: 'e', 0: 'a', 34: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008970", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9385) == 96\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9385) == 96\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008971", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMDCCLXXXVII') == 2787\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMDCCLXXXVII') == 2787\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008972", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(83) == 110\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(83) == 110\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008973", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'apple', 'date', 'coconut']) == {'b': ['banana'], 'c': ['coconut', 'coconut'], 'a': ['apple'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'apple', 'date', 'coconut']) == {'b': ['banana'], 'c': ['coconut', 'coconut'], 'a': ['apple'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008974", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(2698) == 'MMDCXCVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2698) == 'MMDCXCVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008975", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'c': 71, 'a': 63, 'e': 23, 'b': 70, 'd': 82}) == {71: 'c', 63: 'a', 23: 'e', 70: 'b', 82: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 71, 'a': 63, 'e': 23, 'b': 70, 'd': 82}) == {71: 'c', 63: 'a', 23: 'e', 70: 'b', 82: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008976", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['cyx', 'cxx', 'cx']) == 'c'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['cyx', 'cxx', 'cx']) == 'c'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008977", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(912896) == 955\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(912896) == 955\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008978", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(24); s.push(96); s.push(89)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(24); s.push(96); s.push(89)\nassert s.peek() == 89\nassert s.pop() == 89\nassert s.pop() == 96\nassert s.is_empty() == False\nassert s.pop() == 24\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008979", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 6}, {'y': 6, 'z': 2}) == {'w': 6, 'y': 6, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 6}, {'y': 6, 'z': 2}) == {'w': 6, 'y': 6, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008980", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[7, 8, 0, 1], [1, 1, 7, 3], [7, 0, 8, 7]]) == [[7, 1, 7], [8, 1, 0], [0, 7, 8], [1, 3, 7]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 8, 0, 1], [1, 1, 7, 3], [7, 0, 8, 7]]) == [[7, 1, 7], [8, 1, 0], [0, 7, 8], [1, 3, 7]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008981", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([0, 9, 8, 3, 4, 0, 7, 8, 9], 9) == [0, 9, 8, 3, 4, 0, 7, 8, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 9, 8, 3, 4, 0, 7, 8, 9], 9) == [0, 9, 8, 3, 4, 0, 7, 8, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008982", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([22, 1, 44, 45, 33, 3, 24, 28, 13, 24, 41, 11]) == [1, 3, 11, 13, 22, 24, 24, 28, 33, 41, 44, 45]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([22, 1, 44, 45, 33, 3, 24, 28, 13, 24, 41, 11]) == [1, 3, 11, 13, 22, 24, 24, 28, 33, 41, 44, 45]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008983", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([5, 4, 3, 1, 5, 4, 3]) == [5, 4, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 4, 3, 1, 5, 4, 3]) == [5, 4, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008984", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ddebbca') == 'debca'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddebbca') == 'debca'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008985", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(2124) == 46\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(2124) == 46\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008986", "instruction": "Implement is_palindrome(s): check whether the string reads the same forwards and backwards.\n\nExample:\nassert is_palindrome('aaccaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaccaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008987", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008988", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([11, 45, 12, 46, 0]) == [0, 11, 12, 45, 46]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([11, 45, 12, 46, 0]) == [0, 11, 12, 45, 46]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008989", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbbbbbbbbb') == 'b12'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbbbbbb') == 'b12'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008990", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 9, 'e': 2, 'c': 29, 'f': 53}) == {9: 'b', 2: 'e', 29: 'c', 53: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 9, 'e': 2, 'c': 29, 'f': 53}) == {9: 'b', 2: 'e', 29: 'c', 53: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008991", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aabaabaaabaaba', 'abaa') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabaabaaabaaba', 'abaa') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_008992", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([12, 15], [1, 2, 5, 7, 11, 17]) == [1, 2, 5, 7, 11, 12, 15, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([12, 15], [1, 2, 5, 7, 11, 17]) == [1, 2, 5, 7, 11, 12, 15, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_008993", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-12, 11, -18]) == -19\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-12, 11, -18]) == -19\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008994", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([40, 35, 8, 14, 44, 6, 35, 35, 13, 17]) == [6, 8, 13, 14, 17, 35, 35, 35, 40, 44]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([40, 35, 8, 14, 44, 6, 35, 35, 13, 17]) == [6, 8, 13, 14, 17, 35, 35, 35, 40, 44]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008995", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens(']}}}(bb') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(']}}}(bb') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008996", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCCVI') == 306\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCVI') == 306\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_008997", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 25, 'a': 93, 'd': 3, 'f': 89, 'c': 27}) == {25: 'b', 93: 'a', 3: 'd', 89: 'f', 27: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 25, 'a': 93, 'd': 3, 'f': 89, 'c': 27}) == {25: 'b', 93: 'a', 3: 'd', 89: 'f', 27: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008998", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(23); s.push(77); s.push(91)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(23); s.push(77); s.push(91)\nassert s.peek() == 91\nassert s.pop() == 91\nassert s.pop() == 77\nassert s.is_empty() == False\nassert s.pop() == 23\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_008999", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 19, 'e': 11, 'c': 98}) == {19: 'b', 11: 'e', 98: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 19, 'e': 11, 'c': 98}) == {19: 'b', 11: 'e', 98: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009000", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cbabbba', 'cbabbbac') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cbabbba', 'cbabbbac') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009001", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'e': 58, 'f': 25, 'c': 16}) == {58: 'e', 25: 'f', 16: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 58, 'f': 25, 'c': 16}) == {58: 'e', 25: 'f', 16: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009002", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([5, 1, [7]]) == [5, 1, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 1, [7]]) == [5, 1, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009003", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ceabdcce') == 'ceabd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ceabdcce') == 'ceabd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009004", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['date', 'apple', 'coconut', 'apple', 'berry', 'berry']) == {'d': ['date'], 'a': ['apple', 'apple'], 'c': ['coconut'], 'b': ['berry', 'berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'apple', 'coconut', 'apple', 'berry', 'berry']) == {'d': ['date'], 'a': ['apple', 'apple'], 'c': ['coconut'], 'b': ['berry', 'berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009005", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MXCV') == 1095\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MXCV') == 1095\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009006", "instruction": "Write a Python function bubble_sort(nums) sorting the list with bubble sort (return a new list).\n\nExample:\nassert bubble_sort([24, 11, 28, 18, 1, 34, 11, 32]) == [1, 11, 11, 18, 24, 28, 32, 34]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([24, 11, 28, 18, 1, 34, 11, 32]) == [1, 11, 11, 18, 24, 28, 32, 34]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009007", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code Code', 6) == 'Iujk Iujk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code Code', 6) == 'Iujk Iujk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009008", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([12, 38, 38]) == [12, 38, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([12, 38, 38]) == [12, 38, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009009", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[9], [4, 1], 1]]) == 15\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[9], [4, 1], 1]]) == 15\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009010", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(1513) == 'MDXIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(1513) == 'MDXIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009011", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 3}, {'y': 8}) == {'x': 3, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3}, {'y': 8}) == {'x': 3, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009012", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(104)\nacc.deposit(76)\nacc.withdraw(101)\nacc.withdraw(361)\nassert acc.get_balance() == 180\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(104)\nacc.deposit(76)\nassert acc.get_balance() == 180\nacc.withdraw(101)\nassert acc.get_balance() == 79\nacc.withdraw(361)\nassert acc.get_balance() == 79\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009013", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 0, 5], [0, 7, 2, 5, 4, 5, 0]) == [0, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 0, 5], [0, 7, 2, 5, 4, 5, 0]) == [0, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009014", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('cat sun, Sat dog! sun') == {'cat': 1, 'sun': 2, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sun, Sat dog! sun') == {'cat': 1, 'sun': 2, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009015", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('abbbaaaabaaba', 'aa') == 4\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abbbaaaabaaba', 'aa') == 4\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009016", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(295)\nacc.deposit(209)\nacc.withdraw(98)\nacc.withdraw(603)\nassert acc.get_balance() == 504\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(295)\nacc.deposit(209)\nassert acc.get_balance() == 504\nacc.withdraw(98)\nassert acc.get_balance() == 406\nacc.withdraw(603)\nassert acc.get_balance() == 406\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009017", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bbbbdddddddddddbbb') == 'b4d11b3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbdddddddddddbbb') == 'b4d11b3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009018", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([2, 46, 27, 11]) == [2, 11, 27, 46]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([2, 46, 27, 11]) == [2, 11, 27, 46]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009019", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-2, -7, -7], [-8, -5, 1]], [[-7, -6, -1], [-6, 7, -8]]) == [[-9, -13, -8], [-14, 2, -7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-2, -7, -7], [-8, -5, 1]], [[-7, -6, -1], [-6, 7, -8]]) == [[-9, -13, -8], [-14, 2, -7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009020", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(8); s.push(69); s.push(13)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(8); s.push(69); s.push(13)\nassert s.peek() == 13\nassert s.pop() == 13\nassert s.pop() == 69\nassert s.is_empty() == False\nassert s.pop() == 8\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009021", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(692) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(692) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009022", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(32); s.push(90); s.push(82)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(32); s.push(90); s.push(82)\nassert s.peek() == 82\nassert s.pop() == 82\nassert s.pop() == 90\nassert s.is_empty() == False\nassert s.pop() == 32\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009023", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([43, 35, 20, 11, 21, 45, 49, 15, 23, 4, 10, 3]) == [3, 4, 10, 11, 15, 20, 21, 23, 35, 43, 45, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([43, 35, 20, 11, 21, 45, 49, 15, 23, 4, 10, 3]) == [3, 4, 10, 11, 15, 20, 21, 23, 35, 43, 45, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009024", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([19, 31, 10, 20, 0, 9, 33, 25, 21, 20]) == [0, 9, 10, 19, 20, 20, 21, 25, 31, 33]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([19, 31, 10, 20, 0, 9, 33, 25, 21, 20]) == [0, 9, 10, 19, 20, 20, 21, 25, 31, 33]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009025", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('bbbaabbaabbab', 'aa') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbaabbaabbab', 'aa') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009026", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([27, 29, 27]) == [27, 27, 29]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([27, 29, 27]) == [27, 27, 29]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "standard", "mutation_score": 0.889} {"id": "stagec_009027", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('eeedcb') == 'edcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeedcb') == 'edcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009028", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(418)\nacc.deposit(16)\nacc.withdraw(383)\nacc.withdraw(602)\nassert acc.get_balance() == 434\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(418)\nacc.deposit(16)\nassert acc.get_balance() == 434\nacc.withdraw(383)\nassert acc.get_balance() == 51\nacc.withdraw(602)\nassert acc.get_balance() == 51\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009029", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([7, -18, 16, 9]) == 14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([7, -18, 16, 9]) == 14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009030", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'a': 13, 'c': 72, 'b': 41}) == {13: 'a', 72: 'c', 41: 'b'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 13, 'c': 72, 'b': 41}) == {13: 'a', 72: 'c', 41: 'b'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009031", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(38, 100, 201) == 163\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(38, 100, 201) == 163\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009032", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([5, 7, 0, 4, 7, 2, 9], 4) == [[5, 7, 0, 4], [7, 2, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([5, 7, 0, 4, 7, 2, 9], 4) == [[5, 7, 0, 4], [7, 2, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009033", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 8, 8, 1, 9, 7, 0], [7, 3, 6, 9, 5, 4, 6]) == [9, 7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 8, 8, 1, 9, 7, 0], [7, 3, 6, 9, 5, 4, 6]) == [9, 7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009034", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([28, 14, 16, 5, 28, 6, 0]) == [0, 5, 6, 14, 16, 28, 28]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([28, 14, 16, 5, 28, 6, 0]) == [0, 5, 6, 14, 16, 28, 28]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009035", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('18m44s') == 1124\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('18m44s') == 1124\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009036", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([17, 8, 8, 15, 15, 15]) == 15\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([17, 8, 8, 15, 15, 15]) == 15\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009037", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([47, 27, 18]) == [18, 27, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([47, 27, 18]) == [18, 27, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009038", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(96) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(96) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009039", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('2h24m26s') == 8666\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h24m26s') == 8666\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009040", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('port=on; path=179') == {'port': 'on', 'path': '179'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; path=179') == {'port': 'on', 'path': '179'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009041", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(12) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(12) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009042", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([30, 48, 16, 48]) == [16, 30, 48, 48]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([30, 48, 16, 48]) == [16, 30, 48, 48]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009043", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abaabaaaaab', 'aaa') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abaabaaaaab', 'aaa') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009044", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(7664) == 4667\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7664) == 4667\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009045", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[5, 3], [1, 2], [0, 2]], [[5, 0, 5], [1, 0, 0]]) == [[28, 0, 25], [7, 0, 5], [2, 0, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3], [1, 2], [0, 2]], [[5, 0, 5], [1, 0, 0]]) == [[28, 0, 25], [7, 0, 5], [2, 0, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009046", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3m42s') == 222\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3m42s') == 222\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009047", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ecebdebc') == 'ecbd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecebdebc') == 'ecbd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009048", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('port=30; mode=off; user=119; path=34') == {'port': '30', 'mode': 'off', 'user': '119', 'path': '34'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=30; mode=off; user=119; path=34') == {'port': '30', 'mode': 'off', 'user': '119', 'path': '34'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009049", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'y': 7, 'z': 1}, {'w': 8}) == {'y': 7, 'z': 1, 'w': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 7, 'z': 1}, {'w': 8}) == {'y': 7, 'z': 1, 'w': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009050", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(83); s.push(66); s.push(91)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(83); s.push(66); s.push(91)\nassert s.peek() == 91\nassert s.pop() == 91\nassert s.pop() == 66\nassert s.is_empty() == False\nassert s.pop() == 83\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009051", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([15, 18, 50, 60, 67, 72, 78, 81, 99], 184) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 18, 50, 60, 67, 72, 78, 81, 99], 184) == -1\nassert binary_search([15, 18, 50, 60, 67, 72, 78, 81, 99], 15) == 0\nassert binary_search([15, 18, 50, 60, 67, 72, 78, 81, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009052", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('ccbbaabbcc') == True\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('ccbbaabbcc') == True\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009053", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(94) == [2, 47]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(94) == [2, 47]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009054", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(65); s.push(79); s.push(60)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(65); s.push(79); s.push(60)\nassert s.peek() == 60\nassert s.pop() == 60\nassert s.pop() == 79\nassert s.is_empty() == False\nassert s.pop() == 65\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009055", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(6284) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6284) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009056", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[0, 3], [2, 5]], [[1, 3, 2], [1, 2, 3]]) == [[3, 6, 9], [7, 16, 19]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 3], [2, 5]], [[1, 3, 2], [1, 2, 3]]) == [[3, 6, 9], [7, 16, 19]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009057", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([0, 2, 4, 1, 0, 5, 1, 1, 2, 0, 2]) == [0, 2, 4, 1, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 2, 4, 1, 0, 5, 1, 1, 2, 0, 2]) == [0, 2, 4, 1, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009058", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(627241) == 791\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(627241) == 791\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009059", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([46, 35, 40, 15, 36, 26, 8, 11, 48, 42]) == [8, 11, 15, 26, 35, 36, 40, 42, 46, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 35, 40, 15, 36, 26, 8, 11, 48, 42]) == [8, 11, 15, 26, 35, 36, 40, 42, 46, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009060", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(302) == 'CCCII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(302) == 'CCCII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009061", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([22, 9, 10, 17, 29, 25, 30]) == [9, 10, 17, 22, 25, 29, 30]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([22, 9, 10, 17, 29, 25, 30]) == [9, 10, 17, 22, 25, 29, 30]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009062", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('a]b)](}}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('a]b)](}}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009063", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(50) == [2, 5, 5]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(50) == [2, 5, 5]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009064", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('bddaaeabe') == 'bdae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bddaaeabe') == 'bdae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009065", "instruction": "Write matrix_transpose(m) -> list of lists: transpose.\n\nExample:\nassert matrix_transpose([[2, 7, 0], [0, 2, 8], [9, 0, 3], [7, 5, 2]]) == [[2, 0, 9, 7], [7, 2, 0, 5], [0, 8, 3, 2]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[2, 7, 0], [0, 2, 8], [9, 0, 3], [7, 5, 2]]) == [[2, 0, 9, 7], [7, 2, 0, 5], [0, 8, 3, 2]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009066", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(9567) == 97\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9567) == 97\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009067", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([0, 8]) == 8\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, 8]) == 8\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009068", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h20m5s') == 8405\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h20m5s') == 8405\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009069", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([8, 1, 0, 0, 1, 1, 3, 8, 2, 8, 0, 7, 7, 0], 2) == [[8, 1], [0, 0], [1, 1], [3, 8], [2, 8], [0, 7], [7, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 1, 0, 0, 1, 1, 3, 8, 2, 8, 0, 7, 7, 0], 2) == [[8, 1], [0, 0], [1, 1], [3, 8], [2, 8], [0, 7], [7, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009070", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([15, -10, 10, 18, -3, -5]) == 25\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([15, -10, 10, 18, -3, -5]) == 25\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009071", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(55, 24) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(55, 24) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009072", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([0, 1, 1, 2, 1, 2, 7], 5) == [[0, 1, 1, 2, 1], [2, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 1, 1, 2, 1, 2, 7], 5) == [[0, 1, 1, 2, 1], [2, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009073", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 5}, {'z': 2}) == {'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 5}, {'z': 2}) == {'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009074", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'w': 7}, {'z': 4, 'x': 1}) == {'w': 7, 'z': 4, 'x': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 7}, {'z': 4, 'x': 1}) == {'w': 7, 'z': 4, 'x': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009075", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('hgbbfh adb dd hgehcbg d ddbcgbd') == 'hgehcbg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('hgbbfh adb dd hgehcbg d ddbcgbd') == 'hgehcbg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009076", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('57,dac') == ['57', 'dac']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('57,dac') == ['57', 'dac']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009077", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('34,71') == ['34', '71']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('34,71') == ['34', '71']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009078", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat! Sat Sun sat. cat the the Sat sat') == {'cat': 2, 'sat': 4, 'sun': 1, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat! Sat Sun sat. cat the the Sat sat') == {'cat': 2, 'sat': 4, 'sun': 1, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009079", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(461) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(461) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009080", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([4, 2, 1, 2, 0, 3, 3, 0, 0]) == [4, 2, 1, 0, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 1, 2, 0, 3, 3, 0, 0]) == [4, 2, 1, 0, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009081", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('cat! Cat the! cat cat') == {'cat': 4, 'the': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat! Cat the! cat cat') == {'cat': 4, 'the': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009082", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(39, 30) == 390\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(39, 30) == 390\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009083", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(21, 4) == 84\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(21, 4) == 84\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009084", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('accadebceddbc') == 'acdeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('accadebceddbc') == 'acdeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009085", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9151) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9151) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009086", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([23, 14, 18]) == 18\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([23, 14, 18]) == 18\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009087", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('{){a({') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{){a({') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009088", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 90, 'a': 36, 'e': 96, 'c': 42, 'f': 61}) == {90: 'b', 36: 'a', 96: 'e', 42: 'c', 61: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 90, 'a': 36, 'e': 96, 'c': 42, 'f': 61}) == {90: 'b', 36: 'a', 96: 'e', 42: 'c', 61: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009089", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([4, 47, 38]) == [4, 38, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([4, 47, 38]) == [4, 38, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009090", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(22); s.push(40); s.push(93)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(22); s.push(40); s.push(93)\nassert s.peek() == 93\nassert s.pop() == 93\nassert s.pop() == 40\nassert s.is_empty() == False\nassert s.pop() == 22\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009091", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([12, 50, 5, 26, 0, 26, 32, 26, 17, 14, 44, 2]) == [0, 2, 5, 12, 14, 17, 26, 26, 26, 32, 44, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([12, 50, 5, 26, 0, 26, 32, 26, 17, 14, 44, 2]) == [0, 2, 5, 12, 14, 17, 26, 26, 26, 32, 44, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009092", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(19) == 20\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(19) == 20\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009093", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([5, 1, 3, 3, 3, 1, 2]) == [5, 1, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 3, 3, 3, 1, 2]) == [5, 1, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009094", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(350)\nacc.deposit(98)\nacc.withdraw(265)\nacc.withdraw(602)\nassert acc.get_balance() == 448\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(350)\nacc.deposit(98)\nassert acc.get_balance() == 448\nacc.withdraw(265)\nassert acc.get_balance() == 183\nacc.withdraw(602)\nassert acc.get_balance() == 183\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009095", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([22, 19, 33, 9, 18, 8, 48, 11]) == [8, 9, 11, 18, 19, 22, 33, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 19, 33, 9, 18, 8, 48, 11]) == [8, 9, 11, 18, 19, 22, 33, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009096", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([7, 4, 9, 8, 0, 4, 3, 9, 9, 6], 9) == [4, 9, 8, 0, 4, 3, 9, 9, 6, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 4, 9, 8, 0, 4, 3, 9, 9, 6], 9) == [4, 9, 8, 0, 4, 3, 9, 9, 6, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009097", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 11) == 'ijk'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 11) == 'ijk'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009098", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(23); s.push(86); s.push(13)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(23); s.push(86); s.push(13)\nassert s.peek() == 13\nassert s.pop() == 13\nassert s.pop() == 86\nassert s.is_empty() == False\nassert s.pop() == 23\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009099", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([6, 44, 15, 20, 18, 47, 40, 21, 47]) == [6, 15, 18, 20, 21, 40, 44, 47, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([6, 44, 15, 20, 18, 47, 40, 21, 47]) == [6, 15, 18, 20, 21, 40, 44, 47, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009100", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([29, 24, 29, 6, 17, 24, 24]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 24, 29, 6, 17, 24, 24]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009101", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('sun sat the ran ran. Sun ran!') == {'sun': 2, 'sat': 1, 'the': 1, 'ran': 3}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sat the ran ran. Sun ran!') == {'sun': 2, 'sat': 1, 'the': 1, 'ran': 3}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009102", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('ccccccddddddddd') == 'c6d9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccddddddddd') == 'c6d9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009103", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(162) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(162) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009104", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(839112) == 916\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(839112) == 916\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009105", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('a ccdfehd ecbbfhca egehhd g fhgdabgf') == 'ecbbfhca'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('a ccdfehd ecbbfhca egehhd g fhgdabgf') == 'ecbbfhca'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009106", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ebecbeebeec') == 'ebc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebecbeebeec') == 'ebc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009107", "instruction": "Write balanced_parens(s) -> bool: balanced parentheses.\n\nExample:\nassert balanced_parens('(){}[][]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(){}[][]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009108", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(7986) == 6897\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7986) == 6897\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009109", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(154) == 'CLIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(154) == 'CLIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009110", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 5}, {'w': 4, 'z': 3, 'y': 5}) == {'w': 9, 'z': 3, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5}, {'w': 4, 'z': 3, 'y': 5}) == {'w': 9, 'z': 3, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009111", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(333) == [3, 3, 37]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(333) == [3, 3, 37]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009112", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 9}, {'z': 7}) == {'y': 9, 'z': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 9}, {'z': 7}) == {'y': 9, 'z': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009113", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 5, 2, 1, 5, 4, 4]) == [1, 5, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 2, 1, 5, 4, 4]) == [1, 5, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009114", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(46, 12, 24) == 16\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(46, 12, 24) == 16\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009115", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('cadbcbe') == 'cadbe'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cadbcbe') == 'cadbe'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009116", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(9867) == 30\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9867) == 30\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009117", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('user=90; path=auto') == {'user': '90', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=90; path=auto') == {'user': '90', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009118", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('ccccccaaaaaaaa') == 'c6a8'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ccccccaaaaaaaa') == 'c6a8'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009119", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 1, 3, 1, 2, 4, 3, 5]) == [2, 1, 3, 4, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 1, 3, 1, 2, 4, 3, 5]) == [2, 1, 3, 4, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009120", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([6, 6, 4, 7, 8, 4, 9, 2], 6) == [4, 7, 8, 4, 9, 2, 6, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 6, 4, 7, 8, 4, 9, 2], 6) == [4, 7, 8, 4, 9, 2, 6, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009121", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([14, 16, 17], [15]) == [14, 15, 16, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([14, 16, 17], [15]) == [14, 15, 16, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009122", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cacd') == 'cad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cacd') == 'cad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009123", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(7, 39) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(7, 39) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009124", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 51, 'f': 49, 'b': 81, 'e': 11, 'c': 7}) == {51: 'a', 49: 'f', 81: 'b', 11: 'e', 7: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 51, 'f': 49, 'b': 81, 'e': 11, 'c': 7}) == {51: 'a', 49: 'f', 81: 'b', 11: 'e', 7: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009125", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(272)\nacc.deposit(156)\nacc.withdraw(48)\nacc.withdraw(491)\nassert acc.get_balance() == 428\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(272)\nacc.deposit(156)\nassert acc.get_balance() == 428\nacc.withdraw(48)\nassert acc.get_balance() == 380\nacc.withdraw(491)\nassert acc.get_balance() == 380\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009126", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('qqug') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('qqug') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009127", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([13, 66, 78], 120) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 66, 78], 120) == -1\nassert binary_search([13, 66, 78], 13) == 0\nassert binary_search([13, 66, 78], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009128", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['c', 'b', 'e', 'e', 'c', 'b', 'e']) == {'c': 2, 'b': 2, 'e': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'b', 'e', 'e', 'c', 'b', 'e']) == {'c': 2, 'b': 2, 'e': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009129", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(299) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(299) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009130", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(594) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(594) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009131", "instruction": "Write a Python function is_palindrome(s) that returns True if s is a palindrome, else False.\n\nExample:\nassert is_palindrome('aaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('aaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009132", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([21, 11, 20, 20, 19, 21, 11, 29, 17, 26]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([21, 11, 20, 20, 19, 21, 11, 29, 17, 26]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009133", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[1, 0], [2, 3], [2, 5]], [[5, 2, 5], [5, 0, 5]]) == [[5, 2, 5], [25, 4, 25], [35, 4, 35]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 0], [2, 3], [2, 5]], [[5, 2, 5], [5, 0, 5]]) == [[5, 2, 5], [25, 4, 25], [35, 4, 35]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009134", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([2, 8]) == 8\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([2, 8]) == 8\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009135", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[[2, 6, 8], 6]]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[2, 6, 8], 6]]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009136", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(9, 6) == 18\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(9, 6) == 18\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009137", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('1 + (6 + 12)') == 19\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1 + (6 + 12)') == 19\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009138", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['ccaxyx', 'ccaz']) == 'cca'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ccaxyx', 'ccaz']) == 'cca'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009139", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([13, -21, -1, -28]) == 13\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([13, -21, -1, -28]) == 13\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009140", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(4740) == 68\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(4740) == 68\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009141", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(715) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(715) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009142", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(1675) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1675) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009143", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'y': 1, 'z': 7, 'w': 9}, {'w': 8}) == {'y': 1, 'z': 7, 'w': 17}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 1, 'z': 7, 'w': 9}, {'w': 8}) == {'y': 1, 'z': 7, 'w': 17}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009144", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([9, 32, 63], 103) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([9, 32, 63], 103) == -1\nassert binary_search([9, 32, 63], 9) == 0\nassert binary_search([9, 32, 63], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009145", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('efcfd', 'efcdf') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('efcfd', 'efcdf') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009146", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9126) == 95\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9126) == 95\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009147", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('2h57m15s') == 10635\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h57m15s') == 10635\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009148", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5, 5, 1], [3, 1, 6], 1, 4]) == [5, 5, 1, 3, 1, 6, 1, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 5, 1], [3, 1, 6], 1, 4]) == [5, 5, 1, 3, 1, 6, 1, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009149", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(244) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(244) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009150", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('e eccbg edb fhgcgfc ahbge') == 'fhgcgfc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('e eccbg edb fhgcgfc ahbge') == 'fhgcgfc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009151", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([35, 23, 47, 5, 44]) == [5, 23, 35, 44, 47]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([35, 23, 47, 5, 44]) == [5, 23, 35, 44, 47]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009152", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('qoiygzrzsofnpo') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('qoiygzrzsofnpo') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009153", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('[][{}[]]') == True\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[][{}[]]') == True\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009154", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('caaacbbcacccacaa', 'acc') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('caaacbbcacccacaa', 'acc') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009155", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(4230) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4230) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009156", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(20) == 7\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(20) == 7\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009157", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('cccccccccdddddd') == 'c9d6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccccccccdddddd') == 'c9d6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009158", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[0, 3], [4, 1], [3, 0]]) == [[0, 4, 3], [3, 1, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 3], [4, 1], [3, 0]]) == [[0, 4, 3], [3, 1, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009159", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(123, 96) == 3\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(123, 96) == 3\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009160", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([8, 2, 23, 2, 19, 23, 23]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([8, 2, 23, 2, 19, 23, 23]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009161", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-8, 6, 1], [-3, 1, 0], [-2, 4, 9]], [[0, -3, 1], [8, 2, -4], [-7, -8, 4]]) == [[-8, 3, 2], [5, 3, -4], [-9, -4, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 6, 1], [-3, 1, 0], [-2, 4, 9]], [[0, -3, 1], [8, 2, -4], [-7, -8, 4]]) == [[-8, 3, 2], [5, 3, -4], [-9, -4, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009162", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('18m39s') == 1119\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('18m39s') == 1119\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009163", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([9, 25, 50, 2, 42, 17, 13]) == [2, 9, 13, 17, 25, 42, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 25, 50, 2, 42, 17, 13]) == [2, 9, 13, 17, 25, 42, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009164", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('(19 * 13 - 1)') == 246\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(19 * 13 - 1)') == 246\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009165", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([17, -3, 18, 4]) == 36\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([17, -3, 18, 4]) == 36\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009166", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(7766) == 88\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7766) == 88\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009167", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(322) == 'CCCXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(322) == 'CCCXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009168", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('33m14s') == 1994\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('33m14s') == 1994\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009169", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(73); s.push(57); s.push(4)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(73); s.push(57); s.push(4)\nassert s.peek() == 4\nassert s.pop() == 4\nassert s.pop() == 57\nassert s.is_empty() == False\nassert s.pop() == 73\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009170", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([6, [1, 6, 8, 9], [3, 0]]) == [6, 1, 6, 8, 9, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [1, 6, 8, 9], [3, 0]]) == [6, 1, 6, 8, 9, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009171", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'cherry', 'cherry', 'berry', 'berry', 'berry', 'avocado']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry', 'berry', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'cherry', 'cherry', 'berry', 'berry', 'berry', 'avocado']) == {'c': ['coconut', 'cherry', 'cherry'], 'b': ['banana', 'berry', 'berry', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009172", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(1, 0) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 0) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009173", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('cat the cat! sun dog ran sat cat the! ran') == {'cat': 3, 'the': 2, 'sun': 1, 'dog': 1, 'ran': 2, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat the cat! sun dog ran sat cat the! ran') == {'cat': 3, 'the': 2, 'sun': 1, 'dog': 1, 'ran': 2, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009174", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9, 9, 4], 7, 5]) == [9, 9, 4, 7, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 9, 4], 7, 5]) == [9, 9, 4, 7, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009175", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(177) == [3, 59]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(177) == [3, 59]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009176", "instruction": "Create function dict_filter(d, t): filtered dict.\n\nExample:\nassert dict_filter({'e': 0, 'a': 9, 'c': 6, 'b': 3}, 5) == {'a': 9, 'c': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 0, 'a': 9, 'c': 6, 'b': 3}, 5) == {'a': 9, 'c': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009177", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('(9 - 6 - 14)') == -11\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(9 - 6 - 14)') == -11\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009178", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('5h50m2s') == 21002\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('5h50m2s') == 21002\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009179", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(34, 50) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(34, 50) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009180", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[6, 9, 9], [6, 1, 8]]) == [[6, 6], [9, 1], [9, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 9, 9], [6, 1, 8]]) == [[6, 6], [9, 1], [9, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009181", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('abbbde beddd') == 'Abbbde Beddd'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('abbbde beddd') == 'Abbbde Beddd'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009182", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([41, 31, 29, 35, 46, 36, 32, 47]) == [29, 31, 32, 35, 36, 41, 46, 47]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([41, 31, 29, 35, 46, 36, 32, 47]) == [29, 31, 32, 35, 36, 41, 46, 47]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009183", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MXV') == 1015\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MXV') == 1015\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009184", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([9, 9, 6, 8, 6], 5) == [[9, 9, 6, 8, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 9, 6, 8, 6], 5) == [[9, 9, 6, 8, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009185", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(8954) == 26\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(8954) == 26\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009186", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([1, 7, 16], [0, 3, 8, 11, 16]) == [0, 1, 3, 7, 8, 11, 16, 16]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 7, 16], [0, 3, 8, 11, 16]) == [0, 1, 3, 7, 8, 11, 16, 16]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009187", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('sun sun, sat dog') == {'sun': 2, 'sat': 1, 'dog': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('sun sun, sat dog') == {'sun': 2, 'sat': 1, 'dog': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009188", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('aabdbdd') == 'abd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aabdbdd') == 'abd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009189", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'e': 9, 'd': 4, 'b': 6}, 4) == {'e': 9, 'b': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'e': 9, 'd': 4, 'b': 6}, 4) == {'e': 9, 'b': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009190", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 8, 'w': 6}, {'x': 2, 'w': 7, 'y': 6}) == {'z': 8, 'w': 13, 'x': 2, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 8, 'w': 6}, {'x': 2, 'w': 7, 'y': 6}) == {'z': 8, 'w': 13, 'x': 2, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009191", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([8, 2, 8, 5, 5, 1, 3], [6, 5, 8, 2, 2, 6, 3]) == [8, 2, 5, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([8, 2, 8, 5, 5, 1, 3], [6, 5, 8, 2, 2, 6, 3]) == [8, 2, 5, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009192", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([15, 18, 30, 34, 45, 66, 87, 88], 123) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 18, 30, 34, 45, 66, 87, 88], 123) == -1\nassert binary_search([15, 18, 30, 34, 45, 66, 87, 88], 15) == 0\nassert binary_search([15, 18, 30, 34, 45, 66, 87, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009193", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([5, [2, 4], [8, 7], [7, 7, 5]]) == [5, 2, 4, 8, 7, 7, 7, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [2, 4], [8, 7], [7, 7, 5]]) == [5, 2, 4, 8, 7, 7, 7, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009194", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['coconut', 'cherry', 'banana', 'coconut', 'date']) == {'c': ['coconut', 'cherry', 'coconut'], 'b': ['banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'cherry', 'banana', 'coconut', 'date']) == {'c': ['coconut', 'cherry', 'coconut'], 'b': ['banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009195", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'z': 1}) == {'y': 6, 'z': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'z': 1}) == {'y': 6, 'z': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009196", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(9239) == 23\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9239) == 23\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009197", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(91); s.push(92); s.push(98)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(91); s.push(92); s.push(98)\nassert s.peek() == 98\nassert s.pop() == 98\nassert s.pop() == 92\nassert s.is_empty() == False\nassert s.pop() == 91\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009198", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'c': 14, 'a': 80, 'f': 82, 'e': 33}) == {14: 'c', 80: 'a', 82: 'f', 33: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'c': 14, 'a': 80, 'f': 82, 'e': 33}) == {14: 'c', 80: 'a', 82: 'f', 33: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009199", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([8, 2, 10, -17, -10]) == -7\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([8, 2, 10, -17, -10]) == -7\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009200", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(17, 25) == 425\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(17, 25) == 425\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009201", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cebddbaeabb') == 'cebda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cebddbaeabb') == 'cebda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009202", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('ebab,c,bad') == ['ebab', 'c', 'bad']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('ebab,c,bad') == ['ebab', 'c', 'bad']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009203", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[4, 2], [3, 4]], [[3, 3], [4, 4]]) == [[20, 20], [25, 25]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2], [3, 4]], [[3, 3], [4, 4]]) == [[20, 20], [25, 25]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009204", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 2, 'x': 8}, {'w': 2, 'z': 3, 'y': 1}) == {'z': 5, 'x': 8, 'w': 2, 'y': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2, 'x': 8}, {'w': 2, 'z': 3, 'y': 1}) == {'z': 5, 'x': 8, 'w': 2, 'y': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009205", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('eb b b') == 'Eb B B'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('eb b b') == 'Eb B B'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009206", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('byzxf') == 'fxzyb'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('byzxf') == 'fxzyb'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009207", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('World Code', 7) == 'Dvysk Jvkl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Code', 7) == 'Dvysk Jvkl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009208", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([0, 1, 1, 8, 12, 15, 17], [3, 11, 13, 14, 20]) == [0, 1, 1, 3, 8, 11, 12, 13, 14, 15, 17, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 1, 8, 12, 15, 17], [3, 11, 13, 14, 20]) == [0, 1, 1, 3, 8, 11, 12, 13, 14, 15, 17, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009209", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(96) == [2, 2, 2, 2, 2, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(96) == [2, 2, 2, 2, 2, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009210", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('aaacbaccba', 'aabb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaacbaccba', 'aabb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009211", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(337)\nacc.deposit(26)\nacc.withdraw(141)\nacc.withdraw(385)\nassert acc.get_balance() == 363\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(337)\nacc.deposit(26)\nassert acc.get_balance() == 363\nacc.withdraw(141)\nassert acc.get_balance() == 222\nacc.withdraw(385)\nassert acc.get_balance() == 222\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009212", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(15, 32) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(15, 32) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009213", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([22, 50, 24, 19, 13, 27, 16, 17]) == [13, 16, 17, 19, 22, 24, 27, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 50, 24, 19, 13, 27, 16, 17]) == [13, 16, 17, 19, 22, 24, 27, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009214", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 2}, {'y': 2}) == {'z': 2, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 2}, {'y': 2}) == {'z': 2, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009215", "instruction": "Implement merge_sort(nums): merge sort.\n\nExample:\nassert merge_sort([23, 40, 18, 25, 27, 25, 22, 5, 48, 25, 28]) == [5, 18, 22, 23, 25, 25, 25, 27, 28, 40, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([23, 40, 18, 25, 27, 25, 22, 5, 48, 25, 28]) == [5, 18, 22, 23, 25, 25, 25, 27, 28, 40, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009216", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 3, 1, 0]) == [1, 3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 3, 1, 0]) == [1, 3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009217", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=on; host=670') == {'port': 'on', 'host': '670'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=on; host=670') == {'port': 'on', 'host': '670'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009218", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([0, 7, 0], [8, 7, 3, 9]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 7, 0], [8, 7, 3, 9]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009219", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(499) == 48\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(499) == 48\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009220", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('13') == 13\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('13') == 13\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009221", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(327) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(327) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009222", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 26, 2, 8, 8, 2]) == 8\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 26, 2, 8, 8, 2]) == 8\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009223", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'e': 42, 'd': 14}) == {42: 'e', 14: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 42, 'd': 14}) == {42: 'e', 14: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009224", "instruction": "Define flatten_recursive recursively flattening all levels.\n\nExample:\nassert flatten_recursive([[[8, 9]]]) == [8, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[[8, 9]]]) == [8, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009225", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('49m13s') == 2953\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('49m13s') == 2953\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009226", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([9, 2, 6, 9, 6, 9], [4, 0, 9, 1, 3]) == [9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([9, 2, 6, 9, 6, 9], [4, 0, 9, 1, 3]) == [9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009227", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=on; host=off; mode=76') == {'path': 'on', 'host': 'off', 'mode': '76'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; host=off; mode=76') == {'path': 'on', 'host': 'off', 'mode': '76'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009228", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([4, 5, 2, 0, 7, 6], [9, 8, 7, 4, 1, 6]) == [4, 7, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([4, 5, 2, 0, 7, 6], [9, 8, 7, 4, 1, 6]) == [4, 7, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009229", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('mtrqminwkvs') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('mtrqminwkvs') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009230", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(79) == 35\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(79) == 35\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009231", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 45, 'c': 27, 'e': 9, 'a': 65}) == {45: 'b', 27: 'c', 9: 'e', 65: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 45, 'c': 27, 'e': 9, 'a': 65}) == {45: 'b', 27: 'c', 9: 'e', 65: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009232", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(125, 96) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(125, 96) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009233", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('b{}]})a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b{}]})a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009234", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('acd', 'acda') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acd', 'acda') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009235", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 9, 'x': 1, 'w': 4}, {'w': 4, 'y': 5, 'z': 8}) == {'z': 17, 'x': 1, 'w': 8, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 9, 'x': 1, 'w': 4}, {'w': 4, 'y': 5, 'z': 8}) == {'z': 17, 'x': 1, 'w': 8, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009236", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([2, 4, 14, 28, 48, 66, 78, 99], 4) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([2, 4, 14, 28, 48, 66, 78, 99], 4) == 1\nassert binary_search([2, 4, 14, 28, 48, 66, 78, 99], 2) == 0\nassert binary_search([2, 4, 14, 28, 48, 66, 78, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009237", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(8640) == 468\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(8640) == 468\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009238", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([2, 0, 0, 0, 1, 5, 1, 4, 2, 3]) == [2, 0, 1, 5, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 0, 0, 0, 1, 5, 1, 4, 2, 3]) == [2, 0, 1, 5, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009239", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('rklrciw') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('rklrciw') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009240", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([14, 13, 27, 24, 13, 11]) == 24\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 13, 27, 24, 13, 11]) == 24\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009241", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('cbaaabcacbb', 'bcba') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbaaabcacbb', 'bcba') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009242", "instruction": "Create function int_to_roman(n): Roman numeral for n.\n\nExample:\nassert int_to_roman(3051) == 'MMMLI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3051) == 'MMMLI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009243", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 9}, {'z': 5}) == {'x': 9, 'z': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9}, {'z': 5}) == {'x': 9, 'z': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009244", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat dog sun dog cat,') == {'cat': 2, 'dog': 2, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat dog sun dog cat,') == {'cat': 2, 'dog': 2, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009245", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(51) == [3, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(51) == [3, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009246", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(345) == 'CCCXLV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(345) == 'CCCXLV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009247", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(9, 3) == 729\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(9, 3) == 729\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009248", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('path=780; user=324') == {'path': '780', 'user': '324'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=780; user=324') == {'path': '780', 'user': '324'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009249", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 4, 2, 3]) == [1, 4, 2, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 4, 2, 3]) == [1, 4, 2, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009250", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(94); s.push(83); s.push(64)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(94); s.push(83); s.push(64)\nassert s.peek() == 64\nassert s.pop() == 64\nassert s.pop() == 83\nassert s.is_empty() == False\nassert s.pop() == 94\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009251", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([43, 22, 35, 13, 48, 46, 10, 5, 41, 5, 19]) == [5, 5, 10, 13, 19, 22, 35, 41, 43, 46, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([43, 22, 35, 13, 48, 46, 10, 5, 41, 5, 19]) == [5, 5, 10, 13, 19, 22, 35, 41, 43, 46, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009252", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('bb]]a)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('bb]]a)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009253", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('b,\"b,,,\",37') == ['b', 'b,,,', '37']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('b,\"b,,,\",37') == ['b', 'b,,,', '37']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009254", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 8, 5, 1], 1) == [1, 4, 8, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 8, 5, 1], 1) == [1, 4, 8, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009255", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([0, 7, 0, 6, 8, 1, 3, 1, 9], 15) == [6, 8, 1, 3, 1, 9, 0, 7, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 7, 0, 6, 8, 1, 3, 1, 9], 15) == [6, 8, 1, 3, 1, 9, 0, 7, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009256", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('exrdgac') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('exrdgac') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009257", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(68); s.push(77); s.push(76)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(68); s.push(77); s.push(76)\nassert s.peek() == 76\nassert s.pop() == 76\nassert s.pop() == 77\nassert s.is_empty() == False\nassert s.pop() == 68\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009258", "instruction": "Create a BankAccount class: safe withdraw, deposit, balance query.\n\nExample:\nacc = BankAccount(351)\nacc.deposit(112)\nacc.withdraw(189)\nacc.withdraw(491)\nassert acc.get_balance() == 463\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(351)\nacc.deposit(112)\nassert acc.get_balance() == 463\nacc.withdraw(189)\nassert acc.get_balance() == 274\nacc.withdraw(491)\nassert acc.get_balance() == 274\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009259", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('c ae ghha gh bffcbhfa a') == 'bffcbhfa'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('c ae ghha gh bffcbhfa a') == 'bffcbhfa'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009260", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([2, 11, 21]) == [2, 11, 21]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 11, 21]) == [2, 11, 21]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009261", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 5, 'c': 7}, 5) == {'c': 7}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 5, 'c': 7}, 5) == {'c': 7}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009262", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('MMMCCCXCII') == 3392\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMCCCXCII') == 3392\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009263", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(9765) == 98\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9765) == 98\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009264", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(410344) == 640\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(410344) == 640\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009265", "instruction": "Write csv_parse_line(line) -> list: parse CSV line.\n\nExample:\nassert csv_parse_line('aaa,\"a,a\"') == ['aaa', 'a,a']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aaa,\"a,a\"') == ['aaa', 'a,a']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009266", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(76) == [2, 2, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(76) == [2, 2, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009267", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([1, 1, 4, 3, 5, 3, 5, 1]) == [1, 4, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 1, 4, 3, 5, 3, 5, 1]) == [1, 4, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009268", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('Cat the cat cat sat Cat') == {'cat': 4, 'the': 1, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('Cat the cat cat sat Cat') == {'cat': 4, 'the': 1, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009269", "instruction": "Write quicksort(nums) -> list: quicksort.\n\nExample:\nassert quicksort([34, 18, 18, 22, 17, 16, 46, 13, 2, 41, 8, 45, 50]) == [2, 8, 13, 16, 17, 18, 18, 22, 34, 41, 45, 46, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([34, 18, 18, 22, 17, 16, 46, 13, 2, 41, 8, 45, 50]) == [2, 8, 13, 16, 17, 18, 18, 22, 34, 41, 45, 46, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009270", "instruction": "Create function cumulative_sum(nums): cumulative sum list.\n\nExample:\nassert cumulative_sum([9, -3, 6, 9, 1, -4, -2, 2]) == [9, 6, 12, 21, 22, 18, 16, 18]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([9, -3, 6, 9, 1, -4, -2, 2]) == [9, 6, 12, 21, 22, 18, 16, 18]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009271", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'c': 9, 'd': 3, 'a': 3}, 3) == {'c': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 9, 'd': 3, 'a': 3}, 3) == {'c': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009272", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['x', '', 'y']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['x', '', 'y']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009273", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([49, 10, 39, 28, 12, 9, 8, 24, 44, 28, 20]) == [8, 9, 10, 12, 20, 24, 28, 28, 39, 44, 49]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([49, 10, 39, 28, 12, 9, 8, 24, 44, 28, 20]) == [8, 9, 10, 12, 20, 24, 28, 28, 39, 44, 49]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009274", "instruction": "Write a Python function are_anagrams(a, b) returning True if a and b are anagrams.\n\nExample:\nassert are_anagrams('bddbe', 'bddbed') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('bddbe', 'bddbed') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009275", "instruction": "Define quicksort performing quicksort.\n\nExample:\nassert quicksort([9, 47, 23, 7, 5, 12, 26, 18]) == [5, 7, 9, 12, 18, 23, 26, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([9, 47, 23, 7, 5, 12, 26, 18]) == [5, 7, 9, 12, 18, 23, 26, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009276", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(7, 10) == 282475249\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 10) == 282475249\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009277", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(312897) == 559\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(312897) == 559\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009278", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(2654) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2654) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009279", "instruction": "Write class Stack: LIFO container.\n\nExample:\ns = Stack()\ns.push(72); s.push(12); s.push(96)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(72); s.push(12); s.push(96)\nassert s.peek() == 96\nassert s.pop() == 96\nassert s.pop() == 12\nassert s.is_empty() == False\nassert s.pop() == 72\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009280", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(180, 178) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(180, 178) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009281", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([2, 1, 6, 6, 9, 0], [9, 6, 7, 4]) == [6, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 1, 6, 6, 9, 0], [9, 6, 7, 4]) == [6, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009282", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(1417) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1417) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009283", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(86); s.push(7); s.push(40)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(86); s.push(7); s.push(40)\nassert s.peek() == 40\nassert s.pop() == 40\nassert s.pop() == 7\nassert s.is_empty() == False\nassert s.pop() == 86\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009284", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('dog dog. sun Sat dog sun, sat the cat,') == {'dog': 3, 'sun': 2, 'sat': 2, 'the': 1, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog dog. sun Sat dog sun, sat the cat,') == {'dog': 3, 'sun': 2, 'sat': 2, 'the': 1, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009285", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('L') == 50\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('L') == 50\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009286", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(96) == [2, 2, 2, 2, 2, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(96) == [2, 2, 2, 2, 2, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009287", "instruction": "Create function freq_map(items): element -> count dict.\n\nExample:\nassert freq_map(['d', 'e', 'c', 'd', 'c', 'c']) == {'d': 2, 'e': 1, 'c': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'c', 'd', 'c', 'c']) == {'d': 2, 'e': 1, 'c': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009288", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaaaaaaacccbbbbb') == 'a8c3b5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaacccbbbbb') == 'a8c3b5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009289", "instruction": "Implement longest_word(s): longest whitespace-separated word, first wins ties.\n\nExample:\nassert longest_word('cbcdcade fhahd g fba haacbagh hdhfcdgc') == 'cbcdcade'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('cbcdcade fhahd g fba haacbagh hdhfcdgc') == 'cbcdcade'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009290", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(6172) == 2716\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6172) == 2716\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009291", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-1, -2], [-1, -5], [5, -1]], [[9, -2], [8, -6], [-6, -9]]) == [[8, -4], [7, -11], [-1, -10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-1, -2], [-1, -5], [5, -1]], [[9, -2], [8, -6], [-6, -9]]) == [[8, -4], [7, -11], [-1, -10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009292", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCVII') == 207\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCVII') == 207\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009293", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['date', 'coconut', 'banana', 'apple', 'coconut']) == {'d': ['date'], 'c': ['coconut', 'coconut'], 'b': ['banana'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['date', 'coconut', 'banana', 'apple', 'coconut']) == {'d': ['date'], 'c': ['coconut', 'coconut'], 'b': ['banana'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009294", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h43m22s') == 17002\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h43m22s') == 17002\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009295", "instruction": "Write a Python function collatz_steps(n) returning the number of Collatz steps to reach 1 (n/2 if even, 3n+1 if odd).\n\nExample:\nassert collatz_steps(39) == 34\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(39) == 34\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009296", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 1, 'y': 7}, {'y': 1, 'x': 6}) == {'z': 1, 'y': 8, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 1, 'y': 7}, {'y': 1, 'x': 6}) == {'z': 1, 'y': 8, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009297", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 3, 0, 1, 6, 9, 2, 2, 1, 5, 9], 3) == [[1, 3, 0], [1, 6, 9], [2, 2, 1], [5, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 3, 0, 1, 6, 9, 2, 2, 1, 5, 9], 3) == [[1, 3, 0], [1, 6, 9], [2, 2, 1], [5, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009298", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('beead') == 'bead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('beead') == 'bead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009299", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(2935) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(2935) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009300", "instruction": "Create function eval_expr(expr): value of the expression.\n\nExample:\nassert eval_expr('14') == 14\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('14') == 14\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009301", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['c', 'a', 'e', 'e', 'c', 'a', 'd', 'b']) == {'c': 2, 'a': 2, 'e': 2, 'd': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'e', 'e', 'c', 'a', 'd', 'b']) == {'c': 2, 'a': 2, 'e': 2, 'd': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009302", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([4, [6, 8], 4, [1, 6, 4], [9, 9]]) == [4, 6, 8, 4, 1, 6, 4, 9, 9]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [6, 8], 4, [1, 6, 4], [9, 9]]) == [4, 6, 8, 4, 1, 6, 4, 9, 9]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009303", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([46, 5, -9, -6, -39, 24, 41, 24, 20]) == 46\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([46, 5, -9, -6, -39, 24, 41, 24, 20]) == 46\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009304", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('eeabcbdacbcdac') == 'eabcd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eeabcbdacbcdac') == 'eabcd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009305", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([6, 5, 5, 6, 6, 6], [0, 3, 5, 1]) == [5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 5, 5, 6, 6, 6], [0, 3, 5, 1]) == [5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009306", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('8 + 9 - 1 + 2') == 18\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('8 + 9 - 1 + 2') == 18\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009307", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([12, 19, 17, 6, 6]) == 17\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([12, 19, 17, 6, 6]) == 17\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009308", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'f': 58, 'e': 43, 'c': 38, 'd': 85}) == {58: 'f', 43: 'e', 38: 'c', 85: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 58, 'e': 43, 'c': 38, 'd': 85}) == {58: 'f', 43: 'e', 38: 'c', 85: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009309", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('Python Hello', 13) == 'Clguba Uryyb'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Hello', 13) == 'Clguba Uryyb'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009310", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('xfe') == 'efx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xfe') == 'efx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009311", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 5, 2, 9, 3, 2], [0, 7, 4]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 5, 2, 9, 3, 2], [0, 7, 4]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009312", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(50, 63) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(50, 63) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009313", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaaaaaaaa') == 'a10'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaa') == 'a10'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009314", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([23, 21, 28, 12, 43]) == [12, 21, 23, 28, 43]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([23, 21, 28, 12, 43]) == [12, 21, 23, 28, 43]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009315", "instruction": "Define collatz_steps counting Collatz steps to 1.\n\nExample:\nassert collatz_steps(6) == 8\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(6) == 8\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009316", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'x': 9, 'y': 2, 'z': 2}, {'x': 6}) == {'x': 15, 'y': 2, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 9, 'y': 2, 'z': 2}, {'x': 6}) == {'x': 15, 'y': 2, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009317", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([4, 9]) == 13\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([4, 9]) == 13\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009318", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(13) == [13]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(13) == [13]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009319", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('bbaeaacebcade') == 'baecd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bbaeaacebcade') == 'baecd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009320", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('14 + 15 - 8') == 21\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('14 + 15 - 8') == 21\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009321", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([10, 12, 25, 32, 60, 62], 32) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 12, 25, 32, 60, 62], 32) == 3\nassert binary_search([10, 12, 25, 32, 60, 62], 10) == 0\nassert binary_search([10, 12, 25, 32, 60, 62], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009322", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[9, 7], [2, 3], [0, -7]], [[-4, 1], [-9, -5], [2, 2]]) == [[5, 8], [-7, -2], [2, -5]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[9, 7], [2, 3], [0, -7]], [[-4, 1], [-9, -5], [2, 2]]) == [[5, 8], [-7, -2], [2, -5]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009323", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(12, 15) == 60\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(12, 15) == 60\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009324", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(144859) == 380\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(144859) == 380\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009325", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([34, 29, 8, 31, 26, 0, 6, 33]) == [0, 6, 8, 26, 29, 31, 33, 34]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([34, 29, 8, 31, 26, 0, 6, 33]) == [0, 6, 8, 26, 29, 31, 33, 34]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009326", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'b': 7, 'd': 47, 'f': 76, 'a': 71, 'e': 90}) == {7: 'b', 47: 'd', 76: 'f', 71: 'a', 90: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 7, 'd': 47, 'f': 76, 'a': 71, 'e': 90}) == {7: 'b', 47: 'd', 76: 'f', 71: 'a', 90: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009327", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 68, 'f': 95, 'c': 79, 'd': 24, 'a': 5}) == {68: 'b', 95: 'f', 79: 'c', 24: 'd', 5: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 68, 'f': 95, 'c': 79, 'd': 24, 'a': 5}) == {68: 'b', 95: 'f', 79: 'c', 24: 'd', 5: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009328", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([25, 39, 50]) == [25, 39, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([25, 39, 50]) == [25, 39, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009329", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([7, 8, 6, 5, 4, 0, 2], [4, 7, 3, 3]) == [7, 4]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 8, 6, 5, 4, 0, 2], [4, 7, 3, 3]) == [7, 4]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009330", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(386) == [2, 193]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(386) == [2, 193]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009331", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([22, 13, 31]) == [13, 22, 31]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 13, 31]) == [13, 22, 31]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009332", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[8]]) == [8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[8]]) == [8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009333", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([33, 37, 26, 8, 42, 13, 1]) == [1, 8, 13, 26, 33, 37, 42]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([33, 37, 26, 8, 42, 13, 1]) == [1, 8, 13, 26, 33, 37, 42]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009334", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baabbba', 'aab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baabbba', 'aab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009335", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=953; port=on; user=off') == {'mode': '953', 'port': 'on', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=953; port=on; user=off') == {'mode': '953', 'port': 'on', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009336", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([6, 9, 5, 8, 6, 8], [9, 4, 3, 1, 6]) == [6, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 9, 5, 8, 6, 8], [9, 4, 3, 1, 6]) == [6, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009337", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[8, 7, 3], [0]]) == [8, 7, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 7, 3], [0]]) == [8, 7, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009338", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(92) == [2, 2, 23]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(92) == [2, 2, 23]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009339", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([5, 0, 5, 4, 4, 1, 4]) == [5, 0, 4, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 0, 5, 4, 4, 1, 4]) == [5, 0, 4, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009340", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'coconut', 'apple', 'banana']) == {'b': ['banana', 'banana'], 'c': ['coconut'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'coconut', 'apple', 'banana']) == {'b': ['banana', 'banana'], 'c': ['coconut'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009341", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('1h54m11s') == 6851\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h54m11s') == 6851\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009342", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([6, 6, 9, 16, 9, 16]) == 9\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([6, 6, 9, 16, 9, 16]) == 9\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009343", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(5, 13) == 65\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(5, 13) == 65\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009344", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(19, 41) == 779\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(19, 41) == 779\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009345", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(947719) == 973\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(947719) == 973\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009346", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[4, 1, 2], [3, 2, 5]], [[0, 1], [3, 2], [5, 2]]) == [[13, 10], [31, 17]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 1, 2], [3, 2, 5]], [[0, 1], [3, 2], [5, 2]]) == [[13, 10], [31, 17]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009347", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(7, 4) == 2401\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 4) == 2401\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009348", "instruction": "Implement gcd(a, b): GCD via Euclid's algorithm.\n\nExample:\nassert gcd(63, 157) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(63, 157) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009349", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([12, 25, 11, 30, 15, 34, 7, 37, 48, 25, 21, 15]) == [7, 11, 12, 15, 15, 21, 25, 25, 30, 34, 37, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([12, 25, 11, 30, 15, 34, 7, 37, 48, 25, 21, 15]) == [7, 11, 12, 15, 15, 21, 25, 25, 30, 34, 37, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009350", "instruction": "Write a Python function matrix_transpose(m) returning the transpose of a matrix.\n\nExample:\nassert matrix_transpose([[6, 2, 9, 6], [4, 6, 2, 2], [1, 0, 0, 8]]) == [[6, 4, 1], [2, 6, 0], [9, 2, 0], [6, 2, 8]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 2, 9, 6], [4, 6, 2, 2], [1, 0, 0, 8]]) == [[6, 4, 1], [2, 6, 0], [9, 2, 0], [6, 2, 8]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009351", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 9, 8], 1) == [8, 4, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 9, 8], 1) == [8, 4, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009352", "instruction": "Create function reverse_digits(n): digit-reversed integer.\n\nExample:\nassert reverse_digits(5980) == 895\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(5980) == 895\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009353", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([0, 31, 37, 52, 55, 71, 90, 95], 0) == 0\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([0, 31, 37, 52, 55, 71, 90, 95], 0) == 0\nassert binary_search([0, 31, 37, 52, 55, 71, 90, 95], 0) == 0\nassert binary_search([0, 31, 37, 52, 55, 71, 90, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009354", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(16, 60) == 240\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 60) == 240\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009355", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'apple', 'date', 'cherry', 'banana', 'berry', 'apple']) == {'b': ['berry', 'banana', 'berry'], 'a': ['apple', 'apple'], 'd': ['date'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'apple', 'date', 'cherry', 'banana', 'berry', 'apple']) == {'b': ['berry', 'banana', 'berry'], 'a': ['apple', 'apple'], 'd': ['date'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009356", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(6, 24) == 24\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(6, 24) == 24\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009357", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([20, 28, 30, 31, 44, 90], 28) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([20, 28, 30, 31, 44, 90], 28) == 1\nassert binary_search([20, 28, 30, 31, 44, 90], 20) == 0\nassert binary_search([20, 28, 30, 31, 44, 90], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009358", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([8, 9, 6, 8, 9, 5, 1, 5], 9) == [5, 8, 9, 6, 8, 9, 5, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 9, 6, 8, 9, 5, 1, 5], 9) == [5, 8, 9, 6, 8, 9, 5, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009359", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'x': 4}, {'z': 1, 'x': 8, 'y': 2}) == {'x': 12, 'z': 1, 'y': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4}, {'z': 1, 'x': 8, 'y': 2}) == {'x': 12, 'z': 1, 'y': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009360", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([22, 13, 7, 44, 15, 40, 39]) == [7, 13, 15, 22, 39, 40, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([22, 13, 7, 44, 15, 40, 39]) == [7, 13, 15, 22, 39, 40, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009361", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('abaabaaaa', 'aab') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abaabaaaa', 'aab') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009362", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bababaaabb', 'baab') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bababaaabb', 'baab') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009363", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('CMXXXIII') == 933\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CMXXXIII') == 933\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009364", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('ecaabc') == 'ecab'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ecaabc') == 'ecab'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009365", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(8) == 3\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(8) == 3\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009366", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('acbcaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('acbcaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009367", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('0,\",,,\",b') == ['0', ',,,', 'b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('0,\",,,\",b') == ['0', ',,,', 'b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009368", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 2, 'b': 10, 'a': 1}, 7) == {'b': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 2, 'b': 10, 'a': 1}, 7) == {'b': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009369", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([4, 2, 3, 5, 3, 1, 2, 3, 1, 3]) == [4, 2, 3, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 2, 3, 5, 3, 1, 2, 3, 1, 3]) == [4, 2, 3, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009370", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(8067) == 89\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8067) == 89\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009371", "instruction": "Implement matrix_multiply(a, b): matrix multiplication.\n\nExample:\nassert matrix_multiply([[3, 1, 0], [0, 3, 0], [5, 1, 3]], [[0, 0, 4], [4, 1, 1], [3, 4, 4]]) == [[4, 1, 13], [12, 3, 3], [13, 13, 33]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 1, 0], [0, 3, 0], [5, 1, 3]], [[0, 0, 4], [4, 1, 1], [3, 4, 4]]) == [[4, 1, 13], [12, 3, 3], [13, 13, 33]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009372", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 1, 5, 0, 9, 1, 6, 1], [6, 9, 8]) == [9, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 1, 5, 0, 9, 1, 6, 1], [6, 9, 8]) == [9, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009373", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(430)\nacc.deposit(34)\nacc.withdraw(319)\nacc.withdraw(505)\nassert acc.get_balance() == 464\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(430)\nacc.deposit(34)\nassert acc.get_balance() == 464\nacc.withdraw(319)\nassert acc.get_balance() == 145\nacc.withdraw(505)\nassert acc.get_balance() == 145\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009374", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([9, [7, 9, 4, 8], [3, 7, 8, 2], 8, 0]) == [9, 7, 9, 4, 8, 3, 7, 8, 2, 8, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([9, [7, 9, 4, 8], [3, 7, 8, 2], 8, 0]) == [9, 7, 9, 4, 8, 3, 7, 8, 2, 8, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009375", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([7, 5, 4, 6, 8, 2], 8) == [8, 2, 7, 5, 4, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 5, 4, 6, 8, 2], 8) == [8, 2, 7, 5, 4, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009376", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Python', 13) == 'Clguba'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python', 13) == 'Clguba'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009377", "instruction": "Write a Python function dict_filter(d, t) keeping only items whose value is greater than t.\n\nExample:\nassert dict_filter({'c': 3, 'e': 10, 'd': 5, 'a': 3}, 6) == {'e': 10}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'c': 3, 'e': 10, 'd': 5, 'a': 3}, 6) == {'e': 10}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009378", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([4, 5, 3, 4, 4]) == [4, 5, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 5, 3, 4, 4]) == [4, 5, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009379", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(238)\nacc.deposit(199)\nacc.withdraw(84)\nacc.withdraw(545)\nassert acc.get_balance() == 437\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(238)\nacc.deposit(199)\nassert acc.get_balance() == 437\nacc.withdraw(84)\nassert acc.get_balance() == 353\nacc.withdraw(545)\nassert acc.get_balance() == 353\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009380", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 1, 'y': 2}, {'y': 2, 'w': 1, 'z': 3}) == {'w': 2, 'y': 4, 'z': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 1, 'y': 2}, {'y': 2, 'w': 1, 'z': 3}) == {'w': 2, 'y': 4, 'z': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009381", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([7, 7, 7, 1, 1, 5, 9, 2, 9, 7], 4) == [9, 2, 9, 7, 7, 7, 7, 1, 1, 5]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 7, 7, 1, 1, 5, 9, 2, 9, 7], 4) == [9, 2, 9, 7, 7, 7, 7, 1, 1, 5]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009382", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([11, 11, 29, 27, 29, 15, 29, 9, 23]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([11, 11, 29, 27, 29, 15, 29, 9, 23]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009383", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'coconut', 'cherry', 'cherry', 'banana', 'cherry']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'cherry', 'cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'coconut', 'cherry', 'cherry', 'banana', 'cherry']) == {'b': ['berry', 'banana'], 'c': ['coconut', 'cherry', 'cherry', 'cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009384", "instruction": "Implement parse_duration(s): duration string to seconds.\n\nExample:\nassert parse_duration('4h19m23s') == 15563\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h19m23s') == 15563\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009385", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[-8, 0, -1], [-2, 3, 7]], [[-7, -7, -3], [5, -7, 6]]) == [[-15, -7, -4], [3, -4, 13]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 0, -1], [-2, 3, 7]], [[-7, -7, -3], [5, -7, 6]]) == [[-15, -7, -4], [3, -4, 13]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009386", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([14, 36, 33, 0, 31]) == [0, 14, 31, 33, 36]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([14, 36, 33, 0, 31]) == [0, 14, 31, 33, 36]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009387", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[7, 5, 9, 9], [4, 4, 5, 7], [7, 7, 2, 3]]) == [[7, 4, 7], [5, 4, 7], [9, 5, 2], [9, 7, 3]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[7, 5, 9, 9], [4, 4, 5, 7], [7, 7, 2, 3]]) == [[7, 4, 7], [5, 4, 7], [9, 5, 2], [9, 7, 3]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009388", "instruction": "Define matrix_transpose transposing a matrix.\n\nExample:\nassert matrix_transpose([[8, 8], [0, 4], [2, 0], [2, 0]]) == [[8, 0, 2, 2], [8, 4, 0, 0]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[8, 8], [0, 4], [2, 0], [2, 0]]) == [[8, 0, 2, 2], [8, 4, 0, 0]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009389", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ccaaecd', 'ccaaecda') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ccaaecd', 'ccaaecda') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009390", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(311)\nacc.deposit(54)\nacc.withdraw(54)\nacc.withdraw(557)\nassert acc.get_balance() == 365\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(311)\nacc.deposit(54)\nassert acc.get_balance() == 365\nacc.withdraw(54)\nassert acc.get_balance() == 311\nacc.withdraw(557)\nassert acc.get_balance() == 311\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009391", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([10, 30, 40, 6, 47, 0]) == [0, 6, 10, 30, 40, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([10, 30, 40, 6, 47, 0]) == [0, 6, 10, 30, 40, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009392", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[3, 1, 9, -5], [-2, 2, -1, -6], [4, -5, 6, 8], [-9, -7, -3, 6]], [[-1, 9, 5, -2], [-4, 1, -1, 9], [-7, -9, 3, 3], [9, 9, -4, 2]]) == [[2, 10, 14, -7], [-6, 3, -2, 3], [-3, -14, 9, 11], [0, 2, -7, 8]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[3, 1, 9, -5], [-2, 2, -1, -6], [4, -5, 6, 8], [-9, -7, -3, 6]], [[-1, 9, 5, -2], [-4, 1, -1, 9], [-7, -9, 3, 3], [9, 9, -4, 2]]) == [[2, 10, 14, -7], [-6, 3, -2, 3], [-3, -14, 9, 11], [0, 2, -7, 8]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009393", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([36, 28, 1, 47, 49, 38, 16]) == [1, 16, 28, 36, 38, 47, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([36, 28, 1, 47, 49, 38, 16]) == [1, 16, 28, 36, 38, 47, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009394", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('bgaabh ghbaaddg hah') == 'ghbaaddg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('bgaabh ghbaaddg hah') == 'ghbaaddg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009395", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('1h47m25s') == 6445\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('1h47m25s') == 6445\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009396", "instruction": "Write a Python function longest_word(s) that returns the longest word in s (words split on whitespace); return the first on ties.\n\nExample:\nassert longest_word('gbegfg hdb deb fdhdeh c faf') == 'gbegfg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gbegfg hdb deb fdhdeh c faf') == 'gbegfg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009397", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(46, 181, 566) == 226\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(46, 181, 566) == 226\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009398", "instruction": "Create function matrix_transpose(m): transposed matrix.\n\nExample:\nassert matrix_transpose([[0, 4, 2, 9], [8, 0, 7, 2], [6, 8, 6, 9]]) == [[0, 8, 6], [4, 0, 8], [2, 7, 6], [9, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[0, 4, 2, 9], [8, 0, 7, 2], [6, 8, 6, 9]]) == [[0, 8, 6], [4, 0, 8], [2, 7, 6], [9, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009399", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-4, -4, 49, 30, 36, -26, 20]) == 49\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-4, -4, 49, 30, 36, -26, 20]) == 49\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009400", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(')(b{)[}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')(b{)[}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009401", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(7254) == 4527\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7254) == 4527\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009402", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([0, 1, 4, 7, 7, 8, 17], [14, 18]) == [0, 1, 4, 7, 7, 8, 14, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 4, 7, 7, 8, 17], [14, 18]) == [0, 1, 4, 7, 7, 8, 14, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009403", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(311) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(311) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009404", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([9, 0, 6, 7, 5, 1], 4) == [6, 7, 5, 1, 9, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 0, 6, 7, 5, 1], 4) == [6, 7, 5, 1, 9, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009405", "instruction": "Write a Python function title_case(s) that capitalizes the first letter of each word.\n\nExample:\nassert title_case('a aae') == 'A Aae'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('a aae') == 'A Aae'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009406", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([0, 1, 11, 14, 19, 20], [2, 10, 14]) == [0, 1, 2, 10, 11, 14, 14, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([0, 1, 11, 14, 19, 20], [2, 10, 14]) == [0, 1, 2, 10, 11, 14, 14, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009407", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('4h30m52s') == 16252\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('4h30m52s') == 16252\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009408", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([-8, -1]) == [-8, -9]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-8, -1]) == [-8, -9]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009409", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[4, 2, 4], [2, 0, 0], [5, 5, 2]], [[3, 2], [4, 2], [1, 2]]) == [[24, 20], [6, 4], [37, 24]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 2, 4], [2, 0, 0], [5, 5, 2]], [[3, 2], [4, 2], [1, 2]]) == [[24, 20], [6, 4], [37, 24]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009410", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'berry', 'avocado', 'coconut']) == {'c': ['coconut', 'coconut'], 'a': ['apple', 'avocado'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'berry', 'avocado', 'coconut']) == {'c': ['coconut', 'coconut'], 'a': ['apple', 'avocado'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009411", "instruction": "Create function is_armstrong(n): True for Armstrong numbers.\n\nExample:\nassert is_armstrong(371) == True\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(371) == True\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009412", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([1, 9, 2, 6, 8, 2, 7, 1, 1, 5], 7) == [6, 8, 2, 7, 1, 1, 5, 1, 9, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 9, 2, 6, 8, 2, 7, 1, 1, 5], 7) == [6, 8, 2, 7, 1, 1, 5, 1, 9, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009413", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('d,\"a,\",aa,\"aa,ba\"') == ['d', 'a,', 'aa', 'aa,ba']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('d,\"a,\",aa,\"aa,ba\"') == ['d', 'a,', 'aa', 'aa,ba']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009414", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([13, 11, 3, 5]) == [3, 5, 11, 13]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([13, 11, 3, 5]) == [3, 5, 11, 13]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009415", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('port=489; user=945; mode=724; path=814') == {'port': '489', 'user': '945', 'mode': '724', 'path': '814'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('port=489; user=945; mode=724; path=814') == {'port': '489', 'user': '945', 'mode': '724', 'path': '814'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009416", "instruction": "Write a Python function reverse_string(s) that returns the reverse of the string s.\n\nExample:\nassert reverse_string('aedbabd') == 'dbabdea'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('aedbabd') == 'dbabdea'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009417", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MCCCIX') == 1309\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MCCCIX') == 1309\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009418", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(72) == [2, 2, 2, 3, 3]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(72) == [2, 2, 2, 3, 3]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009419", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('31m43s') == 1903\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('31m43s') == 1903\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009420", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(7, 26, 873) == 571\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(7, 26, 873) == 571\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009421", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(62326) == 249\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(62326) == 249\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009422", "instruction": "Create function bubble_sort(nums): bubble-sorted new list.\n\nExample:\nassert bubble_sort([26, 21, 19, 29]) == [19, 21, 26, 29]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([26, 21, 19, 29]) == [19, 21, 26, 29]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009423", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([4, 12, 15, 56, 64, 99], 12) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 12, 15, 56, 64, 99], 12) == 1\nassert binary_search([4, 12, 15, 56, 64, 99], 4) == 0\nassert binary_search([4, 12, 15, 56, 64, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009424", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([5, 9, 2, 7, 6], [3, 4, 2, 2, 8, 4, 5]) == [5, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 9, 2, 7, 6], [3, 4, 2, 2, 8, 4, 5]) == [5, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009425", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([8, 2, 8, 0, 0, 7, 5, 0, 7, 9, 8, 8, 5, 1], 5) == [[8, 2, 8, 0, 0], [7, 5, 0, 7, 9], [8, 8, 5, 1]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 2, 8, 0, 0, 7, 5, 0, 7, 9, 8, 8, 5, 1], 5) == [[8, 2, 8, 0, 0], [7, 5, 0, 7, 9], [8, 8, 5, 1]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009426", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([19, 30, 0, 17, 44, 36, 10]) == [0, 10, 17, 19, 30, 36, 44]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([19, 30, 0, 17, 44, 36, 10]) == [0, 10, 17, 19, 30, 36, 44]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009427", "instruction": "Write longest_common_prefix(strs) -> str: longest common prefix.\n\nExample:\nassert longest_common_prefix(['ba', 'ba', 'baxzx', 'bayyz']) == 'ba'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['ba', 'ba', 'baxzx', 'bayyz']) == 'ba'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009428", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(377)\nacc.deposit(285)\nacc.withdraw(274)\nacc.withdraw(844)\nassert acc.get_balance() == 662\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(377)\nacc.deposit(285)\nassert acc.get_balance() == 662\nacc.withdraw(274)\nassert acc.get_balance() == 388\nacc.withdraw(844)\nassert acc.get_balance() == 388\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009429", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([3, 3, 4], 5) == [3, 4, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 3, 4], 5) == [3, 4, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009430", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('aaaaaaaaaaaaaaaa') == 'a16'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaaaaaaaaa') == 'a16'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009431", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([[2, 4, 4], [5, 8, 4]]) == 27\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, 4, 4], [5, 8, 4]]) == 27\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009432", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([4, 18, 50, 59, 76, 87, 91], 50) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([4, 18, 50, 59, 76, 87, 91], 50) == 2\nassert binary_search([4, 18, 50, 59, 76, 87, 91], 4) == 0\nassert binary_search([4, 18, 50, 59, 76, 87, 91], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009433", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(102) == [2, 3, 17]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(102) == [2, 3, 17]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009434", "instruction": "Write a recursive Python function nested_sum(x) returning the sum of all integers in a possibly nested list.\n\nExample:\nassert nested_sum([[0, 0], 1, [8]]) == 9\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 0], 1, [8]]) == 9\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009435", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([9, 26, 21, 19, 15]) == 21\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 26, 21, 19, 15]) == 21\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009436", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(9069) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(9069) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009437", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(288)\nacc.deposit(24)\nacc.withdraw(54)\nacc.withdraw(337)\nassert acc.get_balance() == 312\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(288)\nacc.deposit(24)\nassert acc.get_balance() == 312\nacc.withdraw(54)\nassert acc.get_balance() == 258\nacc.withdraw(337)\nassert acc.get_balance() == 258\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009438", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(841) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(841) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009439", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(6877) == 82\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(6877) == 82\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009440", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([12, 7, 47, 12]) == [7, 12, 12, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([12, 7, 47, 12]) == [7, 12, 12, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009441", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(30, 83, 313) == 178\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(30, 83, 313) == 178\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009442", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([16, 14, 0]) == [0, 14, 16]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([16, 14, 0]) == [0, 14, 16]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009443", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(16, 24) == 48\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(16, 24) == 48\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009444", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('aabbbbababbbbba', 'abaa') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabbbbababbbbba', 'abaa') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009445", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(389)\nacc.deposit(222)\nacc.withdraw(413)\nacc.withdraw(775)\nassert acc.get_balance() == 611\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(389)\nacc.deposit(222)\nassert acc.get_balance() == 611\nacc.withdraw(413)\nassert acc.get_balance() == 198\nacc.withdraw(775)\nassert acc.get_balance() == 198\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009446", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'y': 5}) == {'z': 7, 'y': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'y': 5}) == {'z': 7, 'y': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009447", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('lpdk') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('lpdk') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009448", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([32, 1, 12, 10, 48, 40, 40]) == [1, 10, 12, 32, 40, 40, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([32, 1, 12, 10, 48, 40, 40]) == [1, 10, 12, 32, 40, 40, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009449", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([2, 9, 38, 26, 6, 34]) == [2, 6, 9, 26, 34, 38]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([2, 9, 38, 26, 6, 34]) == [2, 6, 9, 26, 34, 38]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009450", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('aaabbbbccccd') == 'a3b4c4d1'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaabbbbccccd') == 'a3b4c4d1'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009451", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('\",,a\",\",a\",b,da,ceed') == [',,a', ',a', 'b', 'da', 'ceed']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\",,a\",\",a\",b,da,ceed') == [',,a', ',a', 'b', 'da', 'ceed']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009452", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('LXVIII') == 68\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXVIII') == 68\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009453", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(332) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(332) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009454", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(90); s.push(56); s.push(16)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(90); s.push(56); s.push(16)\nassert s.peek() == 16\nassert s.pop() == 16\nassert s.pop() == 56\nassert s.is_empty() == False\nassert s.pop() == 90\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009455", "instruction": "Write is_prime(n) -> bool: is prime.\n\nExample:\nassert is_prime(490) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(490) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009456", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([27, 3, 15, 26, 15]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([27, 3, 15, 26, 15]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009457", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([15, 7, 28, 5, 22, 22, 21, 20]) == 22\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([15, 7, 28, 5, 22, 22, 21, 20]) == 22\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009458", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(107, 8) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(107, 8) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009459", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([7, 1, 2, 9, 1, 4, 3, 4, 6, 4, 5, 6, 5, 2, 5], 5) == [[7, 1, 2, 9, 1], [4, 3, 4, 6, 4], [5, 6, 5, 2, 5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 1, 2, 9, 1, 4, 3, 4, 6, 4, 5, 6, 5, 2, 5], 5) == [[7, 1, 2, 9, 1], [4, 3, 4, 6, 4], [5, 6, 5, 2, 5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009460", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('dcccbbb') == 'd1c3b3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dcccbbb') == 'd1c3b3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009461", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(147)\nacc.deposit(69)\nacc.withdraw(17)\nacc.withdraw(288)\nassert acc.get_balance() == 216\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(147)\nacc.deposit(69)\nassert acc.get_balance() == 216\nacc.withdraw(17)\nassert acc.get_balance() == 199\nacc.withdraw(288)\nassert acc.get_balance() == 199\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009462", "instruction": "Implement quicksort(nums): quicksort.\n\nExample:\nassert quicksort([42, 8, 49, 8, 20]) == [8, 8, 20, 42, 49]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([42, 8, 49, 8, 20]) == [8, 8, 20, 42, 49]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009463", "instruction": "Define pow_recursive computing powers recursively.\n\nExample:\nassert pow_recursive(7, 2) == 49\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 2) == 49\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009464", "instruction": "Create function title_case(s): first letter of each word uppercase, rest lowercase.\n\nExample:\nassert title_case('ceda') == 'Ceda'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ceda') == 'Ceda'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009465", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([17, 30, 36, 51, 52, 65, 68, 79], 196) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 30, 36, 51, 52, 65, 68, 79], 196) == -1\nassert binary_search([17, 30, 36, 51, 52, 65, 68, 79], 17) == 0\nassert binary_search([17, 30, 36, 51, 52, 65, 68, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009466", "instruction": "Implement word_freq_text(text): word frequency of a text.\n\nExample:\nassert word_freq_text('cat sat cat ran dog the ran sat Ran The') == {'cat': 2, 'sat': 2, 'ran': 3, 'dog': 1, 'the': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat sat cat ran dog the ran sat Ran The') == {'cat': 2, 'sat': 2, 'ran': 3, 'dog': 1, 'the': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009467", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('ebhe ceeehdhh') == 'ceeehdhh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('ebhe ceeehdhh') == 'ceeehdhh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009468", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([25, 19, 19, 18, 18, 18]) == 19\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([25, 19, 19, 18, 18, 18]) == 19\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009469", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'w': 5}) == {'z': 7, 'w': 5}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'w': 5}) == {'z': 7, 'w': 5}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009470", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([3, 5, 9, 2, 5, 8, 9, 8], [2, 5, 7, 6, 6, 0]) == [5, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 5, 9, 2, 5, 8, 9, 8], [2, 5, 7, 6, 6, 0]) == [5, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009471", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('daaaded', 'eaddada') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('daaaded', 'eaddada') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009472", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'b': 95, 'e': 66, 'c': 83, 'f': 15}) == {95: 'b', 66: 'e', 83: 'c', 15: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 95, 'e': 66, 'c': 83, 'f': 15}) == {95: 'b', 66: 'e', 83: 'c', 15: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009473", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[5, [0, 8]]]) == [5, 0, 8]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, [0, 8]]]) == [5, 0, 8]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009474", "instruction": "Create function longest_word(s): pick the longest word.\n\nExample:\nassert longest_word('fagf hdgbech fbedh hc') == 'hdgbech'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fagf hdgbech fbedh hc') == 'hdgbech'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009475", "instruction": "Write a Python function cumulative_sum(nums) returning cumulative sums.\n\nExample:\nassert cumulative_sum([1, 8, -2, 0, -5, 2, 5, 8]) == [1, 9, 7, 7, 2, 4, 9, 17]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([1, 8, -2, 0, -5, 2, 5, 8]) == [1, 9, 7, 7, 2, 4, 9, 17]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009476", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(237) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(237) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009477", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the cat sat Cat dog. Sat dog') == {'the': 1, 'cat': 2, 'sat': 2, 'dog': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the cat sat Cat dog. Sat dog') == {'the': 1, 'cat': 2, 'sat': 2, 'dog': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009478", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['bac', 'bacz', 'bac']) == 'bac'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bac', 'bacz', 'bac']) == 'bac'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009479", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([3, 8, 7, 8, 6, 8, 8], 2) == [[3, 8], [7, 8], [6, 8], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 8, 7, 8, 6, 8, 8], 2) == [[3, 8], [7, 8], [6, 8], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009480", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([0, 7, 2, 0, 3, 0, 7, 5, 3], 2) == [[0, 7], [2, 0], [3, 0], [7, 5], [3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 7, 2, 0, 3, 0, 7, 5, 3], 2) == [[0, 7], [2, 0], [3, 0], [7, 5], [3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009481", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(246) == 'CCXLVI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(246) == 'CCXLVI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009482", "instruction": "Create recursive function nested_sum(x): deep sum.\n\nExample:\nassert nested_sum([6, 4, 6]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([6, 4, 6]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009483", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(44, 116, 685) == 636\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(44, 116, 685) == 636\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009484", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-38, -38, 19, 18, -19]) == 19\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-38, -38, 19, 18, -19]) == 19\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009485", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(34, 58) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(34, 58) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009486", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[5, 3, 8], 6, [2, 9]]) == [5, 3, 8, 6, 2, 9]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[5, 3, 8], 6, [2, 9]]) == [5, 3, 8, 6, 2, 9]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009487", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens(')(a)') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')(a)') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009488", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([23, 24, 7, 4]) == [4, 7, 23, 24]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([23, 24, 7, 4]) == [4, 7, 23, 24]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009489", "instruction": "Write a recursive Python function pow_recursive(a, e) returning a**e for non-negative integer e.\n\nExample:\nassert pow_recursive(3, 8) == 6561\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(3, 8) == 6561\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009490", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[3, 0], [1, 0]], [[3, 4, 0], [5, 0, 2]]) == [[9, 12, 0], [3, 4, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[3, 0], [1, 0]], [[3, 4, 0], [5, 0, 2]]) == [[9, 12, 0], [3, 4, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009491", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([15, 19, 48, 43, 8, 20, 10, 22, 13, 25, 23, 30, 17, 17]) == [8, 10, 13, 15, 17, 17, 19, 20, 22, 23, 25, 30, 43, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([15, 19, 48, 43, 8, 20, 10, 22, 13, 25, 23, 30, 17, 17]) == [8, 10, 13, 15, 17, 17, 19, 20, 22, 23, 25, 30, 43, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009492", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([9, 21]) == 21\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([9, 21]) == 21\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009493", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(92) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(92) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009494", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'w': 5, 'x': 4}, {'y': 3}) == {'w': 5, 'x': 4, 'y': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5, 'x': 4}, {'y': 3}) == {'w': 5, 'x': 4, 'y': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009495", "instruction": "Define word_freq_text counting words case-insensitively with punctuation stripped.\n\nExample:\nassert word_freq_text('dog Ran cat Sat cat, dog cat') == {'dog': 2, 'ran': 1, 'cat': 3, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('dog Ran cat Sat cat, dog cat') == {'dog': 2, 'ran': 1, 'cat': 3, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009496", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'e': 75, 'b': 29, 'a': 18}) == {75: 'e', 29: 'b', 18: 'a'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 75, 'b': 29, 'a': 18}) == {75: 'e', 29: 'b', 18: 'a'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009497", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([3, 4, 4, 17, 17, 19, 20], [0, 5]) == [0, 3, 4, 4, 5, 17, 17, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([3, 4, 4, 17, 17, 19, 20], [0, 5]) == [0, 3, 4, 4, 5, 17, 17, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009498", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([-42, -25, 11, -46, -31, -47]) == 11\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-42, -25, 11, -46, -31, -47]) == 11\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009499", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([9, 46, 13, 50]) == [9, 13, 46, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([9, 46, 13, 50]) == [9, 13, 46, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009500", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(251) == 'CCLI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(251) == 'CCLI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009501", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(18); s.push(49); s.push(71)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(18); s.push(49); s.push(71)\nassert s.peek() == 71\nassert s.pop() == 71\nassert s.pop() == 49\nassert s.is_empty() == False\nassert s.pop() == 18\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009502", "instruction": "Create function balanced_parens(s): True iff brackets balance.\n\nExample:\nassert balanced_parens('}[{a[') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('}[{a[') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009503", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(8343) == 91\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8343) == 91\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009504", "instruction": "Define merge_sorted merging two sorted lists.\n\nExample:\nassert merge_sorted([13], [12, 17]) == [12, 13, 17]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([13], [12, 17]) == [12, 13, 17]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009505", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([2, 8]) == [2, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([2, 8]) == [2, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009506", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([6, 1, 1, 8, 0], [7, 9, 1, 0, 6, 1, 6]) == [6, 1, 0]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([6, 1, 1, 8, 0], [7, 9, 1, 0, 6, 1, 6]) == [6, 1, 0]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009507", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(35, 23) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(35, 23) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009508", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the, sat the cat. sat the. sat,') == {'the': 3, 'sat': 3, 'cat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the, sat the cat. sat the. sat,') == {'the': 3, 'sat': 3, 'cat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009509", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('mode=104; user=115') == {'mode': '104', 'user': '115'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=104; user=115') == {'mode': '104', 'user': '115'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009510", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[1, -9], [-4, 8]], [[-8, 0], [-5, -5]]) == [[-7, -9], [-9, 3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[1, -9], [-4, 8]], [[-8, 0], [-5, -5]]) == [[-7, -9], [-9, 3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009511", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['b', 'c', 'e', 'a', 'e', 'c', 'b', 'a', 'a']) == {'b': 2, 'c': 2, 'e': 2, 'a': 3}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'c', 'e', 'a', 'e', 'c', 'b', 'a', 'a']) == {'b': 2, 'c': 2, 'e': 2, 'a': 3}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009512", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 2, 2, 0], [5, 3, 2, 5]) == [5, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 2, 2, 0], [5, 3, 2, 5]) == [5, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009513", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(67); s.push(8); s.push(43)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(67); s.push(8); s.push(43)\nassert s.peek() == 43\nassert s.pop() == 43\nassert s.pop() == 8\nassert s.is_empty() == False\nassert s.pop() == 67\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009514", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['apple', 'apple', 'avocado']) == {'a': ['apple', 'apple', 'avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'apple', 'avocado']) == {'a': ['apple', 'apple', 'avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009515", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-17, -4, -20]) == -41\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-17, -4, -20]) == -41\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009516", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([6, [6], 8, [3, 4, 2]]) == [6, 6, 8, 3, 4, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [6], 8, [3, 4, 2]]) == [6, 6, 8, 3, 4, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009517", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['c', 'a', 'b']) == {'c': 1, 'a': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'a', 'b']) == {'c': 1, 'a': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009518", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('dcdadaee') == 'dcae'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dcdadaee') == 'dcae'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009519", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([21, 37, 58, 66, 70, 73, 88], 88) == 6\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([21, 37, 58, 66, 70, 73, 88], 88) == 6\nassert binary_search([21, 37, 58, 66, 70, 73, 88], 21) == 0\nassert binary_search([21, 37, 58, 66, 70, 73, 88], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009520", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([5, 50, 5, 0, 12, 42, 7]) == [0, 5, 5, 7, 12, 42, 50]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([5, 50, 5, 0, 12, 42, 7]) == [0, 5, 5, 7, 12, 42, 50]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009521", "instruction": "Write count_substring(s, sub) -> int: overlapping substring count.\n\nExample:\nassert count_substring('abaaaabbbababbba', 'aa') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('abaaaabbbababbba', 'aa') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009522", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['b', 'e', 'b', 'c', 'b']) == {'b': 3, 'e': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'e', 'b', 'c', 'b']) == {'b': 3, 'e': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009523", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([9, 8, 0, 9, 8, 0], 4) == [[9, 8, 0, 9], [8, 0]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 8, 0, 9, 8, 0], 4) == [[9, 8, 0, 9], [8, 0]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009524", "instruction": "Write merge_sort(nums) -> list: merge sort.\n\nExample:\nassert merge_sort([42, 36, 39, 29, 27, 8]) == [8, 27, 29, 36, 39, 42]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([42, 36, 39, 29, 27, 8]) == [8, 27, 29, 36, 39, 42]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009525", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(471) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(471) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009526", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([6, 6, 0, 0, 6, 6, 0, 1], 8) == [6, 6, 0, 0, 6, 6, 0, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([6, 6, 0, 0, 6, 6, 0, 1], 8) == [6, 6, 0, 0, 6, 6, 0, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009527", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([5, 3, 9, 4, 3, 0, 1, 0, 1], 3) == [1, 0, 1, 5, 3, 9, 4, 3, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([5, 3, 9, 4, 3, 0, 1, 0, 1], 3) == [1, 0, 1, 5, 3, 9, 4, 3, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009528", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello', 16) == 'Xubbe'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 16) == 'Xubbe'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009529", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([7, 41, 11]) == [7, 11, 41]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([7, 41, 11]) == [7, 11, 41]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009530", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('ddbbeddeeeaea') == 'dbea'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddbbeddeeeaea') == 'dbea'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009531", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=561; port=off; host=on; user=off') == {'path': '561', 'port': 'off', 'host': 'on', 'user': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=561; port=off; host=on; user=off') == {'path': '561', 'port': 'off', 'host': 'on', 'user': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009532", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(57, 43) == 2451\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(57, 43) == 2451\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009533", "instruction": "Create function parse_kv_pairs(s): key=value parser.\n\nExample:\nassert parse_kv_pairs('mode=391; port=595; user=on') == {'mode': '391', 'port': '595', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=391; port=595; user=on') == {'mode': '391', 'port': '595', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009534", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('babbabaababaaa', 'aba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbabaababaaa', 'aba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009535", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cdcc') == 'cd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdcc') == 'cd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009536", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(2127) == 7212\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2127) == 7212\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009537", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([8, 2, 5, 2], 3) == [[8, 2, 5], [2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 2, 5, 2], 3) == [[8, 2, 5], [2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009538", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('ddccbb') == 'dcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddccbb') == 'dcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009539", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([29, 6, 22, 26, 25, 26, 29]) == 26\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([29, 6, 22, 26, 25, 26, 29]) == 26\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009540", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'d': 63, 'c': 3, 'a': 43, 'e': 58, 'f': 27}) == {63: 'd', 3: 'c', 43: 'a', 58: 'e', 27: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 63, 'c': 3, 'a': 43, 'e': 58, 'f': 27}) == {63: 'd', 3: 'c', 43: 'a', 58: 'e', 27: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009541", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'a': 79, 'c': 57}) == {79: 'a', 57: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 79, 'c': 57}) == {79: 'a', 57: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009542", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('bbbbbbbddddcbbbbbbbbb') == 'b7d4c1b9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbbbddddcbbbbbbbbb') == 'b7d4c1b9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009543", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(802) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(802) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009544", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(125) == 'CXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(125) == 'CXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009545", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(1); s.push(81); s.push(88)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(1); s.push(81); s.push(88)\nassert s.peek() == 88\nassert s.pop() == 88\nassert s.pop() == 81\nassert s.is_empty() == False\nassert s.pop() == 1\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009546", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'a', 'e', 'd', 'a', 'a', 'c']) == {'e': 2, 'a': 3, 'd': 1, 'c': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'e', 'd', 'a', 'a', 'c']) == {'e': 2, 'a': 3, 'd': 1, 'c': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009547", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'coconut', 'banana', 'banana', 'date', 'coconut']) == {'c': ['cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'coconut', 'banana', 'banana', 'date', 'coconut']) == {'c': ['cherry', 'coconut', 'coconut'], 'b': ['banana', 'banana'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009548", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 5) == 'cde'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 5) == 'cde'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009549", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([7, 9, 0, 5, 6, 2, 1, 8, 2, 3, 1, 3], 3) == [[7, 9, 0], [5, 6, 2], [1, 8, 2], [3, 1, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([7, 9, 0, 5, 6, 2, 1, 8, 2, 3, 1, 3], 3) == [[7, 9, 0], [5, 6, 2], [1, 8, 2], [3, 1, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009550", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[5, 3, 3], [3, 0, 5]], [[0, 4], [0, 5], [0, 5]]) == [[0, 50], [0, 37]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[5, 3, 3], [3, 0, 5]], [[0, 4], [0, 5], [0, 5]]) == [[0, 50], [0, 37]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009551", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['coconut', 'banana', 'date', 'avocado', 'apple']) == {'c': ['coconut'], 'b': ['banana'], 'd': ['date'], 'a': ['avocado', 'apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'banana', 'date', 'avocado', 'apple']) == {'c': ['coconut'], 'b': ['banana'], 'd': ['date'], 'a': ['avocado', 'apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009552", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([3, 3, 3, 0, 9, 7, 6], 3) == [[3, 3, 3], [0, 9, 7], [6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([3, 3, 3, 0, 9, 7, 6], 3) == [[3, 3, 3], [0, 9, 7], [6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009553", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('mode=285; user=off; path=857') == {'mode': '285', 'user': 'off', 'path': '857'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=285; user=off; path=857') == {'mode': '285', 'user': 'off', 'path': '857'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009554", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([4, 0, 3, 2, 2]) == [4, 0, 3, 2]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 0, 3, 2, 2]) == [4, 0, 3, 2]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009555", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(438)\nacc.deposit(107)\nacc.withdraw(345)\nacc.withdraw(644)\nassert acc.get_balance() == 545\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(438)\nacc.deposit(107)\nassert acc.get_balance() == 545\nacc.withdraw(345)\nassert acc.get_balance() == 200\nacc.withdraw(644)\nassert acc.get_balance() == 200\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009556", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 5, 1, 4], 5) == [[2, 5, 1, 4]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 5, 1, 4], 5) == [[2, 5, 1, 4]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009557", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([7, 5, 9, 1, 1, 8], [7, 7, 2]) == [7]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 5, 9, 1, 1, 8], [7, 7, 2]) == [7]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009558", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['cherry', 'avocado', 'avocado', 'apple', 'berry']) == {'c': ['cherry'], 'a': ['avocado', 'avocado', 'apple'], 'b': ['berry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'avocado', 'avocado', 'apple', 'berry']) == {'c': ['cherry'], 'a': ['avocado', 'avocado', 'apple'], 'b': ['berry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009559", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[0, 4], [2, 8, 8], 5]) == [0, 4, 2, 8, 8, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[0, 4], [2, 8, 8], 5]) == [0, 4, 2, 8, 8, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009560", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([40, 44, 45, 65, 75, 97], 164) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([40, 44, 45, 65, 75, 97], 164) == -1\nassert binary_search([40, 44, 45, 65, 75, 97], 40) == 0\nassert binary_search([40, 44, 45, 65, 75, 97], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009561", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('ffd', 'ffde') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('ffd', 'ffde') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009562", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(538) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(538) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009563", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([3, 1, 6], [5, 0, 2, 7, 0, 1]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 1, 6], [5, 0, 2, 7, 0, 1]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009564", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([2, 1, 0, 3, 0], [0, 6, 0, 1, 4, 3, 4, 3]) == [1, 0, 3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 1, 0, 3, 0], [0, 6, 0, 1, 4, 3, 4, 3]) == [1, 0, 3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009565", "instruction": "Create function insertion_sort(nums): insertion-sorted new list.\n\nExample:\nassert insertion_sort([41, 3, 50, 49, 24, 31, 25, 45]) == [3, 24, 25, 31, 41, 45, 49, 50]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([41, 3, 50, 49, 24, 31, 25, 45]) == [3, 24, 25, 31, 41, 45, 49, 50]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009566", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(464) == 'CDLXIV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(464) == 'CDLXIV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009567", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(39) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(39) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009568", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([4, 0, 1, 2, 4, 0, 1, 5]) == [4, 0, 1, 2, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([4, 0, 1, 2, 4, 0, 1, 5]) == [4, 0, 1, 2, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009569", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('MMMDCCC') == 3800\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMDCCC') == 3800\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009570", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(2590) == 952\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2590) == 952\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009571", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(9) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(9) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009572", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[4, 9], [8, 5], [8, 7]], [[-5, 2], [3, 2], [2, -6]]) == [[-1, 11], [11, 7], [10, 1]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, 9], [8, 5], [8, 7]], [[-5, 2], [3, 2], [2, -6]]) == [[-1, 11], [11, 7], [10, 1]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009573", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([5, 26, 63, 78, 82, 86, 92, 99], 190) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([5, 26, 63, 78, 82, 86, 92, 99], 190) == -1\nassert binary_search([5, 26, 63, 78, 82, 86, 92, 99], 5) == 0\nassert binary_search([5, 26, 63, 78, 82, 86, 92, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009574", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[0, 2], [1, 1], [3, 5]], [[3, 0], [4, 0]]) == [[8, 0], [7, 0], [29, 0]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 2], [1, 1], [3, 5]], [[3, 0], [4, 0]]) == [[8, 0], [7, 0], [29, 0]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009575", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(39, 142, 625) == 46\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(39, 142, 625) == 46\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009576", "instruction": "Write a Python function invert_dict(d) inverting a dict with unique values: {a: 1} -> {1: 'a'}.\n\nExample:\nassert invert_dict({'a': 45, 'f': 32, 'd': 40}) == {45: 'a', 32: 'f', 40: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'a': 45, 'f': 32, 'd': 40}) == {45: 'a', 32: 'f', 40: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009577", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([16, 50, 42, 26, 7, 31, 20, 18, 39]) == [7, 16, 18, 20, 26, 31, 39, 42, 50]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([16, 50, 42, 26, 7, 31, 20, 18, 39]) == [7, 16, 18, 20, 26, 31, 39, 42, 50]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009578", "instruction": "Write a Python function int_sqrt(n) returning the integer square root (floor) of n.\n\nExample:\nassert int_sqrt(7944) == 89\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(7944) == 89\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009579", "instruction": "Define are_anagrams to test anagram equality of two strings.\n\nExample:\nassert are_anagrams('feeacdd', 'feeacddd') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('feeacdd', 'feeacddd') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009580", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[7, -2, -8], [9, -9, 8]], [[2, 4, -7], [9, -6, 2]]) == [[9, 2, -15], [18, -15, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, -2, -8], [9, -9, 8]], [[2, 4, -7], [9, -6, 2]]) == [[9, 2, -15], [18, -15, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009581", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(352) == 'CCCLII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(352) == 'CCCLII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009582", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[2, 4, 4], [4, 0, 0]], [[3, 1], [1, 5], [5, 0]]) == [[30, 22], [12, 4]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[2, 4, 4], [4, 0, 0]], [[3, 1], [1, 5], [5, 0]]) == [[30, 22], [12, 4]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009583", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('(a') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('(a') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009584", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('2h49m59s') == 10199\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h49m59s') == 10199\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009585", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([1, 4, 4, 0, 4, 0, 3, 3, 5], 4) == [[1, 4, 4, 0], [4, 0, 3, 3], [5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 4, 4, 0, 4, 0, 3, 3, 5], 4) == [[1, 4, 4, 0], [4, 0, 3, 3], [5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009586", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[2, 5], [9, 4, 6, 2], [5, 7, 9], 6]) == [2, 5, 9, 4, 6, 2, 5, 7, 9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 5], [9, 4, 6, 2], [5, 7, 9], 6]) == [2, 5, 9, 4, 6, 2, 5, 7, 9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009587", "instruction": "Create function word_freq_text(text): cleaned word counts.\n\nExample:\nassert word_freq_text('cat the Ran sat cat cat, sun Cat') == {'cat': 4, 'the': 1, 'ran': 1, 'sat': 1, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('cat the Ran sat cat cat, sun Cat') == {'cat': 4, 'the': 1, 'ran': 1, 'sat': 1, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009588", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([14, 38, 42, 5, 2, 3, 35, 5]) == [2, 3, 5, 5, 14, 35, 38, 42]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([14, 38, 42, 5, 2, 3, 35, 5]) == [2, 3, 5, 5, 14, 35, 38, 42]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009589", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([5, [3, 0, 8, 8], [2, 3, 3]]) == [5, 3, 0, 8, 8, 2, 3, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [3, 0, 8, 8], [2, 3, 3]]) == [5, 3, 0, 8, 8, 2, 3, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009590", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(59) == [59]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(59) == [59]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009591", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('MMMLXII') == 3062\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMLXII') == 3062\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009592", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['e', 'a', 'd', 'a', 'c', 'c', 'e', 'a']) == {'e': 2, 'a': 3, 'd': 1, 'c': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'd', 'a', 'c', 'c', 'e', 'a']) == {'e': 2, 'a': 3, 'd': 1, 'c': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009593", "instruction": "Implement rotate_list(nums, k): right rotation by k.\n\nExample:\nassert rotate_list([2, 6, 8, 2, 3, 0, 2, 9, 1, 2], 2) == [1, 2, 2, 6, 8, 2, 3, 0, 2, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 6, 8, 2, 3, 0, 2, 9, 1, 2], 2) == [1, 2, 2, 6, 8, 2, 3, 0, 2, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009594", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([9, [9, 1]]) == 19\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([9, [9, 1]]) == 19\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009595", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('user=21; path=261; port=off') == {'user': '21', 'path': '261', 'port': 'off'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('user=21; path=261; port=off') == {'user': '21', 'path': '261', 'port': 'off'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009596", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 3, 2, 2, 0, 3]) == [3, 2, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 2, 2, 0, 3]) == [3, 2, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009597", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(422) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(422) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009598", "instruction": "Define csv_parse_line splitting a CSV record honoring quotes.\n\nExample:\nassert csv_parse_line('bbbb,caad,bb,e,deda') == ['bbbb', 'caad', 'bb', 'e', 'deda']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bbbb,caad,bb,e,deda') == ['bbbb', 'caad', 'bb', 'e', 'deda']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009599", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(8535) == 92\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8535) == 92\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009600", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-3, 2, -2], [-3, 8, -2], [2, 1, 3]], [[1, -3, -7], [-2, 6, -4], [-1, -1, 4]]) == [[-2, -1, -9], [-5, 14, -6], [1, 0, 7]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-3, 2, -2], [-3, 8, -2], [2, 1, 3]], [[1, -3, -7], [-2, 6, -4], [-1, -1, 4]]) == [[-2, -1, -9], [-5, 14, -6], [1, 0, 7]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009601", "instruction": "Create function run_length_encode(s) that compresses runs of identical characters as character followed by count.\n\nExample:\nassert run_length_encode('bbbbbb') == 'b6'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbbb') == 'b6'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009602", "instruction": "Define power_mod for fast powmod.\n\nExample:\nassert power_mod(50, 187, 826) == 260\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(50, 187, 826) == 260\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009603", "instruction": "Write a Python function matrix_add(a, b) adding two same-shaped matrices (lists of lists).\n\nExample:\nassert matrix_add([[2, -5], [-4, 7], [-8, 8]], [[4, 1], [9, -7], [4, 8]]) == [[6, -4], [5, 0], [-4, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[2, -5], [-4, 7], [-8, 8]], [[4, 1], [9, -7], [4, 8]]) == [[6, -4], [5, 0], [-4, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009604", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(11, 23) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(11, 23) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009605", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('[(}}(') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[(}}(') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009606", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('geddhhdg c ehdgg g d') == 'geddhhdg'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('geddhhdg c ehdgg g d') == 'geddhhdg'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009607", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([6, 9, 4, 0, 8, 5, 7, 2, 2], 3) == [[6, 9, 4], [0, 8, 5], [7, 2, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 9, 4, 0, 8, 5, 7, 2, 2], 3) == [[6, 9, 4], [0, 8, 5], [7, 2, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009608", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(142)\nacc.deposit(272)\nacc.withdraw(101)\nacc.withdraw(550)\nassert acc.get_balance() == 414\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(142)\nacc.deposit(272)\nassert acc.get_balance() == 414\nacc.withdraw(101)\nassert acc.get_balance() == 313\nacc.withdraw(550)\nassert acc.get_balance() == 313\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009609", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXXIX') == 279\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXIX') == 279\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009610", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(7541) == 1457\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(7541) == 1457\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009611", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['avocado', 'cherry', 'apple', 'cherry', 'avocado', 'berry', 'banana']) == {'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry', 'cherry'], 'b': ['berry', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['avocado', 'cherry', 'apple', 'cherry', 'avocado', 'berry', 'banana']) == {'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry', 'cherry'], 'b': ['berry', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009612", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([5, 1, 4, 2], [8, 1, 3, 2, 5]) == [5, 1, 2]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 1, 4, 2], [8, 1, 3, 2, 5]) == [5, 1, 2]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009613", "instruction": "Write a Python function second_largest(nums) returning the second largest distinct value (assume at least 2 distinct).\n\nExample:\nassert second_largest([14, 23, 11, 17, 27, 14]) == 23\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([14, 23, 11, 17, 27, 14]) == 23\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009614", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('[b][') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('[b][') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009615", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([2, 2, 4, 5, 8, 10], [0, 1, 8, 15, 15, 20]) == [0, 1, 2, 2, 4, 5, 8, 8, 10, 15, 15, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 2, 4, 5, 8, 10], [0, 1, 8, 15, 15, 20]) == [0, 1, 2, 2, 4, 5, 8, 8, 10, 15, 15, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009616", "instruction": "Write a Python function is_armstrong(n) returning True if n is an Armstrong number (sum of its digits each raised to the digit count equals n).\n\nExample:\nassert is_armstrong(773) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(773) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009617", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([9, 0, 10, 12, 15, 10]) == 12\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([9, 0, 10, 12, 15, 10]) == 12\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009618", "instruction": "Write eval_expr(expr) -> int: expression evaluation.\n\nExample:\nassert eval_expr('15') == 15\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('15') == 15\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009619", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[0, 7, 5, 4], [4, 6, 6, 3]]) == [0, 7, 5, 4, 4, 6, 6, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[0, 7, 5, 4], [4, 6, 6, 3]]) == [0, 7, 5, 4, 4, 6, 6, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009620", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([12, 46, 49, 59, 69, 76], 162) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([12, 46, 49, 59, 69, 76], 162) == -1\nassert binary_search([12, 46, 49, 59, 69, 76], 12) == 0\nassert binary_search([12, 46, 49, 59, 69, 76], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009621", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([0, 0, 0, 2, 4, 3, 2, 1]) == [0, 2, 4, 3, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 0, 2, 4, 3, 2, 1]) == [0, 2, 4, 3, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009622", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['yxz', '']) == ''\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['yxz', '']) == ''\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009623", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([21, 33, 37, 4, 25, 38, 46, 48, 12]) == [4, 12, 21, 25, 33, 37, 38, 46, 48]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([21, 33, 37, 4, 25, 38, 46, 48, 12]) == [4, 12, 21, 25, 33, 37, 38, 46, 48]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009624", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([46, 25, 5, 12, 26, 5, 48, 35]) == [5, 5, 12, 25, 26, 35, 46, 48]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([46, 25, 5, 12, 26, 5, 48, 35]) == [5, 5, 12, 25, 26, 35, 46, 48]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009625", "instruction": "Create function merge_sort(nums): mergesorted new list.\n\nExample:\nassert merge_sort([27, 41, 38, 21, 5, 42, 5, 26, 42, 49, 26, 23, 42, 17]) == [5, 5, 17, 21, 23, 26, 26, 27, 38, 41, 42, 42, 42, 49]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([27, 41, 38, 21, 5, 42, 5, 26, 42, 49, 26, 23, 42, 17]) == [5, 5, 17, 21, 23, 26, 26, 27, 38, 41, 42, 42, 42, 49]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009626", "instruction": "Implement csv_parse_line(line): single-line CSV parser with quote handling.\n\nExample:\nassert csv_parse_line('80,ca') == ['80', 'ca']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('80,ca') == ['80', 'ca']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009627", "instruction": "Define group_by_key grouping words by initial.\n\nExample:\nassert group_by_key(['banana', 'avocado', 'cherry', 'apple', 'banana', 'berry', 'avocado']) == {'b': ['banana', 'banana', 'berry'], 'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'avocado', 'cherry', 'apple', 'banana', 'berry', 'avocado']) == {'b': ['banana', 'banana', 'berry'], 'a': ['avocado', 'apple', 'avocado'], 'c': ['cherry']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009628", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(448) == 22\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(448) == 22\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009629", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('path=auto; mode=932; user=694; host=20') == {'path': 'auto', 'mode': '932', 'user': '694', 'host': '20'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=auto; mode=932; user=694; host=20') == {'path': 'auto', 'mode': '932', 'user': '694', 'host': '20'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009630", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'x': 8}, {'x': 4, 'y': 2, 'w': 3}) == {'x': 12, 'y': 2, 'w': 3}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 8}, {'x': 4, 'y': 2, 'w': 3}) == {'x': 12, 'y': 2, 'w': 3}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009631", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([-8, 17, -2, -15, -10]) == -18\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-8, 17, -2, -15, -10]) == -18\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009632", "instruction": "Write a Python function list_sum(nums) that returns the sum of the list.\n\nExample:\nassert list_sum([-6, -19]) == -25\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-6, -19]) == -25\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009633", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([7, 2, 7, 0, 2], [8, 8, 3]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([7, 2, 7, 0, 2], [8, 8, 3]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009634", "instruction": "Create function caesar_cipher: Caesar cipher shifting letters by k with wraparound.\n\nExample:\nassert caesar_cipher('Code World', 3) == 'Frgh Zruog'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code World', 3) == 'Frgh Zruog'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009635", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 4, 'y': 6, 'w': 7}, {'x': 2, 'y': 8, 'w': 6}) == {'z': 4, 'y': 14, 'w': 13, 'x': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4, 'y': 6, 'w': 7}, {'x': 2, 'y': 8, 'w': 6}) == {'z': 4, 'y': 14, 'w': 13, 'x': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009636", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('\"b,bba\",\"a,b\",acd,eeeb') == ['b,bba', 'a,b', 'acd', 'eeeb']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('\"b,bba\",\"a,b\",acd,eeeb') == ['b,bba', 'a,b', 'acd', 'eeeb']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009637", "instruction": "Write a recursive Python function flatten_recursive(x) fully flattening nested lists.\n\nExample:\nassert flatten_recursive([[7], [4, 5]]) == [7, 4, 5]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7], [4, 5]]) == [7, 4, 5]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009638", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['e', 'a', 'b', 'e']) == {'e': 2, 'a': 1, 'b': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['e', 'a', 'b', 'e']) == {'e': 2, 'a': 1, 'b': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009639", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('abc', 12) == 'mno'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 12) == 'mno'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009640", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('bbbbabaaa') == 'b4a1b1a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('bbbbabaaa') == 'b4a1b1a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009641", "instruction": "Create function matrix_multiply(a, b): matrix product.\n\nExample:\nassert matrix_multiply([[4, 0], [3, 5]], [[4, 1, 5], [5, 0, 0]]) == [[16, 4, 20], [37, 3, 15]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[4, 0], [3, 5]], [[4, 1, 5], [5, 0, 0]]) == [[16, 4, 20], [37, 3, 15]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009642", "instruction": "Implement list_intersection(a, b): ordered intersection without duplicates.\n\nExample:\nassert list_intersection([5, 7, 0, 8, 8, 6, 8], [5, 7, 6, 7, 6]) == [5, 7, 6]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 7, 0, 8, 8, 6, 8], [5, 7, 6, 7, 6]) == [5, 7, 6]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009643", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[3, 3], [4, 9, 6], 6, 0]) == [3, 3, 4, 9, 6, 6, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[3, 3], [4, 9, 6], 6, 0]) == [3, 3, 4, 9, 6, 6, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009644", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens(')[}{)]][') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens(')[}{)]][') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009645", "instruction": "Implement matrix_add(a, b): matrix addition.\n\nExample:\nassert matrix_add([[4, -5], [1, -9], [4, 8]], [[1, 1], [-3, -2], [5, 9]]) == [[5, -4], [-2, -11], [9, 17]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[4, -5], [1, -9], [4, 8]], [[1, 1], [-3, -2], [5, 9]]) == [[5, -4], [-2, -11], [9, 17]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009646", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cdbb') == 'cdb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cdbb') == 'cdb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009647", "instruction": "Implement second_largest(nums): second-largest distinct element.\n\nExample:\nassert second_largest([0, 9, 10, 13, 10, 13, 0]) == 10\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([0, 9, 10, 13, 10, 13, 0]) == 10\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009648", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 7, 0, 4, 1, 9, 0, 3], [5, 3, 6, 3]) == [3]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 7, 0, 4, 1, 9, 0, 3], [5, 3, 6, 3]) == [3]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009649", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMMXV') == 3015\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMXV') == 3015\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009650", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('ebabdd') == 'ebad'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ebabdd') == 'ebad'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009651", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(55); s.push(2); s.push(3)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(55); s.push(2); s.push(3)\nassert s.peek() == 3\nassert s.pop() == 3\nassert s.pop() == 2\nassert s.is_empty() == False\nassert s.pop() == 55\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009652", "instruction": "Write longest_word(s) -> str: longest word.\n\nExample:\nassert longest_word('debfbh e') == 'debfbh'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('debfbh e') == 'debfbh'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009653", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(4861) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(4861) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009654", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([41, 41, 11]) == [11, 41, 41]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([41, 41, 11]) == [11, 41, 41]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009655", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(86) == [2, 43]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(86) == [2, 43]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009656", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(2241) == 'MMCCXLI'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(2241) == 'MMCCXLI'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009657", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('babbaa', 'abbb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('babbaa', 'abbb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009658", "instruction": "Define bubble_sort performing bubble sort.\n\nExample:\nassert bubble_sort([21, 11, 11, 9, 26, 49, 21, 1, 11, 34, 36]) == [1, 9, 11, 11, 11, 21, 21, 26, 34, 36, 49]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([21, 11, 11, 9, 26, 49, 21, 1, 11, 34, 36]) == [1, 9, 11, 11, 11, 21, 21, 26, 34, 36, 49]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009659", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([6, 38, 16, -23, -21, 41, -50, 26]) == 41\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([6, 38, 16, -23, -21, 41, -50, 26]) == 41\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009660", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([5, 1, 0, 4]) == [5, 1, 0, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 1, 0, 4]) == [5, 1, 0, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009661", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[2, 6], [5, 8], 1]) == 22\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[2, 6], [5, 8], 1]) == 22\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009662", "instruction": "Write a Python function prime_factors(n) returning the list of prime factors of n (with multiplicity, ascending).\n\nExample:\nassert prime_factors(217) == [7, 31]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(217) == [7, 31]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009663", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[0, 3, 6], [6, 9, 2], [3, 4, 0]]) == 33\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 3, 6], [6, 9, 2], [3, 4, 0]]) == 33\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009664", "instruction": "Define int_sqrt computing integer square root.\n\nExample:\nassert int_sqrt(330560) == 574\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(330560) == 574\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009665", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([1, 9, 6, 3, 2, 8, 7], 3) == [[1, 9, 6], [3, 2, 8], [7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([1, 9, 6, 3, 2, 8, 7], 3) == [[1, 9, 6], [3, 2, 8], [7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009666", "instruction": "Write power_mod(a, e, m) -> int: modular power.\n\nExample:\nassert power_mod(5, 71, 543) == 479\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(5, 71, 543) == 479\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009667", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('accabcbaccbb', 'cac') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('accabcbaccbb', 'cac') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009668", "instruction": "Implement longest_common_prefix(strs): longest common prefix.\n\nExample:\nassert longest_common_prefix(['abyyx', 'abz', 'ab', 'abz']) == 'ab'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['abyyx', 'abz', 'ab', 'abz']) == 'ab'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009669", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[0, 1, 0]]) == 1\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[0, 1, 0]]) == 1\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009670", "instruction": "Write a Python function gcd(a, b) returning the greatest common divisor.\n\nExample:\nassert gcd(17, 111) == 1\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(17, 111) == 1\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009671", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([[1, 9, 9], [0, 6, 5, 8], [4, 5], [2, 0, 5, 0], 6]) == [1, 9, 9, 0, 6, 5, 8, 4, 5, 2, 0, 5, 0, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 9, 9], [0, 6, 5, 8], [4, 5], [2, 0, 5, 0], 6]) == [1, 9, 9, 0, 6, 5, 8, 4, 5, 2, 0, 5, 0, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009672", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([12, 14, 43, 51, 59, 72, 80], 43) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([12, 14, 43, 51, 59, 72, 80], 43) == 2\nassert binary_search([12, 14, 43, 51, 59, 72, 80], 12) == 0\nassert binary_search([12, 14, 43, 51, 59, 72, 80], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009673", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([2, 3, 8, 23, 11, 6, 3, 9]) == 11\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 3, 8, 23, 11, 6, 3, 9]) == 11\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009674", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(3647) == 20\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(3647) == 20\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009675", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(780) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(780) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009676", "instruction": "Create function power_mod(a, e, m): (a**e) mod m.\n\nExample:\nassert power_mod(18, 2, 83) == 75\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(18, 2, 83) == 75\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009677", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(60) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(60) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009678", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=on; user=910; port=246; host=32') == {'path': 'on', 'user': '910', 'port': '246', 'host': '32'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=on; user=910; port=246; host=32') == {'path': 'on', 'user': '910', 'port': '246', 'host': '32'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009679", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('46,ecda,54,\"aaa,\"') == ['46', 'ecda', '54', 'aaa,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('46,ecda,54,\"aaa,\"') == ['46', 'ecda', '54', 'aaa,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009680", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([25, 31, 15, 37, 19, 21, 2, 22]) == [2, 15, 19, 21, 22, 25, 31, 37]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([25, 31, 15, 37, 19, 21, 2, 22]) == [2, 15, 19, 21, 22, 25, 31, 37]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009681", "instruction": "Create function merge_dicts_sum(a, b): merged dict, values summed on collision.\n\nExample:\nassert merge_dicts_sum({'z': 3, 'y': 4}, {'y': 3, 'x': 4}) == {'z': 3, 'y': 7, 'x': 4}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3, 'y': 4}, {'y': 3, 'x': 4}) == {'z': 3, 'y': 7, 'x': 4}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009682", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'banana', 'apple']) == {'c': ['coconut'], 'a': ['apple', 'apple'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'banana', 'apple']) == {'c': ['coconut'], 'a': ['apple', 'apple'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009683", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(7644) == 21\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(7644) == 21\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009684", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([1, 9, 7, 0, 6, 0, 1, 4, 5, 7], 6) == [6, 0, 1, 4, 5, 7, 1, 9, 7, 0]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([1, 9, 7, 0, 6, 0, 1, 4, 5, 7], 6) == [6, 0, 1, 4, 5, 7, 1, 9, 7, 0]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009685", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('11m16s') == 676\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('11m16s') == 676\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009686", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('bba,\"abb,\"') == ['bba', 'abb,']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('bba,\"abb,\"') == ['bba', 'abb,']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009687", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(3201) == 56\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(3201) == 56\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009688", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(198) == 'CXCVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(198) == 'CXCVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009689", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(50); s.push(62); s.push(32)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(50); s.push(62); s.push(32)\nassert s.peek() == 32\nassert s.pop() == 32\nassert s.pop() == 62\nassert s.is_empty() == False\nassert s.pop() == 50\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009690", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['berry', 'banana', 'avocado', 'date', 'banana']) == {'b': ['berry', 'banana', 'banana'], 'a': ['avocado'], 'd': ['date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'banana', 'avocado', 'date', 'banana']) == {'b': ['berry', 'banana', 'banana'], 'a': ['avocado'], 'd': ['date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009691", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[7, 7], [3, 6], [0, 5]], [[-6, 3], [-5, 3], [-6, 5]]) == [[1, 10], [-2, 9], [-6, 10]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[7, 7], [3, 6], [0, 5]], [[-6, 3], [-5, 3], [-6, 5]]) == [[1, 10], [-2, 9], [-6, 10]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009692", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('3h43m16s') == 13396\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h43m16s') == 13396\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009693", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[0, 0, 4], [3, 0, 3]], [[0, 3, 4], [1, 5, 5], [5, 4, 0]]) == [[20, 16, 0], [15, 21, 12]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 0, 4], [3, 0, 3]], [[0, 3, 4], [1, 5, 5], [5, 4, 0]]) == [[20, 16, 0], [15, 21, 12]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009694", "instruction": "Create function csv_parse_line(line): CSV fields as a list of strings.\n\nExample:\nassert csv_parse_line('aeea,32,\"ba,b\"') == ['aeea', '32', 'ba,b']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('aeea,32,\"ba,b\"') == ['aeea', '32', 'ba,b']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009695", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('ddcecd') == 'dce'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('ddcecd') == 'dce'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009696", "instruction": "Create function prime_factors(n): prime factors ascending with multiplicity.\n\nExample:\nassert prime_factors(283) == [283]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(283) == [283]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009697", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('dccbdbbdbd') == 'dcb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dccbdbbdbd') == 'dcb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009698", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(224) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(224) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009699", "instruction": "Write int_sqrt(n) -> int: isqrt.\n\nExample:\nassert int_sqrt(8305) == 91\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(8305) == 91\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009700", "instruction": "Write prime_factors(n) -> list: prime factors.\n\nExample:\nassert prime_factors(23) == [23]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(23) == [23]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009701", "instruction": "Write a Python function matrix_multiply(a, b) multiplying two matrices (a is r x k, b is k x c).\n\nExample:\nassert matrix_multiply([[0, 1], [1, 4], [5, 1]], [[3, 5, 5], [1, 2, 3]]) == [[1, 2, 3], [7, 13, 17], [16, 27, 28]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 1], [1, 4], [5, 1]], [[3, 5, 5], [1, 2, 3]]) == [[1, 2, 3], [7, 13, 17], [16, 27, 28]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009702", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 7, 5, 2, 6, 1, 1, 7], 4) == [[8, 7, 5, 2], [6, 1, 1, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 7, 5, 2, 6, 1, 1, 7], 4) == [[8, 7, 5, 2], [6, 1, 1, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009703", "instruction": "Define dedupe_list removing duplicate list elements in order.\n\nExample:\nassert dedupe_list([1, 5, 4, 0]) == [1, 5, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 5, 4, 0]) == [1, 5, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009704", "instruction": "Implement run_length_encode(s): run-length encoding of the string.\n\nExample:\nassert run_length_encode('cccaa') == 'c3a2'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('cccaa') == 'c3a2'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009705", "instruction": "Implement int_sqrt(n): floor of sqrt via binary search.\n\nExample:\nassert int_sqrt(317798) == 563\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(317798) == 563\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009706", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([9, 1, 6, 4, 3, 4, 0, 7, 7, 9], 2) == [[9, 1], [6, 4], [3, 4], [0, 7], [7, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 1, 6, 4, 3, 4, 0, 7, 7, 9], 2) == [[9, 1], [6, 4], [3, 4], [0, 7], [7, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009707", "instruction": "Write flatten_recursive(x) -> list: deep flatten.\n\nExample:\nassert flatten_recursive([[1, 9, 5], [8, 1, 0]]) == [1, 9, 5, 8, 1, 0]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[1, 9, 5], [8, 1, 0]]) == [1, 9, 5, 8, 1, 0]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009708", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([2, 2, 4], [8, 0, 8, 6]) == []\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([2, 2, 4], [8, 0, 8, 6]) == []\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009709", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(6666) == 24\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(6666) == 24\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009710", "instruction": "Define int_to_roman producing Roman numerals.\n\nExample:\nassert int_to_roman(232) == 'CCXXXII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(232) == 'CCXXXII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009711", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('cbaacbbaaaacbbc', 'acbb') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('cbaacbbaaaacbbc', 'acbb') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009712", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-9, -1, -8, -9], [7, -5, 3, -1], [-4, -4, 8, 2], [4, -9, -2, 3]], [[4, -2, 7, 0], [-8, 9, 9, 0], [7, -2, -6, -7], [0, 8, 7, -6]]) == [[-5, -3, -1, -9], [-1, 4, 12, -1], [3, -6, 2, -5], [4, -1, 5, -3]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-9, -1, -8, -9], [7, -5, 3, -1], [-4, -4, 8, 2], [4, -9, -2, 3]], [[4, -2, 7, 0], [-8, 9, 9, 0], [7, -2, -6, -7], [0, 8, 7, -6]]) == [[-5, -3, -1, -9], [-1, 4, 12, -1], [3, -6, 2, -5], [4, -1, 5, -3]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009713", "instruction": "Write a Python function count_substring(s, sub) counting occurrences of sub in s, including overlapping ones.\n\nExample:\nassert count_substring('aaababbbaabaabb', 'baab') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaababbbaabaabb', 'baab') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009714", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MDXCIX') == 1599\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MDXCIX') == 1599\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009715", "instruction": "Write matrix_multiply(a, b) -> list of lists: matmul.\n\nExample:\nassert matrix_multiply([[0, 4], [1, 2]], [[3, 1, 3], [2, 0, 3]]) == [[8, 0, 12], [7, 1, 9]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[0, 4], [1, 2]], [[3, 1, 3], [2, 0, 3]]) == [[8, 0, 12], [7, 1, 9]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009716", "instruction": "Write chunk_list(nums, k) -> list of lists: chunking.\n\nExample:\nassert chunk_list([8, 4, 8, 6, 5, 1, 3, 9], 3) == [[8, 4, 8], [6, 5, 1], [3, 9]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 4, 8, 6, 5, 1, 3, 9], 3) == [[8, 4, 8], [6, 5, 1], [3, 9]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009717", "instruction": "Write dedupe_chars(s) -> str: dedupe preserving order.\n\nExample:\nassert dedupe_chars('abdbc') == 'abdc'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('abdbc') == 'abdc'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009718", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 62, 'c': 57}) == {62: 'd', 57: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 62, 'c': 57}) == {62: 'd', 57: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009719", "instruction": "Write a Python function quicksort(nums) sorting the list with quicksort (return a new list).\n\nExample:\nassert quicksort([5, 21, 34, 0, 5, 25, 46, 19, 26]) == [0, 5, 5, 19, 21, 25, 26, 34, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([5, 21, 34, 0, 5, 25, 46, 19, 26]) == [0, 5, 5, 19, 21, 25, 26, 34, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009720", "instruction": "Create function parse_duration(s): parse h/m/s duration.\n\nExample:\nassert parse_duration('2h52m36s') == 10356\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('2h52m36s') == 10356\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009721", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([3, [8]]) == [3, 8]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([3, [8]]) == [3, 8]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009722", "instruction": "Define is_armstrong checking the Armstrong property.\n\nExample:\nassert is_armstrong(441) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(441) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009723", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=387; path=106') == {'mode': '387', 'path': '106'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=387; path=106') == {'mode': '387', 'path': '106'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009724", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([1, [9], [3]]) == [1, 9, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([1, [9], [3]]) == [1, 9, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009725", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([-1, 11, 48, 34, 27, -36]) == 48\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-1, 11, 48, 34, 27, -36]) == 48\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009726", "instruction": "Create function longest_common_prefix(strs): common prefix string.\n\nExample:\nassert longest_common_prefix(['bbxyy', 'bbxx', 'bb']) == 'bb'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['bbxyy', 'bbxx', 'bb']) == 'bb'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009727", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([10, 48, 50, 65, 66, 96, 99], 157) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 48, 50, 65, 66, 96, 99], 157) == -1\nassert binary_search([10, 48, 50, 65, 66, 96, 99], 10) == 0\nassert binary_search([10, 48, 50, 65, 66, 96, 99], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009728", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'w': 5, 'y': 7}, {'z': 5, 'x': 7, 'w': 2}) == {'w': 7, 'y': 7, 'z': 5, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 5, 'y': 7}, {'z': 5, 'x': 7, 'w': 2}) == {'w': 7, 'y': 7, 'z': 5, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009729", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('3h40m9s') == 13209\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('3h40m9s') == 13209\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009730", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('adb', 'dba') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('adb', 'dba') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009731", "instruction": "Implement BankAccount: deposit, withdraw with insufficient-funds guard, get_balance.\n\nExample:\nacc = BankAccount(446)\nacc.deposit(112)\nacc.withdraw(416)\nacc.withdraw(658)\nassert acc.get_balance() == 558\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(446)\nacc.deposit(112)\nassert acc.get_balance() == 558\nacc.withdraw(416)\nassert acc.get_balance() == 142\nacc.withdraw(658)\nassert acc.get_balance() == 142\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009732", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 4, 5, 1]) == [3, 4, 5, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 5, 1]) == [3, 4, 5, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009733", "instruction": "Create function dedupe_chars(s): unique characters in order of appearance.\n\nExample:\nassert dedupe_chars('aace') == 'ace'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('aace') == 'ace'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009734", "instruction": "Implement bubble_sort(nums): bubble sort.\n\nExample:\nassert bubble_sort([2, 47, 44, 7, 50, 18, 50, 30]) == [2, 7, 18, 30, 44, 47, 50, 50]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([2, 47, 44, 7, 50, 18, 50, 30]) == [2, 7, 18, 30, 44, 47, 50, 50]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009735", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([-4, -5, -4]) == [-4, -9, -13]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-4, -5, -4]) == [-4, -9, -13]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009736", "instruction": "Define merge_sort performing merge sort.\n\nExample:\nassert merge_sort([32, 43, 37, 38, 11, 29, 6, 20, 26, 14, 18, 30, 32]) == [6, 11, 14, 18, 20, 26, 29, 30, 32, 32, 37, 38, 43]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([32, 43, 37, 38, 11, 29, 6, 20, 26, 14, 18, 30, 32]) == [6, 11, 14, 18, 20, 26, 29, 30, 32, 32, 37, 38, 43]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009737", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(8 - 12) + 8') == 4\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(8 - 12) + 8') == 4\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009738", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1, 1, 5, 6, 15, 19, 20], [4, 10, 10, 12, 12, 18]) == [1, 1, 4, 5, 6, 10, 10, 12, 12, 15, 18, 19, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 1, 5, 6, 15, 19, 20], [4, 10, 10, 12, 12, 18]) == [1, 1, 4, 5, 6, 10, 10, 12, 12, 15, 18, 19, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009739", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([11, 44, 37, 12, 35]) == [11, 12, 35, 37, 44]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([11, 44, 37, 12, 35]) == [11, 12, 35, 37, 44]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009740", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(68) == 14\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(68) == 14\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009741", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([8, 5, [4, 8, [6, 5, 1]]]) == 37\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([8, 5, [4, 8, [6, 5, 1]]]) == 37\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009742", "instruction": "Implement is_armstrong(n): Armstrong/narcissistic number test.\n\nExample:\nassert is_armstrong(1113) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(1113) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009743", "instruction": "Define lcm computing the LCM.\n\nExample:\nassert lcm(50, 16) == 400\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(50, 16) == 400\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009744", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([47, 11, -7, 11, 27, -17, -10, -5, -13]) == 47\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([47, 11, -7, 11, 27, -17, -10, -5, -13]) == 47\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009745", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 3, 'z': 2}, {'x': 9}) == {'x': 12, 'z': 2}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 3, 'z': 2}, {'x': 9}) == {'x': 12, 'z': 2}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009746", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['c', 'e', 'a', 'd', 'e']) == {'c': 1, 'e': 2, 'a': 1, 'd': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['c', 'e', 'a', 'd', 'e']) == {'c': 1, 'e': 2, 'a': 1, 'd': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009747", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CXIX') == 119\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CXIX') == 119\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009748", "instruction": "Write a Python function merge_sort(nums) sorting the list with merge sort (return a new list).\n\nExample:\nassert merge_sort([45, 42, 19, 11, 2]) == [2, 11, 19, 42, 45]\n\nImplement exactly this signature: `def merge_sort(nums)`. The tests call it directly.", "tests": "assert merge_sort([45, 42, 19, 11, 2]) == [2, 11, 19, 42, 45]\nassert merge_sort([3, 1, 2]) == [1, 2, 3]\nassert merge_sort([]) == []", "family": "merge_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009749", "instruction": "Implement title_case(s): title-case every word in the string.\n\nExample:\nassert title_case('caac') == 'Caac'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('caac') == 'Caac'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009750", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran dog cat dog cat cat sat Ran') == {'ran': 2, 'dog': 2, 'cat': 3, 'sat': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran dog cat dog cat cat sat Ran') == {'ran': 2, 'dog': 2, 'cat': 3, 'sat': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009751", "instruction": "Write dict_filter(d, t) -> dict: value filter.\n\nExample:\nassert dict_filter({'b': 0, 'c': 3, 'd': 9}, 2) == {'c': 3, 'd': 9}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'b': 0, 'c': 3, 'd': 9}, 2) == {'c': 3, 'd': 9}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009752", "instruction": "Write count_vowels(s) -> int: count of vowels.\n\nExample:\nassert count_vowels('hpsdedoosal') == 4\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('hpsdedoosal') == 4\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009753", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 7}, {'w': 1}) == {'z': 7, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 7}, {'w': 1}) == {'z': 7, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009754", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([6, 4]) == [6, 10]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([6, 4]) == [6, 10]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009755", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aaaabbabbbbbbba', 'aa') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aaaabbabbbbbbba', 'aa') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009756", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([27, 4, 42, 48, 38, 18, 39, 42, 23, 20, 22, 31]) == [4, 18, 20, 22, 23, 27, 31, 38, 39, 42, 42, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([27, 4, 42, 48, 38, 18, 39, 42, 23, 20, 22, 31]) == [4, 18, 20, 22, 23, 27, 31, 38, 39, 42, 42, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009757", "instruction": "Define digit_sum summing decimal digits.\n\nExample:\nassert digit_sum(4905) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(4905) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009758", "instruction": "Define longest_common_prefix finding the shared prefix.\n\nExample:\nassert longest_common_prefix(['zz', 'zx']) == 'z'\n\nImplement exactly this signature: `def longest_common_prefix(strs)`. The tests call it directly.", "tests": "assert longest_common_prefix(['zz', 'zx']) == 'z'\nassert longest_common_prefix(['flower', 'flow', 'flight']) == 'fl'\nassert longest_common_prefix(['dog', 'cat']) == ''\nassert longest_common_prefix([]) == ''", "family": "longest_common_prefix", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009759", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(397) == 27\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(397) == 27\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009760", "instruction": "Implement a Stack class: push, pop, peek, is_empty.\n\nExample:\ns = Stack()\ns.push(35); s.push(19); s.push(63)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(35); s.push(19); s.push(63)\nassert s.peek() == 63\nassert s.pop() == 63\nassert s.pop() == 19\nassert s.is_empty() == False\nassert s.pop() == 35\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009761", "instruction": "Define is_palindrome to test if a string is a palindrome.\n\nExample:\nassert is_palindrome('bbaxyz') == False\n\nImplement exactly this signature: `def is_palindrome(s)`. The tests call it directly.", "tests": "assert is_palindrome('bbaxyz') == False\nassert is_palindrome('racecar') == True\nassert is_palindrome('hello') == False", "family": "str_palindrome", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009762", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([5, 0, 1, 0, 1], [4, 3, 5, 0, 1, 3]) == [5, 0, 1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 0, 1, 0, 1], [4, 3, 5, 0, 1, 3]) == [5, 0, 1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009763", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[9, 1, 6]]) == 16\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[9, 1, 6]]) == 16\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009764", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('baaab', 'baa') == 1\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('baaab', 'baa') == 1\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009765", "instruction": "Write pow_recursive(a, e) -> number: recursive pow.\n\nExample:\nassert pow_recursive(5, 12) == 244140625\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(5, 12) == 244140625\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009766", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(98) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(98) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009767", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 37, 'c': 50}) == {37: 'd', 50: 'c'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 37, 'c': 50}) == {37: 'd', 50: 'c'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009768", "instruction": "Write nested_sum(x) -> int: nested sum.\n\nExample:\nassert nested_sum([[4, [6, 0, 3], [3]], 5]) == 21\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[4, [6, 0, 3], [3]], 5]) == 21\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009769", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=782; host=418; port=144; user=auto') == {'path': '782', 'host': '418', 'port': '144', 'user': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=782; host=418; port=144; user=auto') == {'path': '782', 'host': '418', 'port': '144', 'user': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009770", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('CCLXXXIV') == 284\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXXIV') == 284\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009771", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([3, 30, 2, 15, 3, 46]) == [2, 3, 3, 15, 30, 46]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([3, 30, 2, 15, 3, 46]) == [2, 3, 3, 15, 30, 46]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009772", "instruction": "Define list_intersection computing the ordered intersection of two lists.\n\nExample:\nassert list_intersection([5, 0, 2, 2, 1, 9], [9, 4, 2]) == [2, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([5, 0, 2, 2, 1, 9], [9, 4, 2]) == [2, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009773", "instruction": "Write a Python function list_intersection(a, b) returning elements of a that are also in b, in a's order, no duplicates.\n\nExample:\nassert list_intersection([0, 5, 9, 4, 5, 9, 8, 1], [1, 1, 3]) == [1]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([0, 5, 9, 4, 5, 9, 8, 1], [1, 1, 3]) == [1]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009774", "instruction": "Write merge_sorted(a, b) -> list: merge sorted.\n\nExample:\nassert merge_sorted([2, 2, 6, 7, 13, 17, 18], [3]) == [2, 2, 3, 6, 7, 13, 17, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 2, 6, 7, 13, 17, 18], [3]) == [2, 2, 3, 6, 7, 13, 17, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009775", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(115) == [5, 23]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(115) == [5, 23]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009776", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(2975) == 5792\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2975) == 5792\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009777", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(29) == [29]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(29) == [29]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009778", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(75) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(75) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009779", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([30, 19, 23, 25, 1, 11, 44, 47]) == [1, 11, 19, 23, 25, 30, 44, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([30, 19, 23, 25, 1, 11, 44, 47]) == [1, 11, 19, 23, 25, 30, 44, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009780", "instruction": "Write a Python function is_prime(n) returning True if n is prime, else False.\n\nExample:\nassert is_prime(399) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(399) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009781", "instruction": "Implement nested_sum(x): recursive sum over nested lists.\n\nExample:\nassert nested_sum([[[7]], 1, 9]) == 17\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([[[7]], 1, 9]) == 17\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009782", "instruction": "Write a Python function merge_sorted(a, b) merging two sorted lists into one sorted list.\n\nExample:\nassert merge_sorted([1, 7, 18, 19], [1, 2, 12, 12, 18, 19]) == [1, 1, 2, 7, 12, 12, 18, 18, 19, 19]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([1, 7, 18, 19], [1, 2, 12, 12, 18, 19]) == [1, 1, 2, 7, 12, 12, 18, 18, 19, 19]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009783", "instruction": "Implement parse_kv_pairs(s): parse semicolon key=value pairs.\n\nExample:\nassert parse_kv_pairs('mode=300; port=on; path=548') == {'mode': '300', 'port': 'on', 'path': '548'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=300; port=on; path=548') == {'mode': '300', 'port': 'on', 'path': '548'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009784", "instruction": "Implement insertion_sort(nums): insertion sort.\n\nExample:\nassert insertion_sort([31, 20, 37, 17, 27, 8]) == [8, 17, 20, 27, 31, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([31, 20, 37, 17, 27, 8]) == [8, 17, 20, 27, 31, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009785", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[8], [1, 3], [7, 6, 4, 2], [6]]) == [8, 1, 3, 7, 6, 4, 2, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8], [1, 3], [7, 6, 4, 2], [6]]) == [8, 1, 3, 7, 6, 4, 2, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009786", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([3, 4, 4, 0]) == [3, 4, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 4, 4, 0]) == [3, 4, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009787", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('acaa,a,a,cece') == ['acaa', 'a', 'a', 'cece']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('acaa,a,a,cece') == ['acaa', 'a', 'a', 'cece']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009788", "instruction": "Write a Python function word_freq_text(text) returning a dict of word counts: split on whitespace, lowercase words, strip surrounding punctuation .,!?;: from each word.\n\nExample:\nassert word_freq_text('the the the the! sat Sat') == {'the': 4, 'sat': 2}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('the the the the! sat Sat') == {'the': 4, 'sat': 2}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009789", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('cccdebdceb') == 'cdeb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cccdebdceb') == 'cdeb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009790", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('LXXXVI') == 86\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXXXVI') == 86\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009791", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([0, 9, 1, 9, 7, 3, 5], 3) == [[0, 9, 1], [9, 7, 3], [5]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([0, 9, 1, 9, 7, 3, 5], 3) == [[0, 9, 1], [9, 7, 3], [5]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009792", "instruction": "Write digit_sum(n) -> int: digit sum.\n\nExample:\nassert digit_sum(1078) == 16\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(1078) == 16\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009793", "instruction": "Write a Python function merge_dicts_sum(a, b) merging two dicts, summing values for shared keys.\n\nExample:\nassert merge_dicts_sum({'w': 9, 'y': 9, 'z': 5}, {'x': 6, 'w': 9}) == {'w': 18, 'y': 9, 'z': 5, 'x': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'w': 9, 'y': 9, 'z': 5}, {'x': 6, 'w': 9}) == {'w': 18, 'y': 9, 'z': 5, 'x': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009794", "instruction": "Write a Python class Stack with push(x), pop() (returns the top item), peek() (returns top without removing), and is_empty().\n\nExample:\ns = Stack()\ns.push(60); s.push(89); s.push(43)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(60); s.push(89); s.push(43)\nassert s.peek() == 43\nassert s.pop() == 43\nassert s.pop() == 89\nassert s.is_empty() == False\nassert s.pop() == 60\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009795", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(28, 24) == 168\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(28, 24) == 168\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009796", "instruction": "Implement reverse_digits(n): reverse decimal digits.\n\nExample:\nassert reverse_digits(9577) == 7759\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(9577) == 7759\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009797", "instruction": "Implement dedupe_chars(s): dedupe characters preserving first-seen order.\n\nExample:\nassert dedupe_chars('cbcead') == 'cbead'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('cbcead') == 'cbead'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009798", "instruction": "Create function lcm(a, b): least common multiple.\n\nExample:\nassert lcm(4, 38) == 76\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 38) == 76\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009799", "instruction": "Write a Python class BankAccount with __init__(balance=0), deposit(amount), withdraw(amount) (only if funds suffice, else leave balance unchanged), and get_balance().\n\nExample:\nacc = BankAccount(315)\nacc.deposit(235)\nacc.withdraw(197)\nacc.withdraw(677)\nassert acc.get_balance() == 550\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(315)\nacc.deposit(235)\nassert acc.get_balance() == 550\nacc.withdraw(197)\nassert acc.get_balance() == 353\nacc.withdraw(677)\nassert acc.get_balance() == 353\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009800", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(435) == 'CDXXXV'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(435) == 'CDXXXV'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009801", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([25, 30, 5, 45, 19, 29, 47]) == [5, 19, 25, 29, 30, 45, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([25, 30, 5, 45, 19, 29, 47]) == [5, 19, 25, 29, 30, 45, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009802", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([7, 52, 55, 68, 76, 79], 52) == 1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([7, 52, 55, 68, 76, 79], 52) == 1\nassert binary_search([7, 52, 55, 68, 76, 79], 7) == 0\nassert binary_search([7, 52, 55, 68, 76, 79], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009803", "instruction": "Write second_largest(nums) -> number: second largest distinct.\n\nExample:\nassert second_largest([27, 0, 16, 29, 7]) == 27\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([27, 0, 16, 29, 7]) == 27\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009804", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'d': 31, 'a': 83, 'e': 39}) == {31: 'd', 83: 'a', 39: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 31, 'a': 83, 'e': 39}) == {31: 'd', 83: 'a', 39: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009805", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('cafbc', 'afccb') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cafbc', 'afccb') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009806", "instruction": "Implement caesar_cipher(s, k): Caesar-shift every alphabetic character by k (wrap around), keep case, pass through the rest.\n\nExample:\nassert caesar_cipher('Python Code', 18) == 'Hqlzgf Ugvw'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Python Code', 18) == 'Hqlzgf Ugvw'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009807", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([[2, 1], [2], [2, 1], 4, [3]]) == [2, 1, 2, 2, 1, 4, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[2, 1], [2], [2, 1], 4, [3]]) == [2, 1, 2, 2, 1, 4, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009808", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(1, 1) == 1\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(1, 1) == 1\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009809", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([20, 37, 13, 20, 2, 28, 24, 10]) == [2, 10, 13, 20, 20, 24, 28, 37]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([20, 37, 13, 20, 2, 28, 24, 10]) == [2, 10, 13, 20, 20, 24, 28, 37]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009810", "instruction": "Implement count_substring(s, sub): count (possibly overlapping) occurrences of substring.\n\nExample:\nassert count_substring('bbbaabbabbaa', 'baa') == 2\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbaabbabbaa', 'baa') == 2\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009811", "instruction": "Create a Stack class supporting push, pop, peek and is_empty.\n\nExample:\ns = Stack()\ns.push(21); s.push(39); s.push(28)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(21); s.push(39); s.push(28)\nassert s.peek() == 28\nassert s.pop() == 28\nassert s.pop() == 39\nassert s.is_empty() == False\nassert s.pop() == 21\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009812", "instruction": "Define dict_filter dropping dict entries with value <= t.\n\nExample:\nassert dict_filter({'d': 5, 'c': 6, 'e': 5}, 2) == {'d': 5, 'c': 6, 'e': 5}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'d': 5, 'c': 6, 'e': 5}, 2) == {'d': 5, 'c': 6, 'e': 5}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009813", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([-14, -2, 11, 11, 3]) == 9\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, -2, 11, 11, 3]) == 9\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009814", "instruction": "Write invert_dict(d) -> dict: key/value swap.\n\nExample:\nassert invert_dict({'b': 51, 'f': 49}) == {51: 'b', 49: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'b': 51, 'f': 49}) == {51: 'b', 49: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009815", "instruction": "Write a Python function insertion_sort(nums) sorting the list with insertion sort (return a new list).\n\nExample:\nassert insertion_sort([47, 44, 27]) == [27, 44, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([47, 44, 27]) == [27, 44, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009816", "instruction": "Write a Python function balanced_parens(s) returning True if the brackets (), [], {} in s are balanced.\n\nExample:\nassert balanced_parens('b({[]}}') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('b({[]}}') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009817", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'x': 4, 'y': 2, 'w': 1}, {'x': 4}) == {'x': 8, 'y': 2, 'w': 1}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 4, 'y': 2, 'w': 1}, {'x': 4}) == {'x': 8, 'y': 2, 'w': 1}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009818", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(3109) == 'MMMCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(3109) == 'MMMCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009819", "instruction": "Write a Python function count_vowels(s) that counts the vowels (a, e, i, o, u) in s.\n\nExample:\nassert count_vowels('zghwney') == 1\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('zghwney') == 1\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009820", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([48, 40, 7]) == [7, 40, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([48, 40, 7]) == [7, 40, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009821", "instruction": "Define merge_dicts_sum merging dicts by summing common keys.\n\nExample:\nassert merge_dicts_sum({'z': 4}, {'x': 5, 'y': 6}) == {'z': 4, 'x': 5, 'y': 6}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 4}, {'x': 5, 'y': 6}) == {'z': 4, 'x': 5, 'y': 6}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009822", "instruction": "Write a Python function csv_parse_line(line) parsing one CSV line into a list of fields. Fields may be double-quoted; inside quotes, commas are literal and \"\" is an escaped quote.\n\nExample:\nassert csv_parse_line('15,42') == ['15', '42']\n\nImplement exactly this signature: `def csv_parse_line(line)`. The tests call it directly.", "tests": "assert csv_parse_line('15,42') == ['15', '42']\nassert csv_parse_line('a,b,c') == ['a', 'b', 'c']\nassert csv_parse_line('\"a,b\",c') == ['a,b', 'c']\nassert csv_parse_line('\"a\"\"b\",x') == ['a\"b', 'x']\nassert csv_parse_line('') == ['']", "family": "csv_parse_line", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009823", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([5, 7, 2]) == 14\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([5, 7, 2]) == 14\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009824", "instruction": "Write run_length_encode(s) -> str: run-length encode.\n\nExample:\nassert run_length_encode('aaaaaaaaccccccddddddddd') == 'a8c6d9'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('aaaaaaaaccccccddddddddd') == 'a8c6d9'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009825", "instruction": "Define run_length_encode performing run-length encoding.\n\nExample:\nassert run_length_encode('ddddddccddddd') == 'd6c2d5'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('ddddddccddddd') == 'd6c2d5'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009826", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('fhfhhcac ccaedhga') == 'fhfhhcac'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('fhfhhcac ccaedhga') == 'fhfhhcac'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009827", "instruction": "Write are_anagrams(a, b) -> bool: anagram test.\n\nExample:\nassert are_anagrams('acae', 'acaed') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('acae', 'acaed') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009828", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(14, 5) == 70\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 5) == 70\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009829", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([35, 48, 14, 11, 42, 28, 34]) == [11, 14, 28, 34, 35, 42, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([35, 48, 14, 11, 42, 28, 34]) == [11, 14, 28, 34, 35, 42, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009830", "instruction": "Write matrix_add(a, b) -> list of lists: matrix add.\n\nExample:\nassert matrix_add([[-8, -3, -8, -2], [4, 6, -1, 0], [-4, -7, -1, -9]], [[5, 2, 1, -7], [-3, -7, -6, -6], [-2, 9, 6, -7]]) == [[-3, -1, -7, -9], [1, -1, -7, -6], [-6, 2, 5, -16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, -3, -8, -2], [4, 6, -1, 0], [-4, -7, -1, -9]], [[5, 2, 1, -7], [-3, -7, -6, -6], [-2, 9, 6, -7]]) == [[-3, -1, -7, -9], [1, -1, -7, -6], [-6, 2, 5, -16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009831", "instruction": "Create function merge_sorted(a, b): sorted merge.\n\nExample:\nassert merge_sorted([2, 10, 13, 16, 18], [1, 4, 6, 12]) == [1, 2, 4, 6, 10, 12, 13, 16, 18]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 10, 13, 16, 18], [1, 4, 6, 12]) == [1, 2, 4, 6, 10, 12, 13, 16, 18]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009832", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(14, 14) == 14\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(14, 14) == 14\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009833", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['cherry', 'berry', 'banana', 'berry', 'date', 'berry', 'banana', 'date']) == {'c': ['cherry'], 'b': ['berry', 'banana', 'berry', 'berry', 'banana'], 'd': ['date', 'date']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['cherry', 'berry', 'banana', 'berry', 'date', 'berry', 'banana', 'date']) == {'c': ['cherry'], 'b': ['berry', 'banana', 'berry', 'berry', 'banana'], 'd': ['date', 'date']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009834", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('abc', 24) == 'yza'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('abc', 24) == 'yza'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009835", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello World', 8) == 'Pmttw Ewztl'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello World', 8) == 'Pmttw Ewztl'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009836", "instruction": "Define nested_sum summing nested integer lists.\n\nExample:\nassert nested_sum([0, [4, 2], [7, 5]]) == 18\n\nImplement exactly this signature: `def nested_sum(x)`. The tests call it directly.", "tests": "assert nested_sum([0, [4, 2], [7, 5]]) == 18\nassert nested_sum([1, [2, [3]], 4]) == 10\nassert nested_sum([]) == 0\nassert nested_sum(5) == 5", "family": "nested_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009837", "instruction": "Define class BankAccount with deposit/withdraw/balance methods.\n\nExample:\nacc = BankAccount(34)\nacc.deposit(271)\nacc.withdraw(264)\nacc.withdraw(490)\nassert acc.get_balance() == 305\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(34)\nacc.deposit(271)\nassert acc.get_balance() == 305\nacc.withdraw(264)\nassert acc.get_balance() == 41\nacc.withdraw(490)\nassert acc.get_balance() == 41\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009838", "instruction": "Define cumulative_sum computing prefix sums.\n\nExample:\nassert cumulative_sum([4, -4, -2]) == [4, 0, -2]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([4, -4, -2]) == [4, 0, -2]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009839", "instruction": "Write a Python function chunk_list(nums, k) splitting the list into chunks of size k (last may be smaller).\n\nExample:\nassert chunk_list([2, 7, 8, 4, 5, 1, 9, 2, 2, 2], 2) == [[2, 7], [8, 4], [5, 1], [9, 2], [2, 2]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 7, 8, 4, 5, 1, 9, 2, 2, 2], 2) == [[2, 7], [8, 4], [5, 1], [9, 2], [2, 2]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009840", "instruction": "Implement count_vowels(s): return the number of vowel characters in the string.\n\nExample:\nassert count_vowels('yqwcvm') == 0\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('yqwcvm') == 0\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009841", "instruction": "Implement dedupe_list(nums): dedupe a list, first occurrence wins.\n\nExample:\nassert dedupe_list([3, 5, 3, 1, 4, 4]) == [3, 5, 1, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 5, 3, 1, 4, 4]) == [3, 5, 1, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009842", "instruction": "Implement int_to_roman(n): integer to Roman.\n\nExample:\nassert int_to_roman(99) == 'XCIX'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(99) == 'XCIX'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009843", "instruction": "Implement balanced_parens(s): balanced-bracket check with a stack.\n\nExample:\nassert balanced_parens('{(bb') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('{(bb') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009844", "instruction": "Define matrix_add adding matrices elementwise.\n\nExample:\nassert matrix_add([[6, -4], [6, 9]], [[-3, 0], [-5, 7]]) == [[3, -4], [1, 16]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[6, -4], [6, 9]], [[-3, 0], [-5, 7]]) == [[3, -4], [1, 16]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009845", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[9, 0], [5, 1, 7, 5], 5, [1, 6], 4]) == [9, 0, 5, 1, 7, 5, 5, 1, 6, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[9, 0], [5, 1, 7, 5], 5, [1, 6], 4]) == [9, 0, 5, 1, 7, 5, 5, 1, 6, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009846", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([4, 9, 0, 4, 0, 1, 8], 5) == [0, 4, 0, 1, 8, 4, 9]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 9, 0, 4, 0, 1, 8], 5) == [0, 4, 0, 1, 8, 4, 9]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009847", "instruction": "Create function are_anagrams(a, b): True iff a and b contain the same letters.\n\nExample:\nassert are_anagrams('cebf', 'cebfb') == False\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cebf', 'cebfb') == False\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009848", "instruction": "Implement prime_factors(n): prime factorization.\n\nExample:\nassert prime_factors(152) == [2, 2, 2, 19]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(152) == [2, 2, 2, 19]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009849", "instruction": "Create recursive function flatten_recursive(x): flat list.\n\nExample:\nassert flatten_recursive([[7], 1, [6]]) == [7, 1, 6]\n\nImplement exactly this signature: `def flatten_recursive(x)`. The tests call it directly.", "tests": "assert flatten_recursive([[7], 1, [6]]) == [7, 1, 6]\nassert flatten_recursive([1, [2, [3, [4]]]]) == [1, 2, 3, 4]\nassert flatten_recursive([]) == []", "family": "flatten_recursive", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009850", "instruction": "Define insertion_sort performing insertion sort.\n\nExample:\nassert insertion_sort([16, 36, 7, 30, 48, 5, 42, 9]) == [5, 7, 9, 16, 30, 36, 42, 48]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([16, 36, 7, 30, 48, 5, 42, 9]) == [5, 7, 9, 16, 30, 36, 42, 48]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009851", "instruction": "Create function int_sqrt(n): largest r with r*r <= n.\n\nExample:\nassert int_sqrt(9519) == 97\n\nImplement exactly this signature: `def int_sqrt(n)`. The tests call it directly.", "tests": "assert int_sqrt(9519) == 97\nassert int_sqrt(16) == 4\nassert int_sqrt(15) == 3\nassert int_sqrt(0) == 0\nassert int_sqrt(1) == 1", "family": "int_sqrt", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009852", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([8, 3, 5, 1, 4, 1, 7, 4, 8, 9], 9) == [3, 5, 1, 4, 1, 7, 4, 8, 9, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([8, 3, 5, 1, 4, 1, 7, 4, 8, 9], 9) == [3, 5, 1, 4, 1, 7, 4, 8, 9, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009853", "instruction": "Write reverse_digits(n) -> int: reversed digits.\n\nExample:\nassert reverse_digits(2335) == 5332\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2335) == 5332\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009854", "instruction": "Create function list_sum(nums) returning the total.\n\nExample:\nassert list_sum([1, -8, -17, 6, -4, -18]) == -40\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([1, -8, -17, 6, -4, -18]) == -40\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009855", "instruction": "Define is_prime checking primality.\n\nExample:\nassert is_prime(315) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(315) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009856", "instruction": "Define matrix_multiply computing the matrix product.\n\nExample:\nassert matrix_multiply([[1, 1, 3], [2, 2, 5]], [[5, 0], [5, 5], [4, 2]]) == [[22, 11], [40, 20]]\n\nImplement exactly this signature: `def matrix_multiply(a, b)`. The tests call it directly.", "tests": "assert matrix_multiply([[1, 1, 3], [2, 2, 5]], [[5, 0], [5, 5], [4, 2]]) == [[22, 11], [40, 20]]\nassert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\nassert matrix_multiply([[1, 0], [0, 1]], [[7, 8], [9, 10]]) == [[7, 8], [9, 10]]", "family": "matrix_multiply", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009857", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([2, 2, 6, 3], 4) == [2, 2, 6, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 2, 6, 3], 4) == [2, 2, 6, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009858", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bccaaac', 'abbc') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bccaaac', 'abbc') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009859", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('Code', 8) == 'Kwlm'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Code', 8) == 'Kwlm'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009860", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([4, [0], 2]) == [4, 0, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([4, [0], 2]) == [4, 0, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009861", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[8, 6, 7], 9, 2]) == [8, 6, 7, 9, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[8, 6, 7], 9, 2]) == [8, 6, 7, 9, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009862", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([5, 2, 0, 1, 0]) == [5, 2, 0, 1]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([5, 2, 0, 1, 0]) == [5, 2, 0, 1]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009863", "instruction": "Write a Python function binary_search(nums, x) binary-searching sorted nums; return the index of x or -1.\n\nExample:\nassert binary_search([13, 44, 66], 66) == 2\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([13, 44, 66], 66) == 2\nassert binary_search([13, 44, 66], 13) == 0\nassert binary_search([13, 44, 66], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009864", "instruction": "Write parse_duration(s) -> int: duration in seconds.\n\nExample:\nassert parse_duration('9m32s') == 572\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('9m32s') == 572\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009865", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'f': 84, 'e': 73, 'b': 83, 'd': 56}) == {84: 'f', 73: 'e', 83: 'b', 56: 'd'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 84, 'e': 73, 'b': 83, 'd': 56}) == {84: 'f', 73: 'e', 83: 'b', 56: 'd'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009866", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([3, 3, 8, 3], 2) == [8, 3, 3, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([3, 3, 8, 3], 2) == [8, 3, 3, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009867", "instruction": "Define prime_factors listing prime factors.\n\nExample:\nassert prime_factors(241) == [241]\n\nImplement exactly this signature: `def prime_factors(n)`. The tests call it directly.", "tests": "assert prime_factors(241) == [241]\nassert prime_factors(12) == [2, 2, 3]\nassert prime_factors(13) == [13]\nassert prime_factors(100) == [2, 2, 5, 5]", "family": "prime_factors", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009868", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([[5, 4], 4, [2, 2, 1, 7], 6, 2]) == [5, 4, 4, 2, 2, 1, 7, 6, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5, 4], 4, [2, 2, 1, 7], 6, 2]) == [5, 4, 4, 2, 2, 1, 7, 6, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009869", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'z': 6}, {'z': 8}) == {'z': 14}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 6}, {'z': 8}) == {'z': 14}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009870", "instruction": "Implement pow_recursive(a, e): recursive power.\n\nExample:\nassert pow_recursive(7, 5) == 16807\n\nImplement exactly this signature: `def pow_recursive(a, e)`. The tests call it directly.", "tests": "assert pow_recursive(7, 5) == 16807\nassert pow_recursive(2, 10) == 1024\nassert pow_recursive(5, 0) == 1", "family": "pow_recursive", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009871", "instruction": "Define chunk_list partitioning a list into k-sized chunks.\n\nExample:\nassert chunk_list([6, 6, 6, 6], 2) == [[6, 6], [6, 6]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([6, 6, 6, 6], 2) == [[6, 6], [6, 6]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009872", "instruction": "Write freq_map(items) -> dict: frequencies.\n\nExample:\nassert freq_map(['d', 'a', 'd']) == {'d': 2, 'a': 1}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'a', 'd']) == {'d': 2, 'a': 1}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009873", "instruction": "Create function dedupe_list(nums): unique elements, original order.\n\nExample:\nassert dedupe_list([2, 3, 4, 4, 1, 2, 0]) == [2, 3, 4, 1, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 3, 4, 4, 1, 2, 0]) == [2, 3, 4, 1, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009874", "instruction": "Create function quicksort(nums): quicksorted new list.\n\nExample:\nassert quicksort([11, 47, 28, 43]) == [11, 28, 43, 47]\n\nImplement exactly this signature: `def quicksort(nums)`. The tests call it directly.", "tests": "assert quicksort([11, 47, 28, 43]) == [11, 28, 43, 47]\nassert quicksort([3, 1, 2]) == [1, 2, 3]\nassert quicksort([2, 3, 1]) == [1, 2, 3]\nassert quicksort([]) == []\nassert quicksort([2, 2, 1]) == [1, 2, 2]", "family": "quicksort", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009875", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([8, [6], [3, 0]]) == [8, 6, 3, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([8, [6], [3, 0]]) == [8, 6, 3, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009876", "instruction": "Write collatz_steps(n) -> int: Collatz steps.\n\nExample:\nassert collatz_steps(14) == 17\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(14) == 17\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009877", "instruction": "Define dedupe_chars removing repeated characters from a string.\n\nExample:\nassert dedupe_chars('bdbda') == 'bda'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('bdbda') == 'bda'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009878", "instruction": "Implement invert_dict(d): swap keys and values.\n\nExample:\nassert invert_dict({'d': 87, 'e': 8, 'f': 56}) == {87: 'd', 8: 'e', 56: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'d': 87, 'e': 8, 'f': 56}) == {87: 'd', 8: 'e', 56: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009879", "instruction": "Write reverse_string(s) -> str: return s reversed.\n\nExample:\nassert reverse_string('xbcyf') == 'fycbx'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('xbcyf') == 'fycbx'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009880", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([9, 7, 6, 5, 6, 6, 4, 7], 4) == [[9, 7, 6, 5], [6, 6, 4, 7]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([9, 7, 6, 5, 6, 6, 4, 7], 4) == [[9, 7, 6, 5], [6, 6, 4, 7]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009881", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('MMMLXIV') == 3064\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMLXIV') == 3064\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009882", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([-6, 4, 5]) == [-6, -2, 3]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([-6, 4, 5]) == [-6, -2, 3]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009883", "instruction": "Define list_max finding the list maximum.\n\nExample:\nassert list_max([8, -39, 0, 14, 1]) == 14\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([8, -39, 0, 14, 1]) == 14\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009884", "instruction": "Create function gcd(a, b): greatest common divisor.\n\nExample:\nassert gcd(12, 82) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(12, 82) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009885", "instruction": "Create function collatz_steps(n): steps of the 3n+1 process.\n\nExample:\nassert collatz_steps(2) == 1\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(2) == 1\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009886", "instruction": "Define longest_word returning the longest word of a string.\n\nExample:\nassert longest_word('gdccahc bhff h') == 'gdccahc'\n\nImplement exactly this signature: `def longest_word(s)`. The tests call it directly.", "tests": "assert longest_word('gdccahc bhff h') == 'gdccahc'\nassert longest_word('a bb ccc') == 'ccc'\nassert longest_word('') == ''\nassert longest_word('aa bb') == 'aa'", "family": "longest_word", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009887", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('CCLXXXII') == 282\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLXXXII') == 282\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009888", "instruction": "Implement flatten_once(nested): one-level flatten of a list.\n\nExample:\nassert flatten_once([[1, 5, 1], [8, 5, 6, 2]]) == [1, 5, 1, 8, 5, 6, 2]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 5, 1], [8, 5, 6, 2]]) == [1, 5, 1, 8, 5, 6, 2]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009889", "instruction": "Create function rotate_list(nums, k): rotated list.\n\nExample:\nassert rotate_list([4, 7, 8, 8, 5, 7, 4, 5], 4) == [5, 7, 4, 5, 4, 7, 8, 8]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 7, 8, 8, 5, 7, 4, 5], 4) == [5, 7, 4, 5, 4, 7, 8, 8]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009890", "instruction": "Write bubble_sort(nums) -> list: bubble sort.\n\nExample:\nassert bubble_sort([28, 27, 15, 12, 28, 39]) == [12, 15, 27, 28, 28, 39]\n\nImplement exactly this signature: `def bubble_sort(nums)`. The tests call it directly.", "tests": "assert bubble_sort([28, 27, 15, 12, 28, 39]) == [12, 15, 27, 28, 28, 39]\nassert bubble_sort([3, 1, 2]) == [1, 2, 3]\nassert bubble_sort([]) == []\nassert bubble_sort([1]) == [1]", "family": "bubble_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009891", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'z': 3, 'w': 9}, {'y': 8}) == {'z': 3, 'w': 9, 'y': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'z': 3, 'w': 9}, {'y': 8}) == {'z': 3, 'w': 9, 'y': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009892", "instruction": "Define count_vowels to count vowels in a given string.\n\nExample:\nassert count_vowels('jokxsuxgd') == 2\n\nImplement exactly this signature: `def count_vowels(s)`. The tests call it directly.", "tests": "assert count_vowels('jokxsuxgd') == 2\nassert count_vowels('hello') == 2\nassert count_vowels('xyz') == 0", "family": "count_vowels", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009893", "instruction": "Write rotate_list(nums, k) -> list: right rotation.\n\nExample:\nassert rotate_list([4, 3, 7], 1) == [7, 4, 3]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([4, 3, 7], 1) == [7, 4, 3]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009894", "instruction": "Implement collatz_steps(n): Collatz sequence length.\n\nExample:\nassert collatz_steps(41) == 109\n\nImplement exactly this signature: `def collatz_steps(n)`. The tests call it directly.", "tests": "assert collatz_steps(41) == 109\nassert collatz_steps(1) == 0\nassert collatz_steps(6) == 8\nassert collatz_steps(27) == 111", "family": "collatz_steps", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009895", "instruction": "Create function invert_dict(d): inverted dict.\n\nExample:\nassert invert_dict({'f': 74, 'e': 91}) == {74: 'f', 91: 'e'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'f': 74, 'e': 91}) == {74: 'f', 91: 'e'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009896", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('dacaacbc') == 'dacb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dacaacbc') == 'dacb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009897", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('1') == 1\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('1') == 1\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009898", "instruction": "Write a Python function run_length_encode(s) that run-length encodes s: consecutive repeats become char+count, e.g. 'aaabb' -> 'a3b2'.\n\nExample:\nassert run_length_encode('dddddaaa') == 'd5a3'\n\nImplement exactly this signature: `def run_length_encode(s)`. The tests call it directly.", "tests": "assert run_length_encode('dddddaaa') == 'd5a3'\nassert run_length_encode('aaabb') == 'a3b2'\nassert run_length_encode('') == ''\nassert run_length_encode('a') == 'a1'", "family": "run_length_encode", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009899", "instruction": "Define balanced_parens validating bracket balance.\n\nExample:\nassert balanced_parens('((') == False\n\nImplement exactly this signature: `def balanced_parens(s)`. The tests call it directly.", "tests": "assert balanced_parens('((') == False\nassert balanced_parens('([{}])') == True\nassert balanced_parens('([)]') == False\nassert balanced_parens('') == True\nassert balanced_parens('(((') == False", "family": "balanced_parens", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009900", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'coconut', 'banana']) == {'a': ['apple'], 'c': ['cherry', 'coconut'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'coconut', 'banana']) == {'a': ['apple'], 'c': ['cherry', 'coconut'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009901", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('adbbd ab') == 'Adbbd Ab'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('adbbd ab') == 'Adbbd Ab'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009902", "instruction": "Write word_freq_text(text) -> dict: word frequencies.\n\nExample:\nassert word_freq_text('ran sat, ran, cat sun. ran cat Sat cat ran,') == {'ran': 4, 'sat': 2, 'cat': 3, 'sun': 1}\n\nImplement exactly this signature: `def word_freq_text(text)`. The tests call it directly.", "tests": "assert word_freq_text('ran sat, ran, cat sun. ran cat Sat cat ran,') == {'ran': 4, 'sat': 2, 'cat': 3, 'sun': 1}\nassert word_freq_text('The cat, the cat!') == {'the': 2, 'cat': 2}\nassert word_freq_text('') == {}", "family": "word_freq_text", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009903", "instruction": "Write a Python function list_max(nums) returning the largest element (assume non-empty).\n\nExample:\nassert list_max([40, -30, -47]) == 40\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([40, -30, -47]) == 40\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009904", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([9, 0, 9, 7, 2, 6, 9, 0, 9, 8], 5) == [6, 9, 0, 9, 8, 9, 0, 9, 7, 2]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([9, 0, 9, 7, 2, 6, 9, 0, 9, 8], 5) == [6, 9, 0, 9, 8, 9, 0, 9, 7, 2]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009905", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('dadcbd') == 'dacb'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('dadcbd') == 'dacb'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009906", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([0, 6, 3, 7, 2], 6) == [2, 0, 6, 3, 7]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([0, 6, 3, 7, 2], 6) == [2, 0, 6, 3, 7]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009907", "instruction": "Define gcd computing the GCD of two integers.\n\nExample:\nassert gcd(134, 24) == 2\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(134, 24) == 2\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009908", "instruction": "Write binary_search(nums, x) -> int: binary search.\n\nExample:\nassert binary_search([10, 24, 25, 30, 35, 56, 64, 68, 75, 84], 75) == 8\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([10, 24, 25, 30, 35, 56, 64, 68, 75, 84], 75) == 8\nassert binary_search([10, 24, 25, 30, 35, 56, 64, 68, 75, 84], 10) == 0\nassert binary_search([10, 24, 25, 30, 35, 56, 64, 68, 75, 84], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009909", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CLXXXVI') == 186\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CLXXXVI') == 186\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009910", "instruction": "Write parse_kv_pairs(s) -> dict: parse kv pairs.\n\nExample:\nassert parse_kv_pairs('mode=54; user=on; path=auto') == {'mode': '54', 'user': 'on', 'path': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('mode=54; user=on; path=auto') == {'mode': '54', 'user': 'on', 'path': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009911", "instruction": "Implement digit_sum(n): digit sum.\n\nExample:\nassert digit_sum(5107) == 13\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5107) == 13\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009912", "instruction": "Write group_by_key(words) -> dict: group by first letter.\n\nExample:\nassert group_by_key(['coconut', 'apple', 'banana', 'banana']) == {'c': ['coconut'], 'a': ['apple'], 'b': ['banana', 'banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['coconut', 'apple', 'banana', 'banana']) == {'c': ['coconut'], 'a': ['apple'], 'b': ['banana', 'banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009913", "instruction": "Define parse_kv_pairs parsing a config-style string into a dict.\n\nExample:\nassert parse_kv_pairs('path=off; host=177; mode=auto') == {'path': 'off', 'host': '177', 'mode': 'auto'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; host=177; mode=auto') == {'path': 'off', 'host': '177', 'mode': 'auto'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009914", "instruction": "Implement are_anagrams(a, b): check whether two strings are anagrams of each other.\n\nExample:\nassert are_anagrams('cacdef', 'ecdacf') == True\n\nImplement exactly this signature: `def are_anagrams(a, b)`. The tests call it directly.", "tests": "assert are_anagrams('cacdef', 'ecdacf') == True\nassert are_anagrams('abc', 'cba') == True\nassert are_anagrams('ab', 'abc') == False\nassert are_anagrams('aab', 'abb') == False", "family": "anagrams", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009915", "instruction": "Create function group_by_key(words): first-letter groups.\n\nExample:\nassert group_by_key(['banana', 'cherry', 'cherry', 'apple', 'coconut', 'berry', 'coconut', 'cherry']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'cherry', 'coconut', 'coconut', 'cherry'], 'a': ['apple']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'cherry', 'cherry', 'apple', 'coconut', 'berry', 'coconut', 'cherry']) == {'b': ['banana', 'berry'], 'c': ['cherry', 'cherry', 'coconut', 'coconut', 'cherry'], 'a': ['apple']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009916", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([15, 19, 25, 31, 34, 56, 60, 90, 95], 177) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([15, 19, 25, 31, 34, 56, 60, 90, 95], 177) == -1\nassert binary_search([15, 19, 25, 31, 34, 56, 60, 90, 95], 15) == 0\nassert binary_search([15, 19, 25, 31, 34, 56, 60, 90, 95], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009917", "instruction": "Write a Python function eval_expr(expr) evaluating an arithmetic expression string with +, -, *, parentheses and non-negative integers (standard precedence).\n\nExample:\nassert eval_expr('(19 * 20 * 5)') == 1900\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(19 * 20 * 5)') == 1900\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009918", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([45, 28, 22, 39, 42]) == [22, 28, 39, 42, 45]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([45, 28, 22, 39, 42]) == [22, 28, 39, 42, 45]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009919", "instruction": "Write title_case(s) -> str: title case.\n\nExample:\nassert title_case('ce') == 'Ce'\n\nImplement exactly this signature: `def title_case(s)`. The tests call it directly.", "tests": "assert title_case('ce') == 'Ce'\nassert title_case('hello world') == 'Hello World'\nassert title_case('') == ''", "family": "title_case", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009920", "instruction": "Create function list_max(nums): largest value.\n\nExample:\nassert list_max([-36, 6, 22, 28, -5, 4, 21, -20]) == 28\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-36, 6, 22, 28, -5, 4, 21, -20]) == 28\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009921", "instruction": "Write a Python function dedupe_chars(s) that removes duplicate characters, keeping the first occurrence of each.\n\nExample:\nassert dedupe_chars('eacebadd') == 'eacbd'\n\nImplement exactly this signature: `def dedupe_chars(s)`. The tests call it directly.", "tests": "assert dedupe_chars('eacebadd') == 'eacbd'\nassert dedupe_chars('abba') == 'ab'\nassert dedupe_chars('') == ''", "family": "dedupe_chars", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009922", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('59m6s') == 3546\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('59m6s') == 3546\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009923", "instruction": "Write a Python function roman_to_int(s) converting a Roman numeral string to an integer.\n\nExample:\nassert roman_to_int('CCCXXIII') == 323\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCCXXIII') == 323\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009924", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([1, 0, 2, 4, 0, 4]) == [1, 0, 2, 4]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([1, 0, 2, 4, 0, 4]) == [1, 0, 2, 4]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009925", "instruction": "Write list_max(nums) -> number: max element.\n\nExample:\nassert list_max([-36, 36, -45, -18, 23, -18, -41, 20]) == 36\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-36, 36, -45, -18, 23, -18, -41, 20]) == 36\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009926", "instruction": "Define roman_to_int parsing Roman numerals.\n\nExample:\nassert roman_to_int('CCLVIII') == 258\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('CCLVIII') == 258\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009927", "instruction": "Define flatten_once flattening a single nesting level.\n\nExample:\nassert flatten_once([5, [7, 4, 5, 6]]) == [5, 7, 4, 5, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [7, 4, 5, 6]]) == [5, 7, 4, 5, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009928", "instruction": "Define class Stack with LIFO push/pop/peek/is_empty methods.\n\nExample:\ns = Stack()\ns.push(41); s.push(24); s.push(85)\nassert s.is_empty() == True\n\nImplement exactly this signature: `class Stack with methods: push(self, x), pop(self), peek(self), is_empty(self)`. The tests call it directly.", "tests": "s = Stack()\nassert s.is_empty() == True\ns.push(41); s.push(24); s.push(85)\nassert s.peek() == 85\nassert s.pop() == 85\nassert s.pop() == 24\nassert s.is_empty() == False\nassert s.pop() == 41\nassert s.is_empty() == True", "family": "stack_class", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009929", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(386) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(386) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009930", "instruction": "Implement merge_sorted(a, b): merge step of merge sort.\n\nExample:\nassert merge_sorted([2, 7, 8, 20], [11, 13]) == [2, 7, 8, 11, 13, 20]\n\nImplement exactly this signature: `def merge_sorted(a, b)`. The tests call it directly.", "tests": "assert merge_sorted([2, 7, 8, 20], [11, 13]) == [2, 7, 8, 11, 13, 20]\nassert merge_sorted([1, 3], [2, 4]) == [1, 2, 3, 4]\nassert merge_sorted([], [1]) == [1]\nassert merge_sorted([], []) == []", "family": "merge_sorted", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009931", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('xyz', 9) == 'ghi'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 9) == 'ghi'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009932", "instruction": "Write a Python function caesar_cipher(s, k) implementing a Caesar cipher: shift each letter by k positions, preserving case; leave other characters unchanged.\n\nExample:\nassert caesar_cipher('xyz', 17) == 'opq'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('xyz', 17) == 'opq'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "medium", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009933", "instruction": "Implement chunk_list(nums, k): chunk a list into pieces of length k.\n\nExample:\nassert chunk_list([2, 6, 9, 8, 8, 0, 3], 4) == [[2, 6, 9, 8], [8, 0, 3]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([2, 6, 9, 8, 8, 0, 3], 4) == [[2, 6, 9, 8], [8, 0, 3]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009934", "instruction": "Implement eval_expr(expr): mini expression evaluator.\n\nExample:\nassert eval_expr('(4 * (14 + 6))') == 80\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('(4 * (14 + 6))') == 80\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009935", "instruction": "Define reverse_digits reversing an integer's digits.\n\nExample:\nassert reverse_digits(529) == 925\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(529) == 925\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009936", "instruction": "Define rotate_list rotating a list right by k steps.\n\nExample:\nassert rotate_list([7, 9, 6, 8, 1], 2) == [8, 1, 7, 9, 6]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([7, 9, 6, 8, 1], 2) == [8, 1, 7, 9, 6]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009937", "instruction": "Write int_to_roman(n) -> str: int to roman.\n\nExample:\nassert int_to_roman(497) == 'CDXCVII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(497) == 'CDXCVII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009938", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('World Python', 14) == 'Kcfzr Dmhvcb'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Python', 14) == 'Kcfzr Dmhvcb'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009939", "instruction": "Create function digit_sum(n): sum of digits.\n\nExample:\nassert digit_sum(604) == 10\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(604) == 10\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009940", "instruction": "Implement dict_filter(d, t): filter dict by value threshold.\n\nExample:\nassert dict_filter({'a': 9, 'c': 6}, 4) == {'a': 9, 'c': 6}\n\nImplement exactly this signature: `def dict_filter(d, t)`. The tests call it directly.", "tests": "assert dict_filter({'a': 9, 'c': 6}, 4) == {'a': 9, 'c': 6}\nassert dict_filter({'a': 5, 'b': 1}, 2) == {'a': 5}\nassert dict_filter({'a': 2, 'b': 3}, 2) == {'b': 3}\nassert dict_filter({}, 0) == {}", "family": "dict_filter", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009941", "instruction": "Create function count_substring(s, sub): number of times sub appears, overlaps allowed.\n\nExample:\nassert count_substring('bbbbbabbbabaa', 'ba') == 3\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('bbbbbabbbabaa', 'ba') == 3\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "medium", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009942", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(299)\nacc.deposit(251)\nacc.withdraw(457)\nacc.withdraw(629)\nassert acc.get_balance() == 550\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(299)\nacc.deposit(251)\nassert acc.get_balance() == 550\nacc.withdraw(457)\nassert acc.get_balance() == 93\nacc.withdraw(629)\nassert acc.get_balance() == 93\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009943", "instruction": "Write roman_to_int(s) -> int: roman to int.\n\nExample:\nassert roman_to_int('LIII') == 53\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LIII') == 53\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009944", "instruction": "Write list_intersection(a, b) -> list: ordered intersection.\n\nExample:\nassert list_intersection([1, 8, 2, 0, 9, 9], [9, 9, 8, 9, 0]) == [8, 0, 9]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([1, 8, 2, 0, 9, 9], [9, 9, 8, 9, 0]) == [8, 0, 9]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009945", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([3, 3, 0, 0, 3]) == [3, 0]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([3, 3, 0, 0, 3]) == [3, 0]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009946", "instruction": "Implement freq_map(items): frequency map of the list.\n\nExample:\nassert freq_map(['d', 'e', 'e']) == {'d': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'e', 'e']) == {'d': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009947", "instruction": "Write insertion_sort(nums) -> list: insertion sort.\n\nExample:\nassert insertion_sort([47, 21, 6, 20, 30, 34]) == [6, 20, 21, 30, 34, 47]\n\nImplement exactly this signature: `def insertion_sort(nums)`. The tests call it directly.", "tests": "assert insertion_sort([47, 21, 6, 20, 30, 34]) == [6, 20, 21, 30, 34, 47]\nassert insertion_sort([3, 1, 2]) == [1, 2, 3]\nassert insertion_sort([]) == []", "family": "insertion_sort", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009948", "instruction": "Define count_substring counting overlapping substring occurrences.\n\nExample:\nassert count_substring('aabba', 'cb') == 0\n\nImplement exactly this signature: `def count_substring(s, sub)`. The tests call it directly.", "tests": "assert count_substring('aabba', 'cb') == 0\nassert count_substring('aaaa', 'aa') == 3\nassert count_substring('abc', 'd') == 0\nassert count_substring('abc', '') == 0", "family": "count_substring", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009949", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[1, 5, 4], [3, 6], [8, 8], [7, 1, 7, 4], 4]) == [1, 5, 4, 3, 6, 8, 8, 7, 1, 7, 4, 4]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[1, 5, 4], [3, 6], [8, 8], [7, 1, 7, 4], 4]) == [1, 5, 4, 3, 6, 8, 8, 7, 1, 7, 4, 4]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009950", "instruction": "Implement merge_dicts_sum(a, b): dict merge with additive combine.\n\nExample:\nassert merge_dicts_sum({'y': 6}, {'z': 4, 'x': 7, 'y': 1}) == {'y': 7, 'z': 4, 'x': 7}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'y': 6}, {'z': 4, 'x': 7, 'y': 1}) == {'y': 7, 'z': 4, 'x': 7}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009951", "instruction": "Write caesar_cipher(s, k) -> str: Caesar cipher.\n\nExample:\nassert caesar_cipher('Hello', 1) == 'Ifmmp'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('Hello', 1) == 'Ifmmp'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009952", "instruction": "Implement matrix_transpose(m): matrix transpose.\n\nExample:\nassert matrix_transpose([[6, 0, 3, 6], [3, 9, 5, 2], [1, 0, 9, 9]]) == [[6, 3, 1], [0, 9, 0], [3, 5, 9], [6, 2, 9]]\n\nImplement exactly this signature: `def matrix_transpose(m)`. The tests call it directly.", "tests": "assert matrix_transpose([[6, 0, 3, 6], [3, 9, 5, 2], [1, 0, 9, 9]]) == [[6, 3, 1], [0, 9, 0], [3, 5, 9], [6, 2, 9]]\nassert matrix_transpose([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]", "family": "matrix_transpose", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009953", "instruction": "Define second_largest finding the runner-up value.\n\nExample:\nassert second_largest([2, 2, 7, 28]) == 7\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([2, 2, 7, 28]) == 7\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009954", "instruction": "Write a Python function int_to_roman(n) converting an integer (1..3999) to a Roman numeral string.\n\nExample:\nassert int_to_roman(418) == 'CDXVIII'\n\nImplement exactly this signature: `def int_to_roman(n)`. The tests call it directly.", "tests": "assert int_to_roman(418) == 'CDXVIII'\nassert int_to_roman(1994) == 'MCMXCIV'\nassert int_to_roman(4) == 'IV'\nassert int_to_roman(58) == 'LVIII'", "family": "int_to_roman", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009955", "instruction": "Implement list_max(nums): maximum of a non-empty list.\n\nExample:\nassert list_max([-32, -24, -6, -32, -43, -10]) == -6\n\nImplement exactly this signature: `def list_max(nums)`. The tests call it directly.", "tests": "assert list_max([-32, -24, -6, -32, -43, -10]) == -6\nassert list_max([3]) == 3\nassert list_max([-5, -1, -9]) == -1", "family": "list_max", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009956", "instruction": "Implement cumulative_sum(nums): running totals of the list.\n\nExample:\nassert cumulative_sum([3, 9, 0, 0, 8, 2]) == [3, 12, 12, 12, 20, 22]\n\nImplement exactly this signature: `def cumulative_sum(nums)`. The tests call it directly.", "tests": "assert cumulative_sum([3, 9, 0, 0, 8, 2]) == [3, 12, 12, 12, 20, 22]\nassert cumulative_sum([1, 2, 3]) == [1, 3, 6]\nassert cumulative_sum([]) == []", "family": "cumulative_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009957", "instruction": "Define caesar_cipher(s, k) that applies a Caesar cipher with shift k to the string.\n\nExample:\nassert caesar_cipher('World Python', 7) == 'Dvysk Wfaovu'\n\nImplement exactly this signature: `def caesar_cipher(s, k)`. The tests call it directly.", "tests": "assert caesar_cipher('World Python', 7) == 'Dvysk Wfaovu'\nassert caesar_cipher('abc', 1) == 'bcd'\nassert caesar_cipher('xyz', 3) == 'abc'\nassert caesar_cipher('Hello!', 0) == 'Hello!'", "family": "caesar_cipher", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009958", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(6860) == 686\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(6860) == 686\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009959", "instruction": "Define parse_duration converting '1h30m' style strings to seconds.\n\nExample:\nassert parse_duration('37m35s') == 2255\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('37m35s') == 2255\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009960", "instruction": "Write a Python function digit_sum(n) returning the sum of the decimal digits of n.\n\nExample:\nassert digit_sum(5247) == 18\n\nImplement exactly this signature: `def digit_sum(n)`. The tests call it directly.", "tests": "assert digit_sum(5247) == 18\nassert digit_sum(123) == 6\nassert digit_sum(0) == 0\nassert digit_sum(-123) == 6", "family": "digit_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009961", "instruction": "Write flatten_once(nested) -> list: shallow flatten.\n\nExample:\nassert flatten_once([6, [5, 1], 0]) == [6, 5, 1, 0]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([6, [5, 1], 0]) == [6, 5, 1, 0]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009962", "instruction": "Write is_armstrong(n) -> bool: Armstrong check.\n\nExample:\nassert is_armstrong(533) == False\n\nImplement exactly this signature: `def is_armstrong(n)`. The tests call it directly.", "tests": "assert is_armstrong(533) == False\nassert is_armstrong(153) == True\nassert is_armstrong(9474) == True\nassert is_armstrong(100) == False", "family": "is_armstrong", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009963", "instruction": "Write a Python function flatten_once(nested) that flattens one level: [[1,2],[3]] -> [1,2,3]; non-list items pass through.\n\nExample:\nassert flatten_once([5, [5, 3, 9], 6, 8, [9, 7, 4, 1]]) == [5, 5, 3, 9, 6, 8, 9, 7, 4, 1]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, [5, 3, 9], 6, 8, [9, 7, 4, 1]]) == [5, 5, 3, 9, 6, 8, 9, 7, 4, 1]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009964", "instruction": "Implement reverse_string(s): given a string s, return a new string with the characters in reverse order.\n\nExample:\nassert reverse_string('zzc') == 'czz'\n\nImplement exactly this signature: `def reverse_string(s)`. The tests call it directly.", "tests": "assert reverse_string('zzc') == 'czz'\nassert reverse_string('') == ''\nassert reverse_string('ab') == 'ba'\nassert reverse_string('x') == 'x'", "family": "str_reverse", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009965", "instruction": "Write gcd(a, b) -> int: gcd.\n\nExample:\nassert gcd(84, 96) == 12\n\nImplement exactly this signature: `def gcd(a, b)`. The tests call it directly.", "tests": "assert gcd(84, 96) == 12\nassert gcd(12, 8) == 4\nassert gcd(7, 13) == 1\nassert gcd(0, 5) == 5", "family": "gcd", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009966", "instruction": "Implement roman_to_int(s): Roman to integer.\n\nExample:\nassert roman_to_int('LXII') == 62\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('LXII') == 62\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009967", "instruction": "Implement binary_search(nums, x): binary search.\n\nExample:\nassert binary_search([17, 26, 42, 65, 75, 82, 97, 98], 65) == 3\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([17, 26, 42, 65, 75, 82, 97, 98], 65) == 3\nassert binary_search([17, 26, 42, 65, 75, 82, 97, 98], 17) == 0\nassert binary_search([17, 26, 42, 65, 75, 82, 97, 98], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009968", "instruction": "Implement is_prime(n): primality test.\n\nExample:\nassert is_prime(23) == True\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(23) == True\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "hard", "tier": "standard", "mutation_score": 0.9} {"id": "stagec_009969", "instruction": "Write a Python function parse_kv_pairs(s) parsing 'key=value' pairs separated by ';' into a dict of strings, e.g. 'a=1; b=2' -> {'a': '1', 'b': '2'}. Ignore empty segments; strip spaces.\n\nExample:\nassert parse_kv_pairs('path=off; host=53; port=701; user=on') == {'path': 'off', 'host': '53', 'port': '701', 'user': 'on'}\n\nImplement exactly this signature: `def parse_kv_pairs(s)`. The tests call it directly.", "tests": "assert parse_kv_pairs('path=off; host=53; port=701; user=on') == {'path': 'off', 'host': '53', 'port': '701', 'user': 'on'}\nassert parse_kv_pairs('a=1; b=2') == {'a': '1', 'b': '2'}\nassert parse_kv_pairs('') == {}\nassert parse_kv_pairs('x=1;') == {'x': '1'}", "family": "parse_kv_pairs", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009970", "instruction": "Create function matrix_add(a, b): elementwise matrix sum.\n\nExample:\nassert matrix_add([[-8, 0, 3], [-7, -6, 0], [4, 6, 5]], [[-6, 4, 0], [-2, -4, 4], [5, 1, 7]]) == [[-14, 4, 3], [-9, -10, 4], [9, 7, 12]]\n\nImplement exactly this signature: `def matrix_add(a, b)`. The tests call it directly.", "tests": "assert matrix_add([[-8, 0, 3], [-7, -6, 0], [4, 6, 5]], [[-6, 4, 0], [-2, -4, 4], [5, 1, 7]]) == [[-14, 4, 3], [-9, -10, 4], [9, 7, 12]]\nassert matrix_add([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]", "family": "matrix_add", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009971", "instruction": "Create function binary_search(nums, x): index or -1.\n\nExample:\nassert binary_search([18, 20, 66, 73], 171) == -1\n\nImplement exactly this signature: `def binary_search(nums, x)`. The tests call it directly.", "tests": "assert binary_search([18, 20, 66, 73], 171) == -1\nassert binary_search([18, 20, 66, 73], 18) == 0\nassert binary_search([18, 20, 66, 73], 1000) == -1\nassert binary_search([], 5) == -1", "family": "binary_search", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009972", "instruction": "Write class BankAccount: guarded withdrawals.\n\nExample:\nacc = BankAccount(473)\nacc.deposit(46)\nacc.withdraw(34)\nacc.withdraw(590)\nassert acc.get_balance() == 519\n\nImplement exactly this signature: `class BankAccount with methods: deposit(self, amount), withdraw(self, amount), get_balance(self)`. The tests call it directly.", "tests": "acc = BankAccount(473)\nacc.deposit(46)\nassert acc.get_balance() == 519\nacc.withdraw(34)\nassert acc.get_balance() == 485\nacc.withdraw(590)\nassert acc.get_balance() == 485\nassert BankAccount().get_balance() == 0", "family": "bank_account", "difficulty": "hard", "tier": "held_out", "mutation_score": 1.0} {"id": "stagec_009973", "instruction": "Create function list_intersection(a, b): common elements in first-list order.\n\nExample:\nassert list_intersection([3, 6, 4, 5, 7, 5], [8, 8, 0, 5, 0, 6, 5]) == [6, 5]\n\nImplement exactly this signature: `def list_intersection(a, b)`. The tests call it directly.", "tests": "assert list_intersection([3, 6, 4, 5, 7, 5], [8, 8, 0, 5, 0, 6, 5]) == [6, 5]\nassert list_intersection([1, 2, 2, 3], [2, 3, 4]) == [2, 3]\nassert list_intersection([1], [2]) == []", "family": "list_intersection", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009974", "instruction": "Define invert_dict inverting a dictionary.\n\nExample:\nassert invert_dict({'e': 44, 'b': 18, 'd': 30, 'c': 7, 'f': 10}) == {44: 'e', 18: 'b', 30: 'd', 7: 'c', 10: 'f'}\n\nImplement exactly this signature: `def invert_dict(d)`. The tests call it directly.", "tests": "assert invert_dict({'e': 44, 'b': 18, 'd': 30, 'c': 7, 'f': 10}) == {44: 'e', 18: 'b', 30: 'd', 7: 'c', 10: 'f'}\nassert invert_dict({'a': 1}) == {1: 'a'}\nassert invert_dict({}) == {}", "family": "invert_dict", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009975", "instruction": "Write a Python function rotate_list(nums, k) rotating the list right by k positions.\n\nExample:\nassert rotate_list([2, 2, 1, 8, 5, 2], 3) == [8, 5, 2, 2, 2, 1]\n\nImplement exactly this signature: `def rotate_list(nums, k)`. The tests call it directly.", "tests": "assert rotate_list([2, 2, 1, 8, 5, 2], 3) == [8, 5, 2, 2, 2, 1]\nassert rotate_list([1, 2, 3, 4], 1) == [4, 1, 2, 3]\nassert rotate_list([1, 2, 3], 3) == [1, 2, 3]\nassert rotate_list([1, 2, 3, 4], 6) == [3, 4, 1, 2]\nassert rotate_list([], 5) == []", "family": "rotate_list", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009976", "instruction": "Write a Python function dedupe_list(nums) removing duplicates while preserving order.\n\nExample:\nassert dedupe_list([0, 0, 4, 3, 4, 4, 5, 5]) == [0, 4, 3, 5]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([0, 0, 4, 3, 4, 4, 5, 5]) == [0, 4, 3, 5]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009977", "instruction": "Define freq_map counting occurrences into a dict.\n\nExample:\nassert freq_map(['d', 'd', 'a', 'b', 'a', 'd', 'a', 'e', 'e']) == {'d': 3, 'a': 3, 'b': 1, 'e': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['d', 'd', 'a', 'b', 'a', 'd', 'a', 'e', 'e']) == {'d': 3, 'a': 3, 'b': 1, 'e': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009978", "instruction": "Write a Python function reverse_digits(n) returning the integer formed by reversing n's digits (drop leading zeros).\n\nExample:\nassert reverse_digits(2119) == 9112\n\nImplement exactly this signature: `def reverse_digits(n)`. The tests call it directly.", "tests": "assert reverse_digits(2119) == 9112\nassert reverse_digits(123) == 321\nassert reverse_digits(120) == 21", "family": "reverse_digits", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009979", "instruction": "Write dedupe_list(nums) -> list: ordered dedupe.\n\nExample:\nassert dedupe_list([2, 5, 5, 0, 1, 1, 1, 4, 3, 1, 1]) == [2, 5, 0, 1, 4, 3]\n\nImplement exactly this signature: `def dedupe_list(nums)`. The tests call it directly.", "tests": "assert dedupe_list([2, 5, 5, 0, 1, 1, 1, 4, 3, 1, 1]) == [2, 5, 0, 1, 4, 3]\nassert dedupe_list([1, 2, 1, 3, 2]) == [1, 2, 3]\nassert dedupe_list([]) == []", "family": "dedupe_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009980", "instruction": "Create function chunk_list(nums, k): list of chunks.\n\nExample:\nassert chunk_list([8, 7, 8, 0, 1, 6, 6, 4, 5, 6, 8], 5) == [[8, 7, 8, 0, 1], [6, 6, 4, 5, 6], [8]]\n\nImplement exactly this signature: `def chunk_list(nums, k)`. The tests call it directly.", "tests": "assert chunk_list([8, 7, 8, 0, 1, 6, 6, 4, 5, 6, 8], 5) == [[8, 7, 8, 0, 1], [6, 6, 4, 5, 6], [8]]\nassert chunk_list([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\nassert chunk_list([], 3) == []", "family": "chunk_list", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009981", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['apple', 'cherry', 'apple', 'banana', 'avocado', 'avocado', 'apple']) == {'a': ['apple', 'apple', 'avocado', 'avocado', 'apple'], 'c': ['cherry'], 'b': ['banana']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['apple', 'cherry', 'apple', 'banana', 'avocado', 'avocado', 'apple']) == {'a': ['apple', 'apple', 'avocado', 'avocado', 'apple'], 'c': ['cherry'], 'b': ['banana']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009982", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[7, 1], 8, [9], [1, 8, 7, 0], [7, 7, 9, 7]]) == [7, 1, 8, 9, 1, 8, 7, 0, 7, 7, 9, 7]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[7, 1], 8, [9], [1, 8, 7, 0], [7, 7, 9, 7]]) == [7, 1, 8, 9, 1, 8, 7, 0, 7, 7, 9, 7]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009983", "instruction": "Write lcm(a, b) -> int: lcm.\n\nExample:\nassert lcm(4, 16) == 16\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(4, 16) == 16\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009984", "instruction": "Implement group_by_key(words): dict from first letter to list of words.\n\nExample:\nassert group_by_key(['banana', 'apple', 'coconut', 'avocado', 'coconut', 'apple', 'berry']) == {'b': ['banana', 'berry'], 'a': ['apple', 'avocado', 'apple'], 'c': ['coconut', 'coconut']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['banana', 'apple', 'coconut', 'avocado', 'coconut', 'apple', 'berry']) == {'b': ['banana', 'berry'], 'a': ['apple', 'avocado', 'apple'], 'c': ['coconut', 'coconut']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009985", "instruction": "Create function roman_to_int(s): value of a Roman numeral.\n\nExample:\nassert roman_to_int('MMMCLXXXVIII') == 3188\n\nImplement exactly this signature: `def roman_to_int(s)`. The tests call it directly.", "tests": "assert roman_to_int('MMMCLXXXVIII') == 3188\nassert roman_to_int('MCMXCIV') == 1994\nassert roman_to_int('IV') == 4\nassert roman_to_int('IX') == 9", "family": "roman_to_int", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009986", "instruction": "Write a Python function parse_duration(s) parsing a duration like '2h15m30s' into total seconds (units h, m, s; any subset, in order).\n\nExample:\nassert parse_duration('7m59s') == 479\n\nImplement exactly this signature: `def parse_duration(s)`. The tests call it directly.", "tests": "assert parse_duration('7m59s') == 479\nassert parse_duration('1h30m') == 5400\nassert parse_duration('45s') == 45\nassert parse_duration('2h') == 7200", "family": "parse_duration", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009987", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[5], 4, 0, [9, 8, 7, 6], [3, 0, 2, 5]]) == [5, 4, 0, 9, 8, 7, 6, 3, 0, 2, 5]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[5], 4, 0, [9, 8, 7, 6], [3, 0, 2, 5]]) == [5, 4, 0, 9, 8, 7, 6, 3, 0, 2, 5]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009988", "instruction": "Write a Python function lcm(a, b) returning the least common multiple.\n\nExample:\nassert lcm(8, 14) == 56\n\nImplement exactly this signature: `def lcm(a, b)`. The tests call it directly.", "tests": "assert lcm(8, 14) == 56\nassert lcm(4, 6) == 12\nassert lcm(7, 5) == 35", "family": "lcm", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009989", "instruction": "Implement power_mod(a, e, m): modular exponentiation.\n\nExample:\nassert power_mod(10, 55, 734) == 6\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(10, 55, 734) == 6\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009990", "instruction": "Write a Python function freq_map(items) returning a dict mapping each item to its count.\n\nExample:\nassert freq_map(['b', 'e', 'b', 'd', 'a', 'b', 'd', 'a']) == {'b': 3, 'e': 1, 'd': 2, 'a': 2}\n\nImplement exactly this signature: `def freq_map(items)`. The tests call it directly.", "tests": "assert freq_map(['b', 'e', 'b', 'd', 'a', 'b', 'd', 'a']) == {'b': 3, 'e': 1, 'd': 2, 'a': 2}\nassert freq_map(['a', 'b', 'a']) == {'a': 2, 'b': 1}\nassert freq_map([]) == {}", "family": "freq_map", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009991", "instruction": "Define eval_expr evaluating +,-,* expressions with parentheses.\n\nExample:\nassert eval_expr('19 * (7 - 3)') == 76\n\nImplement exactly this signature: `def eval_expr(expr)`. The tests call it directly.", "tests": "assert eval_expr('19 * (7 - 3)') == 76\nassert eval_expr('2 + 3 * 4') == 14\nassert eval_expr('(2 + 3) * 4') == 20\nassert eval_expr('10 - 2 - 3') == 5\nassert eval_expr('7') == 7", "family": "eval_expr", "difficulty": "hard", "tier": "held_out", "mutation_score": 0.9} {"id": "stagec_009992", "instruction": "Create function is_prime(n): True for primes.\n\nExample:\nassert is_prime(15) == False\n\nImplement exactly this signature: `def is_prime(n)`. The tests call it directly.", "tests": "assert is_prime(15) == False\nassert is_prime(2) == True\nassert is_prime(1) == False\nassert is_prime(97) == True\nassert is_prime(100) == False\nassert is_prime(49) == False", "family": "is_prime", "difficulty": "medium", "tier": "easy", "mutation_score": 0.9} {"id": "stagec_009993", "instruction": "Write merge_dicts_sum(a, b) -> dict: additive merge.\n\nExample:\nassert merge_dicts_sum({'x': 7, 'y': 4}, {'z': 8, 'x': 9}) == {'x': 16, 'y': 4, 'z': 8}\n\nImplement exactly this signature: `def merge_dicts_sum(a, b)`. The tests call it directly.", "tests": "assert merge_dicts_sum({'x': 7, 'y': 4}, {'z': 8, 'x': 9}) == {'x': 16, 'y': 4, 'z': 8}\nassert merge_dicts_sum({'a': 1}, {'a': 2, 'b': 3}) == {'a': 3, 'b': 3}\nassert merge_dicts_sum({}, {}) == {}", "family": "merge_dicts_sum", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009994", "instruction": "Define list_sum summing a list of numbers.\n\nExample:\nassert list_sum([-14, -12, -5, -19]) == -50\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([-14, -12, -5, -19]) == -50\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009995", "instruction": "Write a Python function power_mod(a, e, m) returning (a**e) % m computed efficiently.\n\nExample:\nassert power_mod(5, 47, 571) == 43\n\nImplement exactly this signature: `def power_mod(a, e, m)`. The tests call it directly.", "tests": "assert power_mod(5, 47, 571) == 43\nassert power_mod(2, 10, 1000) == 24\nassert power_mod(5, 0, 7) == 1", "family": "power_mod", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009996", "instruction": "Create function second_largest(nums): second distinct maximum.\n\nExample:\nassert second_largest([26, 5, 20, 0, 8, 26, 20, 25, 24]) == 25\n\nImplement exactly this signature: `def second_largest(nums)`. The tests call it directly.", "tests": "assert second_largest([26, 5, 20, 0, 8, 26, 20, 25, 24]) == 25\nassert second_largest([1, 5, 3, 5]) == 3\nassert second_largest([9, 1]) == 1", "family": "second_largest", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_009997", "instruction": "Write list_sum(nums) -> number: sum.\n\nExample:\nassert list_sum([6, -17, -7, 16, 5]) == 3\n\nImplement exactly this signature: `def list_sum(nums)`. The tests call it directly.", "tests": "assert list_sum([6, -17, -7, 16, 5]) == 3\nassert list_sum([]) == 0\nassert list_sum([5]) == 5", "family": "list_sum", "difficulty": "easy", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009998", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([[4, 3, 8, 4], [9, 6]]) == [4, 3, 8, 4, 9, 6]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([[4, 3, 8, 4], [9, 6]]) == [4, 3, 8, 4, 9, 6]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0} {"id": "stagec_009999", "instruction": "Write a Python function group_by_key(words) grouping words by their first letter into a dict.\n\nExample:\nassert group_by_key(['berry', 'berry', 'banana', 'avocado', 'berry']) == {'b': ['berry', 'berry', 'banana', 'berry'], 'a': ['avocado']}\n\nImplement exactly this signature: `def group_by_key(words)`. The tests call it directly.", "tests": "assert group_by_key(['berry', 'berry', 'banana', 'avocado', 'berry']) == {'b': ['berry', 'berry', 'banana', 'berry'], 'a': ['avocado']}\nassert group_by_key(['apple', 'avocado', 'banana']) == {'a': ['apple', 'avocado'], 'b': ['banana']}\nassert group_by_key([]) == {}", "family": "group_by_key", "difficulty": "hard", "tier": "standard", "mutation_score": 1.0} {"id": "stagec_010000", "instruction": "Create function flatten_once(nested): flatten one level deep.\n\nExample:\nassert flatten_once([5, 6, 4, [0, 4], [2, 3, 3]]) == [5, 6, 4, 0, 4, 2, 3, 3]\n\nImplement exactly this signature: `def flatten_once(nested)`. The tests call it directly.", "tests": "assert flatten_once([5, 6, 4, [0, 4], [2, 3, 3]]) == [5, 6, 4, 0, 4, 2, 3, 3]\nassert flatten_once([[1, 2], [3]]) == [1, 2, 3]\nassert flatten_once([1, [2], 3]) == [1, 2, 3]\nassert flatten_once([]) == []", "family": "flatten_once", "difficulty": "medium", "tier": "easy", "mutation_score": 1.0}