{"date": "2026-11-03 05:15", "hash": "fe585eb4df8c88d844eeb463ea4d0302", "eval": {"HumanEval/1": [{"task_id": "HumanEval/1", "solution": "from typing import List\ndef separate_paren_groups(paren_string: str) -> List[str]:\n    \"\"\" Input to this function is a string containing multiple groups of nested parentheses. Your goal is to\n    separate those group into separate strings and return the list of those.\n    Separate groups are balanced (each open brace is properly closed) and not nested within each other\n    Ignore any spaces in the input string.\n    >>> separate_paren_groups('( ) (( )) (( )( ))')\n    ['()', '(())', '(()())']\n    \"\"\"\n    result = []\n    current_group = []\n    balance = 0\n\n    for char in paren_string.replace(\" \", \"\"):\n        if char == '(':\n            balance += 1\n            current_group.append(char)\n        elif char == ')':\n            balance -= 1\n            current_group.append(char)\n            if balance == 0:\n                result.append(''.join(current_group))\n                current_group = []\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/4": [{"task_id": "HumanEval/4", "solution": "from typing import List\ndef mean_absolute_deviation(numbers: List[float]) -> float:\n    \"\"\" For a given list of input numbers, calculate Mean Absolute Deviation\n    around the mean of this dataset.\n    Mean Absolute Deviation is the average absolute difference between each\n    element and a centerpoint (mean in this case):\n    MAD = average | x - x_mean |\n    >>> mean_absolute_deviation([1.0, 2.0, 3.0, 4.0])\n    1.0\n    \"\"\"\n    if not numbers:\n        return 0.0\n\n    mean = sum(numbers) / len(numbers)\n    absolute_deviations = [abs(x - mean) for x in numbers]\n    mad = sum(absolute_deviations) / len(numbers)\n\n    return mad", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/3": [{"task_id": "HumanEval/3", "solution": "from typing import List\ndef below_zero(operations: List[int]) -> bool:\n    \"\"\" You're given a list of deposit and withdrawal operations on a bank account that starts with\n    zero balance. Your task is to detect if at any point the balance of account falls below zero, and\n    at that point function should return True. Otherwise it should return False.\n    >>> below_zero([1, 2, 3])\n    False\n    >>> below_zero([1, 2, -4, 5])\n    True\n    \"\"\"\n    balance = 0\n    for op in operations:\n        balance += op\n        if balance < 0:\n            return True\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/7": [{"task_id": "HumanEval/7", "solution": "from typing import List\ndef filter_by_substring(strings: List[str], substring: str) -> List[str]:\n    \"\"\" Filter an input list of strings only for ones that contain given substring\n    >>> filter_by_substring([], 'a')\n    []\n    >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')\n    ['abc', 'bacd', 'array']\n    \"\"\"\n    return [s for s in strings if substring in s]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/2": [{"task_id": "HumanEval/2", "solution": "def truncate_number(number: float) -> float:\n    \"\"\" Given a positive floating point number, it can be decomposed into\n    and integer part (largest integer smaller than given number) and decimals\n    (leftover part always smaller than 1).\n\n    Return the decimal part of the number.\n    >>> truncate_number(3.5)\n    0.5\n    \"\"\"\n    if number < 0:\n        raise ValueError(\"Input must be a positive number\")\n    integer_part = int(number)\n    decimal_part = number - integer_part\n    return decimal_part", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/5": [{"task_id": "HumanEval/5", "solution": "from typing import List\ndef intersperse(numbers: List[int], delimeter: int) -> List[int]:\n    \"\"\" Insert a number 'delimeter' between every two consecutive elements of input list `numbers'\n    >>> intersperse([], 4)\n    []\n    >>> intersperse([1, 2, 3], 4)\n    [1, 4, 2, 4, 3]\n    \"\"\"\n    if not numbers:\n        return []\n\n    result = []\n    for i, num in enumerate(numbers):\n        result.append(num)\n        if i != len(numbers) - 1:\n            result.append(delimeter)\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/0": [{"task_id": "HumanEval/0", "solution": "from typing import List\ndef has_close_elements(numbers: List[float], threshold: float) -> bool:\n    \"\"\" Check if in given list of numbers, are any two numbers closer to each other than\n    given threshold.\n    >>> has_close_elements([1.0, 2.0, 3.0], 0.5)\n    False\n    >>> has_close_elements([1.0, 2.8, 3.0, 4.0, 5.0, 2.0], 0.3)\n    True\n    \"\"\"\n    # Sort the list to easily compare adjacent elements\n    sorted_numbers = sorted(numbers)\n\n    # Compare each adjacent pair in the sorted list\n    for i in range(len(sorted_numbers) - 1):\n        if abs(sorted_numbers[i] - sorted_numbers[i+1]) < threshold:\n            return True\n\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/6": [{"task_id": "HumanEval/6", "solution": "from typing import List\ndef parse_nested_parens(paren_string: str) -> List[int]:\n    \"\"\" Input to this function is a string represented multiple groups for nested parentheses separated by spaces.\n    For each of the group, output the deepest level of nesting of parentheses.\n    E.g. (()()) has maximum two levels of nesting while ((())) has three.\n\n    >>> parse_nested_parens('(()()) ((())) () ((())()())')\n    [2, 3, 1, 3]\n    \"\"\"\n    groups = paren_string.split()\n    results = []\n\n    for group in groups:\n        max_depth = 0\n        current_depth = 0\n\n        for char in group:\n            if char == '(':\n                current_depth += 1\n                if current_depth > max_depth:\n                    max_depth = current_depth\n            elif char == ')':\n                current_depth -= 1\n\n        results.append(max_depth)\n\n    return results", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/11": [{"task_id": "HumanEval/11", "solution": "from typing import List\ndef string_xor(a: str, b: str) -> str:\n    \"\"\" Input are two strings a and b consisting only of 1s and 0s.\n    Perform binary XOR on these inputs and return result also as a string.\n    >>> string_xor('010', '110')\n    '100'\n    \"\"\"\n    # Ensure both strings are of the same length by padding with leading zeros\n    max_len = max(len(a), len(b))\n    a = a.zfill(max_len)\n    b = b.zfill(max_len)\n\n    result = []\n    for bit_a, bit_b in zip(a, b):\n        # XOR operation: 1 if bits are different, 0 if same\n        xor_bit = '1' if bit_a != bit_b else '0'\n        result.append(xor_bit)\n\n    return ''.join(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/10": [{"task_id": "HumanEval/10", "solution": "def is_palindrome(string: str) -> bool:\n    \"\"\" Test if given string is a palindrome \"\"\"\n    return string == string[::-1]\ndef make_palindrome(string: str) -> str:\n    \"\"\" Find the shortest palindrome that begins with a supplied string.\n    Algorithm idea is simple:\n    - Find the longest postfix of supplied string that is a palindrome.\n    - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.\n    >>> make_palindrome('')\n    ''\n    >>> make_palindrome('cat')\n    'catac'\n    >>> make_palindrome('cata')\n    'catac'\n    \"\"\"\n    if not string:\n        return string\n\n    # Find the longest palindromic suffix\n    n = len(string)\n    for i in range(n):\n        substring = string[i:]\n        if is_palindrome(substring):\n            # The part before the palindromic suffix needs to be reversed and appended\n            prefix_to_add = string[:i][::-1]\n            return string + prefix_to_add\n\n    # If no palindromic suffix found (shouldn't happen for non-empty string)\n    return string + string[:-1][::-1]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/8": [{"task_id": "HumanEval/8", "solution": "from typing import List, Tuple\ndef sum_product(numbers: List[int]) -> Tuple[int, int]:\n    \"\"\" For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.\n    Empty sum should be equal to 0 and empty product should be equal to 1.\n    >>> sum_product([])\n    (0, 1)\n    >>> sum_product([1, 2, 3, 4])\n    (10, 24)\n    \"\"\"\n    total_sum = sum(numbers)\n    total_product = 1\n    for num in numbers:\n        total_product *= num\n    return (total_sum, total_product)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/12": [{"task_id": "HumanEval/12", "solution": "from typing import List, Optional\ndef longest(strings: List[str]) -> Optional[str]:\n    \"\"\" Out of list of strings, return the longest one. Return the first one in case of multiple\n    strings of the same length. Return None in case the input list is empty.\n    >>> longest([])\n\n    >>> longest(['a', 'b', 'c'])\n    'a'\n    >>> longest(['a', 'bb', 'ccc'])\n    'ccc'\n    \"\"\"\n    if not strings:\n        return None\n\n    max_length = -1\n    result = None\n\n    for s in strings:\n        if len(s) > max_length:\n            max_length = len(s)\n            result = s\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/13": [{"task_id": "HumanEval/13", "solution": "def greatest_common_divisor(a: int, b: int) -> int:\n    \"\"\" Return a greatest common divisor of two integers a and b\n    >>> greatest_common_divisor(3, 5)\n    1\n    >>> greatest_common_divisor(25, 15)\n    5\n    \"\"\"\n    while b:\n        a, b = b, a % b\n    return abs(a)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/9": [{"task_id": "HumanEval/9", "solution": "from typing import List\ndef rolling_max(numbers: List[int]) -> List[int]:\n    \"\"\" From a given list of integers, generate a list of rolling maximum element found until given moment\n    in the sequence.\n    >>> rolling_max([1, 2, 3, 2, 3, 4, 2])\n    [1, 2, 3, 3, 3, 4, 4]\n    \"\"\"\n    if not numbers:\n        return []\n\n    result = []\n    current_max = numbers[0]\n    result.append(current_max)\n\n    for num in numbers[1:]:\n        if num > current_max:\n            current_max = num\n        result.append(current_max)\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/14": [{"task_id": "HumanEval/14", "solution": "from typing import List\ndef all_prefixes(string: str) -> List[str]:\n    \"\"\"Return list of all prefixes from shortest to longest of the input string.\n\n    Args:\n        string: The input string to generate prefixes from.\n\n    Returns:\n        A list of strings representing all prefixes of the input string,\n        ordered from shortest to longest.\n\n    Examples:\n        >>> all_prefixes('abc')\n        ['a', 'ab', 'abc']\n        >>> all_prefixes('')\n        []\n    \"\"\"\n    return [string[:i] for i in range(1, len(string) + 1)]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/19": [{"task_id": "HumanEval/19", "solution": "from typing import List\ndef sort_numbers(numbers: str) -> str:\n    \"\"\" Input is a space-delimited string of numberals from 'zero' to 'nine'.\n    Valid choices are 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight' and 'nine'.\n    Return the string with numbers sorted from smallest to largest\n    >>> sort_numbers('three one five')\n    'one three five'\n    \"\"\"\n    # Mapping from word to numerical value\n    word_to_num = {\n        'zero': 0,\n        'one': 1,\n        'two': 2,\n        'three': 3,\n        'four': 4,\n        'five': 5,\n        'six': 6,\n        'seven': 7,\n        'eight': 8,\n        'nine': 9\n    }\n\n    # Split the input string into individual words\n    words = numbers.split()\n\n    # Sort the words based on their numerical values\n    sorted_words = sorted(words, key=lambda word: word_to_num[word])\n\n    # Join the sorted words back into a string\n    return ' '.join(sorted_words)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/17": [{"task_id": "HumanEval/17", "solution": "from typing import List\ndef parse_music(music_string: str) -> List[int]:\n    \"\"\"Parse a music string into a list of beat counts.\n\n    Args:\n        music_string: A string containing musical notes in the format:\n            'o' - whole note (4 beats)\n            'o|' - half note (2 beats)\n            '.|' - quarter note (1 beat)\n\n    Returns:\n        List[int]: A list where each element represents the beat count of the corresponding note.\n\n    Examples:\n        >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n        [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n    \"\"\"\n    beat_map = {\n        'o': 4,\n        'o|': 2,\n        '.|': 1\n    }\n\n    notes = music_string.split()\n    beats = []\n    for note in notes:\n        beats.append(beat_map[note])\n    return beats", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/18": [{"task_id": "HumanEval/18", "solution": "def how_many_times(string: str, substring: str) -> int:\n    \"\"\" Find how many times a given substring can be found in the original string. Count overlaping cases.\n    >>> how_many_times('', 'a')\n    0\n    >>> how_many_times('aaa', 'a')\n    3\n    >>> how_many_times('aaaa', 'aa')\n    3\n    \"\"\"\n    if not substring:  # handle empty substring case\n        return 0\n\n    count = 0\n    start = 0\n    len_sub = len(substring)\n    len_str = len(string)\n\n    while start <= len_str - len_sub:\n        if string[start:start+len_sub] == substring:\n            count += 1\n            start += 1  # move by 1 to allow overlapping matches\n        else:\n            start += 1\n\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/16": [{"task_id": "HumanEval/16", "solution": "def count_distinct_characters(string: str) -> int:\n    \"\"\" Given a string, find out how many distinct characters (regardless of case) does it consist of\n    >>> count_distinct_characters('xyzXYZ')\n    3\n    >>> count_distinct_characters('Jerry')\n    4\n    \"\"\"\n    # Convert the string to lowercase to make the comparison case-insensitive\n    lower_string = string.lower()\n    # Use a set to automatically handle uniqueness\n    distinct_chars = set(lower_string)\n    # Return the count of distinct characters\n    return len(distinct_chars)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/20": [{"task_id": "HumanEval/20", "solution": "from typing import List, Tuple\ndef find_closest_elements(numbers: List[float]) -> Tuple[float, float]:\n    \"\"\" From a supplied list of numbers (of length at least two) select and return two that are the closest to each\n    other and return them in order (smaller number, larger number).\n    >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.2])\n    (2.0, 2.2)\n    >>> find_closest_elements([1.0, 2.0, 3.0, 4.0, 5.0, 2.0])\n    (2.0, 2.0)\n    \"\"\"\n    if len(numbers) < 2:\n        raise ValueError(\"List must contain at least two numbers\")\n\n    # Sort the list to easily find adjacent elements\n    sorted_numbers = sorted(numbers)\n    min_diff = float('inf')\n    closest_pair = (0.0, 0.0)\n\n    # Iterate through adjacent pairs in the sorted list\n    for i in range(len(sorted_numbers) - 1):\n        diff = abs(sorted_numbers[i] - sorted_numbers[i+1])\n        if diff < min_diff:\n            min_diff = diff\n            closest_pair = (sorted_numbers[i], sorted_numbers[i+1])\n\n    return closest_pair", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/21": [{"task_id": "HumanEval/21", "solution": "from typing import List\ndef rescale_to_unit(numbers: List[float]) -> List[float]:\n    \"\"\" Given list of numbers (of at least two elements), apply a linear transform to that list,\n    such that the smallest number will become 0 and the largest will become 1\n    >>> rescale_to_unit([1.0, 2.0, 3.0, 4.0, 5.0])\n    [0.0, 0.25, 0.5, 0.75, 1.0]\n    \"\"\"\n    if len(numbers) < 2:\n        raise ValueError(\"Input list must contain at least two elements\")\n\n    min_val = min(numbers)\n    max_val = max(numbers)\n\n    if min_val == max_val:\n        return [0.0] * len(numbers)\n\n    rescaled = []\n    for num in numbers:\n        rescaled_num = (num - min_val) / (max_val - min_val)\n        rescaled.append(rescaled_num)\n\n    return rescaled", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/22": [{"task_id": "HumanEval/22", "solution": "from typing import List, Any\ndef filter_integers(values: List[Any]) -> List[int]:\n    \"\"\" Filter given list of any python values only for integers\n    >>> filter_integers(['a', 3.14, 5])\n    [5]\n    >>> filter_integers([1, 2, 3, 'abc', {}, []])\n    [1, 2, 3]\n    \"\"\"\n    return [x for x in values if isinstance(x, int) and not isinstance(x, bool)]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/15": [{"task_id": "HumanEval/15", "solution": "def string_sequence(n: int) -> str:\n    \"\"\" Return a string containing space-delimited numbers starting from 0 upto n inclusive.\n    >>> string_sequence(0)\n    '0'\n    >>> string_sequence(5)\n    '0 1 2 3 4 5'\n    \"\"\"\n    return ' '.join(str(i) for i in range(n + 1))", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/23": [{"task_id": "HumanEval/23", "solution": "def strlen(string: str) -> int:\n    \"\"\" Return length of given string\n    >>> strlen('')\n    0\n    >>> strlen('abc')\n    3\n    \"\"\"\n    return len(string)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/28": [{"task_id": "HumanEval/28", "solution": "from typing import List\ndef concatenate(strings: List[str]) -> str:\n    \"\"\" Concatenate list of strings into a single string\n    >>> concatenate([])\n    ''\n    >>> concatenate(['a', 'b', 'c'])\n    'abc'\n    \"\"\"\n    return ''.join(strings)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/27": [{"task_id": "HumanEval/27", "solution": "def flip_case(string: str) -> str:\n    \"\"\" For a given string, flip lowercase characters to uppercase and uppercase to lowercase.\n    >>> flip_case('Hello')\n    'hELLO'\n    \"\"\"\n    flipped = []\n    for char in string:\n        if char.islower():\n            flipped.append(char.upper())\n        elif char.isupper():\n            flipped.append(char.lower())\n        else:\n            flipped.append(char)\n    return ''.join(flipped)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/25": [{"task_id": "HumanEval/25", "solution": "from typing import List\ndef factorize(n: int) -> List[int]:\n    \"\"\" Return list of prime factors of given integer in the order from smallest to largest.\n    Each of the factors should be listed number of times corresponding to how many times it appeares in factorization.\n    Input number should be equal to the product of all factors\n    >>> factorize(8)\n    [2, 2, 2]\n    >>> factorize(25)\n    [5, 5]\n    >>> factorize(70)\n    [2, 5, 7]\n    \"\"\"\n    factors = []\n    # Handle 2 separately\n    while n % 2 == 0:\n        factors.append(2)\n        n = n // 2\n    # Check odd numbers up to sqrt(n)\n    i = 3\n    max_factor = int(n**0.5) + 1\n    while i <= max_factor:\n        while n % i == 0:\n            factors.append(i)\n            n = n // i\n            max_factor = int(n**0.5) + 1\n        i += 2\n    if n > 1:\n        factors.append(n)\n    return factors", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/26": [{"task_id": "HumanEval/26", "solution": "from typing import List\nfrom collections import Counter\ndef remove_duplicates(numbers: List[int]) -> List[int]:\n    \"\"\" From a list of integers, remove all elements that occur more than once.\n    Keep order of elements left the same as in the input.\n    >>> remove_duplicates([1, 2, 3, 2, 4])\n    [1, 3, 4]\n    \"\"\"\n    # Count occurrences of each number\n    count = Counter(numbers)\n\n    # Filter numbers that appear exactly once, preserving order\n    result = [num for num in numbers if count[num] == 1]\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/29": [{"task_id": "HumanEval/29", "solution": "from typing import List\ndef filter_by_prefix(strings: List[str], prefix: str) -> List[str]:\n    \"\"\" Filter an input list of strings only for ones that start with a given prefix.\n    >>> filter_by_prefix([], 'a')\n    []\n    >>> filter_by_prefix(['abc', 'bcd', 'cde', 'array'], 'a')\n    ['abc', 'array']\n    \"\"\"\n    return [s for s in strings if s.startswith(prefix)]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/24": [{"task_id": "HumanEval/24", "solution": "def largest_divisor(n: int) -> int:\n    \"\"\" For a given number n, find the largest number that divides n evenly, smaller than n\n    >>> largest_divisor(15)\n    5\n    \"\"\"\n    if n <= 1:\n        return None  # No valid divisor for numbers <= 1\n\n    # Start checking from n//2 down to 1\n    for i in range(n // 2, 0, -1):\n        if n % i == 0:\n            return i\n\n    return None  # Shouldn't reach here for n > 1", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/30": [{"task_id": "HumanEval/30", "solution": "def get_positive(l: list):\n    \"\"\"Return only positive numbers in the list.\n    >>> get_positive([-1, 2, -4, 5, 6])\n    [2, 5, 6]\n    >>> get_positive([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n    [5, 3, 2, 3, 9, 123, 1]\n    \"\"\"\n    return [x for x in l if x > 0]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/31": [{"task_id": "HumanEval/31", "solution": "def is_prime(n):\n    \"\"\"Return true if a given number is prime, and false otherwise.\n    >>> is_prime(6)\n    False\n    >>> is_prime(101)\n    True\n    >>> is_prime(11)\n    True\n    >>> is_prime(13441)\n    True\n    >>> is_prime(61)\n    True\n    >>> is_prime(4)\n    False\n    >>> is_prime(1)\n    False\n    \"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n\n    # Check odd divisors up to sqrt(n)\n    max_divisor = int(n**0.5) + 1\n    for d in range(3, max_divisor, 2):\n        if n % d == 0:\n            return False\n    return True", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/32": [{"task_id": "HumanEval/32", "solution": "import math\ndef poly(xs: list, x: float):\n    \"\"\"\n    Evaluates polynomial with coefficients xs at point x.\n    return xs[0] + xs[1] * x + xs[1] * x^2 + .... xs[n] * x^n\n    \"\"\"\n    return sum([coeff * math.pow(x, i) for i, coeff in enumerate(xs)])\ndef find_zero(xs: list):\n    \"\"\" xs are coefficients of a polynomial.\n    find_zero find x such that poly(x) = 0.\n    find_zero returns only only zero point, even if there are many.\n    Moreover, find_zero only takes list xs having even number of coefficients\n    and largest non zero coefficient as it guarantees\n    a solution.\n    >>> round(find_zero([1, 2]), 2) # f(x) = 1 + 2x\n    -0.5\n    >>> round(find_zero([-6, 11, -6, 1]), 2) # (x - 1) * (x - 2) * (x - 3) = -6 + 11x - 6x^2 + x^3\n    1.0\n    \"\"\"\n    # Verify input constraints\n    if len(xs) % 2 != 0:\n        raise ValueError(\"Polynomial must have an even number of coefficients\")\n    if not any(xs):\n        raise ValueError(\"Polynomial must have at least one non-zero coefficient\")\n\n    # For even degree polynomials with positive leading coefficient,\n    # there's at least one negative root\n    # We'll use the Intermediate Value Theorem to find a root\n    # between -1 and 0 (since f(0) = xs[0] and f(-1) = sum(xs))\n\n    # Evaluate at x=0 and x=-1\n    f0 = poly(xs, 0)\n    f_neg1 = poly(xs, -1)\n\n    # If f(0) is zero, return 0\n    if f0 == 0:\n        return 0.0\n\n    # If f(-1) is zero, return -1\n    if f_neg1 == 0:\n        return -1.0\n\n    # Determine the interval where the root lies\n    if f0 * f_neg1 > 0:\n        # Root is not between -1 and 0, so we need to search elsewhere\n        # For simplicity, we'll just search between -10 and 10\n        # In a real implementation, you'd want a more sophisticated approach\n        low = -10\n        high = 10\n    else:\n        low = -1\n        high = 0\n\n    # Binary search to find the root\n    epsilon = 1e-10\n    max_iterations = 100\n    for _ in range(max_iterations):\n        mid = (low + high) / 2\n        f_mid = poly(xs, mid)\n\n        if abs(f_mid) < epsilon:\n            return mid\n\n        if f_mid * f0 < 0:\n            high = mid\n        else:\n            low = mid\n\n    return (low + high) / 2", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[-10, -2]]], "plus_fail_tests": [[[5, 10, -3, 1]]]}], "HumanEval/33": [{"task_id": "HumanEval/33", "solution": "def sort_third(l: list):\n    \"\"\"This function takes a list l and returns a list l' such that\n    l' is identical to l in the indicies that are not divisible by three, while its values at the indicies that are divisible by three are equal\n    to the values of the corresponding indicies of l, but sorted.\n    >>> sort_third([1, 2, 3])\n    [1, 2, 3]\n    >>> sort_third([5, 6, 3, 4, 8, 9, 2])\n    [2, 6, 3, 4, 8, 9, 5]\n    \"\"\"\n    # Extract elements at indices divisible by 3\n    third_elements = [l[i] for i in range(len(l)) if i % 3 == 0]\n\n    # Sort these elements\n    third_elements_sorted = sorted(third_elements)\n\n    # Create the result list\n    result = l.copy()\n    sorted_index = 0\n    for i in range(len(result)):\n        if i % 3 == 0:\n            result[i] = third_elements_sorted[sorted_index]\n            sorted_index += 1\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/34": [{"task_id": "HumanEval/34", "solution": "def unique(l: list):\n    \"\"\"Return sorted unique elements in a list\n    >>> unique([5, 3, 5, 2, 3, 3, 9, 0, 123])\n    [0, 2, 3, 5, 9, 123]\n    \"\"\"\n    return sorted(set(l))", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/35": [{"task_id": "HumanEval/35", "solution": "def max_element(l: list):\n    \"\"\"Return maximum element in the list.\n    >>> max_element([1, 2, 3])\n    3\n    >>> max_element([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10])\n    123\n    \"\"\"\n    if not l:  # Handle empty list case\n        raise ValueError(\"List cannot be empty\")\n    max_val = l[0]\n    for num in l[1:]:\n        if num > max_val:\n            max_val = num\n    return max_val", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/37": [{"task_id": "HumanEval/37", "solution": "def sort_even(l: list):\n    \"\"\"This function takes a list l and returns a list l' such that\n    l' is identical to l in the odd indicies, while its values at the even indicies are equal\n    to the values of the even indicies of l, but sorted.\n    >>> sort_even([1, 2, 3])\n    [1, 2, 3]\n    >>> sort_even([5, 6, 3, 4])\n    [3, 6, 5, 4]\n    \"\"\"\n    # Extract elements at even indices (0, 2, 4, ...)\n    even_indices = l[::2]\n    # Sort the even-indexed elements\n    sorted_evens = sorted(even_indices)\n    # Reconstruct the list with sorted even indices and original odd indices\n    result = []\n    even_ptr = 0\n    for i in range(len(l)):\n        if i % 2 == 0:\n            result.append(sorted_evens[even_ptr])\n            even_ptr += 1\n        else:\n            result.append(l[i])\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/38": [{"task_id": "HumanEval/38", "solution": "def decode_cyclic(s: str) -> str:\n    \"\"\"\n    Decodes a string encoded with the encode_cyclic function.\n\n    Args:\n        s: Input string to be decoded.\n\n    Returns:\n        Decoded string where each group of three characters is un-cycled (e.g., 'bca' becomes 'abc').\n        Groups with fewer than three characters remain unchanged.\n    \"\"\"\n    # Split the string into groups of three characters\n    groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n    # Un-cycle elements in each group (only if group has exactly 3 characters)\n    groups = [(group[-1] + group[:-1]) if len(group) == 3 else group for group in groups]\n    return \"\".join(groups)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/36": [{"task_id": "HumanEval/36", "solution": "def fizz_buzz(n: int) -> int:\n    \"\"\"Return the number of times the digit 7 appears in integers less than n which are divisible by 11 or 13.\n    >>> fizz_buzz(50)\n    0\n    >>> fizz_buzz(78)\n    2\n    >>> fizz_buzz(79)\n    3\n    \"\"\"\n    count = 0\n    for num in range(1, n):\n        if num % 11 == 0 or num % 13 == 0:\n            count += str(num).count('7')\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/40": [{"task_id": "HumanEval/40", "solution": "def triples_sum_to_zero(l: list) -> bool:\n    \"\"\"\n    triples_sum_to_zero takes a list of integers as an input.\n    it returns True if there are three distinct elements in the list that\n    sum to zero, and False otherwise.\n\n    >>> triples_sum_to_zero([1, 3, 5, 0])\n    False\n    >>> triples_sum_to_zero([1, 3, -2, 1])\n    True\n    >>> triples_sum_to_zero([1, 2, 3, 7])\n    False\n    >>> triples_sum_to_zero([2, 4, -5, 3, 9, 7])\n    True\n    >>> triples_sum_to_zero([1])\n    False\n    \"\"\"\n    n = len(l)\n    if n < 3:\n        return False\n\n    # Create a set of all elements for O(1) lookups\n    elements = set(l)\n\n    # Iterate through all possible pairs\n    for i in range(n):\n        for j in range(i + 1, n):\n            # Calculate the required third element\n            target = - (l[i] + l[j])\n            # Check if the target exists in the set and is distinct from the current elements\n            if target in elements and target != l[i] and target != l[j]:\n                return True\n    return False", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[[0, 0, 0]]]}], "HumanEval/41": [{"task_id": "HumanEval/41", "solution": "def car_race_collision(n: int) -> int:\n    \"\"\"\n    Imagine a road that's a perfectly straight infinitely long line.\n    n cars are driving left to right; simultaneously, a different set of n cars\n    are driving right to left. The two sets of cars start out being very far from\n    each other. All cars move in the same speed. Two cars are said to collide\n    when a car that's moving left to right hits a car that's moving right to left.\n    However, the cars are infinitely sturdy and strong; as a result, they continue moving\n    in their trajectory as if they did not collide.\n\n    This function outputs the number of such collisions.\n    \"\"\"\n    return n * n", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/43": [{"task_id": "HumanEval/43", "solution": "def pairs_sum_to_zero(l):\n    \"\"\"\n    pairs_sum_to_zero takes a list of integers as an input.\n    it returns True if there are two distinct elements in the list that\n    sum to zero, and False otherwise.\n    >>> pairs_sum_to_zero([1, 3, 5, 0])\n    False\n    >>> pairs_sum_to_zero([1, 3, -2, 1])\n    False\n    >>> pairs_sum_to_zero([1, 2, 3, 7])\n    False\n    >>> pairs_sum_to_zero([2, 4, -5, 3, 5, 7])\n    True\n    >>> pairs_sum_to_zero([1])\n    False\n    \"\"\"\n    seen = set()\n    for num in l:\n        if -num in seen:\n            return True\n        seen.add(num)\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/44": [{"task_id": "HumanEval/44", "solution": "def change_base(x: int, base: int) -> str:\n    \"\"\"Change numerical base of input number x to base.\n    return string representation after the conversion.\n    base numbers are less than 10.\n    >>> change_base(8, 3)\n    '22'\n    >>> change_base(8, 2)\n    '1000'\n    >>> change_base(7, 2)\n    '111'\n    \"\"\"\n    if base < 2 or base > 10:\n        raise ValueError(\"Base must be between 2 and 10\")\n\n    if x == 0:\n        return \"0\"\n\n    digits = []\n    n = x\n    while n > 0:\n        remainder = n % base\n        digits.append(str(remainder))\n        n = n // base\n\n    return ''.join(reversed(digits))", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/42": [{"task_id": "HumanEval/42", "solution": "def incr_list(l: list) -> list:\n    \"\"\"Return list with elements incremented by 1.\n    >>> incr_list([1, 2, 3])\n    [2, 3, 4]\n    >>> incr_list([5, 3, 5, 2, 3, 3, 9, 0, 123])\n    [6, 4, 6, 3, 4, 4, 10, 1, 124]\n    \"\"\"\n    return [x + 1 for x in l]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/45": [{"task_id": "HumanEval/45", "solution": "def triangle_area(a, h):\n    \"\"\"Given length of a side and high return area for a triangle.\n    >>> triangle_area(5, 3)\n    7.5\n    \"\"\"\n    return 0.5 * a * h", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/46": [{"task_id": "HumanEval/46", "solution": "def fib4(n: int) -> int:\n    \"\"\"The Fib4 number sequence is a sequence similar to the Fibonacci sequence that's defined as follows:\n    fib4(0) -> 0\n    fib4(1) -> 0\n    fib4(2) -> 2\n    fib4(3) -> 0\n    fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).\n\n    Args:\n        n: The index in the Fib4 sequence to compute.\n\n    Returns:\n        The n-th Fib4 number.\n\n    Examples:\n        >>> fib4(5)\n        4\n        >>> fib4(6)\n        8\n        >>> fib4(7)\n        14\n    \"\"\"\n    if n == 0 or n == 1:\n        return 0\n    if n == 2:\n        return 2\n    if n == 3:\n        return 0\n\n    # Initialize the first four values\n    a, b, c, d = 0, 0, 2, 0\n\n    for i in range(4, n + 1):\n        next_val = a + b + c + d\n        a, b, c, d = b, c, d, next_val\n\n    return d", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/48": [{"task_id": "HumanEval/48", "solution": "def is_palindrome(text: str) -> bool:\n    \"\"\"\n    Checks if given string is a palindrome.\n\n    A palindrome is a string that reads the same backward as forward,\n    ignoring case and non-alphanumeric characters.\n\n    Args:\n        text: The string to check\n\n    Returns:\n        bool: True if the string is a palindrome, False otherwise\n\n    Examples:\n        >>> is_palindrome('')\n        True\n        >>> is_palindrome('aba')\n        True\n        >>> is_palindrome('aaaaa')\n        True\n        >>> is_palindrome('zbcd')\n        False\n        >>> is_palindrome('A man, a plan, a canal: Panama')\n        True\n        >>> is_palindrome('racecar')\n        True\n        >>> is_palindrome('hello')\n        False\n    \"\"\"\n    # Remove all non-alphanumeric characters and convert to lowercase\n    cleaned = ''.join(char.lower() for char in text if char.isalnum())\n    # Compare the cleaned string with its reverse\n    return cleaned == cleaned[::-1]", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["never odd or even"]]}], "HumanEval/47": [{"task_id": "HumanEval/47", "solution": "def median(l: list):\n    \"\"\"Return median of elements in the list l.\n    >>> median([3, 1, 2, 4, 5])\n    3\n    >>> median([-10, 4, 6, 1000, 10, 20])\n    15.0\n    \"\"\"\n    sorted_list = sorted(l)\n    n = len(sorted_list)\n    mid = n // 2\n\n    if n % 2 == 1:\n        return sorted_list[mid]\n    else:\n        return (sorted_list[mid - 1] + sorted_list[mid]) / 2", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/51": [{"task_id": "HumanEval/51", "solution": "def remove_vowels(text):\n    \"\"\"\n    remove_vowels is a function that takes string and returns string without vowels.\n    >>> remove_vowels('')\n    ''\n    >>> remove_vowels(\"abcdef\\nghijklm\")\n    'bcdf\\nghjklm'\n    >>> remove_vowels('abcdef')\n    'bcdf'\n    >>> remove_vowels('aaaaa')\n    ''\n    >>> remove_vowels('aaBAA')\n    'B'\n    >>> remove_vowels('zbcd')\n    'zbcd'\n    \"\"\"\n    vowels = \"aeiouAEIOU\"\n    result = []\n    for char in text:\n        if char not in vowels:\n            result.append(char)\n    return ''.join(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/50": [{"task_id": "HumanEval/50", "solution": "def decode_shift(s: str) -> str:\n    \"\"\"\n    Takes as input string encoded with encode_shift function.\n    Returns decoded string by shifting characters back by 5.\n    Only processes lowercase letters, leaves other characters unchanged.\n    \"\"\"\n    decoded = []\n    for ch in s:\n        if 'a' <= ch <= 'z':\n            shifted = ord(ch) - 5\n            if shifted < ord('a'):\n                shifted += 26\n            decoded.append(chr(shifted))\n        else:\n            decoded.append(ch)\n    return ''.join(decoded)", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["encoded message with shift"]]}], "HumanEval/49": [{"task_id": "HumanEval/49", "solution": "def modp(n: int, p: int) -> int:\n    \"\"\"Return 2^n modulo p (be aware of numerics).\n\n    Uses modular exponentiation to compute the result efficiently\n    without dealing with large intermediate values.\n\n    >>> modp(3, 5)\n    3\n    >>> modp(1101, 101)\n    2\n    >>> modp(0, 101)\n    1\n    >>> modp(3, 11)\n    8\n    >>> modp(100, 101)\n    1\n    \"\"\"\n    if p == 1:\n        return 0\n    result = 1\n    base = 2\n    exponent = n\n    while exponent > 0:\n        if exponent % 2 == 1:\n            result = (result * base) % p\n        base = (base * base) % p\n        exponent = exponent // 2\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/52": [{"task_id": "HumanEval/52", "solution": "def below_threshold(l: list, t: int) -> bool:\n    \"\"\"Return True if all numbers in the list l are below threshold t.\n    >>> below_threshold([1, 2, 4, 10], 100)\n    True\n    >>> below_threshold([1, 20, 4, 10], 5)\n    False\n    \"\"\"\n    return all(x < t for x in l)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/53": [{"task_id": "HumanEval/53", "solution": "def add(x: int, y: int) -> int:\n    \"\"\"Add two numbers x and y\n\n    >>> add(2, 3)\n    5\n    >>> add(5, 7)\n    12\n    >>> add(-1, 1)\n    0\n    \"\"\"\n    return x + y", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/55": [{"task_id": "HumanEval/55", "solution": "def fib(n: int) -> int:\n    \"\"\"Return n-th Fibonacci number.\n    >>> fib(10)\n    55\n    >>> fib(1)\n    1\n    >>> fib(8)\n    21\n    \"\"\"\n    if n <= 0:\n        raise ValueError(\"Input must be a positive integer\")\n    elif n == 1:\n        return 1\n    elif n == 2:\n        return 1\n\n    a, b = 1, 1\n    for _ in range(3, n + 1):\n        a, b = b, a + b\n    return b", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[0]]}], "HumanEval/54": [{"task_id": "HumanEval/54", "solution": "from collections import Counter\ndef same_chars(s0: str, s1: str) -> bool:\n    \"\"\"\n    Check if two words have the same characters.\n    >>> same_chars('eabcdzzzz', 'dddzzzzzzzddeddabc')\n    True\n    >>> same_chars('abcd', 'dddddddabc')\n    True\n    >>> same_chars('dddddddabc', 'abcd')\n    True\n    >>> same_chars('eabcd', 'dddddddabc')\n    False\n    >>> same_chars('abcd', 'dddddddabce')\n    False\n    >>> same_chars('eabcdzzzz', 'dddzzzzzzzddddabc')\n    False\n    \"\"\"\n    return Counter(s0) == Counter(s1)", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["eabcdzzzz", "dddzzzzzzzddeddabc"]], "plus_fail_tests": [["aaabbbccc", "abbabcbc"]]}], "HumanEval/56": [{"task_id": "HumanEval/56", "solution": "def correct_bracketing(brackets: str) -> bool:\n    \"\"\"Check if every opening bracket has a corresponding closing bracket.\n\n    Args:\n        brackets: A string consisting of '<' and '>' characters.\n\n    Returns:\n        bool: True if the brackets are correctly nested, False otherwise.\n\n    Examples:\n        >>> correct_bracketing(\"<\")\n        False\n        >>> correct_bracketing(\"<>\")\n        True\n        >>> correct_bracketing(\"<<><>>\")\n        True\n        >>> correct_bracketing(\"><<>\")\n        False\n    \"\"\"\n    balance = 0\n    for char in brackets:\n        if char == '<':\n            balance += 1\n        elif char == '>':\n            balance -= 1\n        if balance < 0:\n            return False\n    return balance == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/57": [{"task_id": "HumanEval/57", "solution": "def monotonic(l: list) -> bool:\n    \"\"\"Return True if list elements are monotonically increasing or decreasing.\n    >>> monotonic([1, 2, 4, 20])\n    True\n    >>> monotonic([1, 20, 4, 10])\n    False\n    >>> monotonic([4, 1, 0, -10])\n    True\n    \"\"\"\n    if len(l) <= 1:\n        return True\n\n    increasing = decreasing = True\n\n    for i in range(len(l) - 1):\n        if l[i] > l[i+1]:\n            increasing = False\n        if l[i] < l[i+1]:\n            decreasing = False\n        if not increasing and not decreasing:\n            return False\n\n    return increasing or decreasing", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/58": [{"task_id": "HumanEval/58", "solution": "def common(l1: list, l2: list) -> list:\n    \"\"\"Return sorted unique common elements for two lists.\n    >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])\n    [1, 5, 653]\n    >>> common([5, 3, 2, 8], [3, 2])\n    [2, 3]\n    \"\"\"\n    # Convert lists to sets to find intersection (unique common elements)\n    set1 = set(l1)\n    set2 = set(l2)\n    common_elements = set1 & set2  # Intersection of the two sets\n\n    # Convert the result to a sorted list\n    return sorted(common_elements)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/59": [{"task_id": "HumanEval/59", "solution": "def largest_prime_factor(n: int) -> int:\n    \"\"\"Return the largest prime factor of n. Assume n > 1 and is not a prime.\n    >>> largest_prime_factor(13195)\n    29\n    >>> largest_prime_factor(2048)\n    2\n    \"\"\"\n    largest_factor = 1\n    # Handle even numbers first\n    while n % 2 == 0:\n        largest_factor = 2\n        n = n // 2\n    # Now check odd numbers up to sqrt(n)\n    i = 3\n    max_factor = int(n**0.5) + 1\n    while i <= max_factor:\n        while n % i == 0:\n            largest_factor = i\n            n = n // i\n            max_factor = int(n**0.5) + 1\n        i += 2\n    if n > 1:\n        largest_factor = n\n    return largest_factor", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/60": [{"task_id": "HumanEval/60", "solution": "def sum_to_n(n: int) -> int:\n    \"\"\"sum_to_n is a function that sums numbers from 1 to n.\n    >>> sum_to_n(30)\n    465\n    >>> sum_to_n(100)\n    5050\n    >>> sum_to_n(5)\n    15\n    >>> sum_to_n(10)\n    55\n    >>> sum_to_n(1)\n    1\n    \"\"\"\n    return n * (n + 1) // 2", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/65": [{"task_id": "HumanEval/65", "solution": "def circular_shift(x, shift):\n    \"\"\"Circular shift the digits of the integer x, shift the digits right by shift\n    and return the result as a string.\n    If shift > number of digits, return digits reversed.\n    >>> circular_shift(12, 1)\n    \"21\"\n    >>> circular_shift(12, 2)\n    \"12\"\n    \"\"\"\n    digits = list(str(x))\n    n = len(digits)\n\n    if n == 0:\n        return \"\"\n\n    effective_shift = shift % n\n    if effective_shift == 0:\n        return str(x)\n\n    # Perform the circular shift\n    shifted_digits = digits[-effective_shift:] + digits[:-effective_shift]\n    return ''.join(shifted_digits)", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[97, 8]], "plus_fail_tests": [[1234, 6]]}], "HumanEval/63": [{"task_id": "HumanEval/63", "solution": "def fibfib(n: int) -> int:\n    \"\"\"The FibFib number sequence is a sequence similar to the Fibonacci sequence that's defined as follows:\n    fibfib(0) == 0\n    fibfib(1) == 0\n    fibfib(2) == 1\n    fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).\n\n    Args:\n        n: The index in the FibFib sequence to compute.\n\n    Returns:\n        The n-th FibFib number.\n\n    Examples:\n        >>> fibfib(1)\n        0\n        >>> fibfib(5)\n        4\n        >>> fibfib(8)\n        24\n    \"\"\"\n    if n == 0 or n == 1:\n        return 0\n    if n == 2:\n        return 1\n\n    # Initialize the first three values\n    a, b, c = 0, 0, 1\n\n    # Iterate from 3 to n\n    for _ in range(3, n + 1):\n        next_val = a + b + c\n        a, b, c = b, c, next_val\n\n    return c", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/62": [{"task_id": "HumanEval/62", "solution": "def derivative(xs: list) -> list:\n    \"\"\" xs represent coefficients of a polynomial.\n    xs[0] + xs[1] * x + xs[2] * x^2 + ....\n     Return derivative of this polynomial in the same form.\n    >>> derivative([3, 1, 2, 4, 5])\n    [1, 4, 12, 20]\n    >>> derivative([1, 2, 3])\n    [2, 6]\n    \"\"\"\n    if len(xs) <= 1:\n        return []\n\n    result = []\n    for i in range(1, len(xs)):\n        result.append(i * xs[i])\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/61": [{"task_id": "HumanEval/61", "solution": "def correct_bracketing(brackets: str) -> bool:\n    \"\"\"Check if every opening bracket has a corresponding closing bracket.\n\n    Args:\n        brackets: A string containing only '(' and ')'\n\n    Returns:\n        bool: True if the brackets are correctly nested, False otherwise\n\n    Examples:\n        >>> correct_bracketing(\"(\")\n        False\n        >>> correct_bracketing(\"()\")\n        True\n        >>> correct_bracketing(\"(()())\")\n        True\n        >>> correct_bracketing(\")(()\")\n        False\n    \"\"\"\n    balance = 0\n    for char in brackets:\n        if char == '(':\n            balance += 1\n        elif char == ')':\n            balance -= 1\n            if balance < 0:\n                return False\n    return balance == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/64": [{"task_id": "HumanEval/64", "solution": "def vowels_count(s):\n    \"\"\"Write a function vowels_count which takes a string representing\n    a word as input and returns the number of vowels in the string.\n    Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a\n    vowel, but only when it is at the end of the given word.\n\n    Example:\n    >>> vowels_count(\"abcde\")\n    2\n    >>> vowels_count(\"ACEDY\")\n    3\n    \"\"\"\n    vowels = {'a', 'e', 'i', 'o', 'u'}\n    count = 0\n\n    # Check all characters except the last one\n    for char in s[:-1]:\n        if char.lower() in vowels:\n            count += 1\n\n    # Check the last character for 'y' or regular vowels\n    if len(s) > 0:\n        last_char = s[-1].lower()\n        if last_char in vowels or last_char == 'y':\n            count += 1\n\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/39": [{"task_id": "HumanEval/39", "solution": "def is_prime(num: int) -> bool:\n    \"\"\"Check if a number is prime.\"\"\"\n    if num <= 1:\n        return False\n    if num == 2:\n        return True\n    if num % 2 == 0:\n        return False\n    for i in range(3, int(num**0.5) + 1, 2):\n        if num % i == 0:\n            return False\n    return True\ndef prime_fib(n: int) -> int:\n    \"\"\"\n    Returns the n-th number that is both a Fibonacci number and prime.\n\n    Args:\n        n: The position in the sequence of prime Fibonacci numbers (1-based index)\n\n    Returns:\n        The n-th prime Fibonacci number\n\n    Examples:\n        >>> prime_fib(1)\n        2\n        >>> prime_fib(2)\n        3\n        >>> prime_fib(3)\n        5\n        >>> prime_fib(4)\n        13\n        >>> prime_fib(5)\n        89\n    \"\"\"\n    if n < 1:\n        raise ValueError(\"n must be a positive integer\")\n\n    count = 0\n    a, b = 0, 1  # Fibonacci sequence starts with 0, 1\n\n    while True:\n        a, b = b, a + b\n        if is_prime(a):\n            count += 1\n            if count == n:\n                return a", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/67": [{"task_id": "HumanEval/67", "solution": "def fruit_distribution(s, n):\n    \"\"\"\n    In this task, you will be given a string that represents a number of apples and oranges\n    that are distributed in a basket of fruit this basket contains\n    apples, oranges, and mango fruits. Given the string that represents the total number of\n    the oranges and apples and an integer that represent the total number of the fruits\n    in the basket return the number of the mango fruits in the basket.\n    for example:\n    fruit_distribution(\"5 apples and 6 oranges\", 19) ->19 - 5 - 6 = 8\n    fruit_distribution(\"0 apples and 1 oranges\",3) -> 3 - 0 - 1 = 2\n    fruit_distribution(\"2 apples and 3 oranges\", 100) -> 100 - 2 - 3 = 95\n    fruit_distribution(\"100 apples and 1 oranges\",120) -> 120 - 100 - 1 = 19\n    \"\"\"\n    # Split the string into parts\n    parts = s.split()\n    # Extract the numbers (apples and oranges)\n    apples = int(parts[0])\n    oranges = int(parts[3])\n    # Calculate the number of mangoes\n    mangoes = n - apples - oranges\n    return mangoes", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/66": [{"task_id": "HumanEval/66", "solution": "def digitSum(s):\n    \"\"\"Task\n    Write a function that takes a string as input and returns the sum of the upper characters only'\n    ASCII codes.\n\n    Examples:\n        digitSum(\"\") => 0\n        digitSum(\"abAB\") => 131\n        digitSum(\"abcCd\") => 67\n        digitSum(\"helloE\") => 69\n        digitSum(\"woArBld\") => 131\n        digitSum(\"aAaaaXa\") => 153\n    \"\"\"\n    total = 0\n    for char in s:\n        if char.isupper():\n            total += ord(char)\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/72": [{"task_id": "HumanEval/72", "solution": "def will_it_fly(q, w):\n    '''\n    Write a function that returns True if the object q will fly, and False otherwise.\n    The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.\n\n    Example:\n    will_it_fly([1, 2], 5) \u279e False\n    # 1+2 is less than the maximum possible weight, but it's unbalanced.\n\n    will_it_fly([3, 2, 3], 1) \u279e False\n    # it's balanced, but 3+2+3 is more than the maximum possible weight.\n\n    will_it_fly([3, 2, 3], 9) \u279e True\n    # 3+2+3 is less than the maximum possible weight, and it's balanced.\n\n    will_it_fly([3], 5) \u279e True\n    # 3 is less than the maximum possible weight, and it's balanced.\n    '''\n    # Check if the list is a palindrome (balanced)\n    is_palindrome = q == q[::-1]\n\n    # Check if the sum of elements is <= w\n    sum_is_valid = sum(q) <= w\n\n    # Return True only if both conditions are met\n    return is_palindrome and sum_is_valid", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/71": [{"task_id": "HumanEval/71", "solution": "import math\ndef triangle_area(a, b, c):\n    '''\n    Given the lengths of the three sides of a triangle. Return the area of\n    the triangle rounded to 2 decimal points if the three sides form a valid triangle.\n    Otherwise return -1\n    Three sides make a valid triangle when the sum of any two sides is greater\n    than the third side.\n    Example:\n    triangle_area(3, 4, 5) == 6.00\n    triangle_area(1, 2, 10) == -1\n    '''\n    # Check if the sides form a valid triangle\n    if a + b <= c or a + c <= b or b + c <= a:\n        return -1\n\n    # Calculate the semi-perimeter\n    s = (a + b + c) / 2\n\n    # Calculate the area using Heron's formula\n    area = math.sqrt(s * (s - a) * (s - b) * (s - c))\n\n    # Round to 2 decimal places\n    return round(area, 2)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/70": [{"task_id": "HumanEval/70", "solution": "def strange_sort_list(lst):\n    '''\n    Given list of integers, return list in strange order.\n    Strange sorting, is when you start with the minimum value,\n    then maximum of the remaining integers, then minimum and so on.\n\n    Examples:\n    strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\n    strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\n    strange_sort_list([]) == []\n    '''\n    if not lst:\n        return []\n\n    sorted_lst = sorted(lst)\n    result = []\n    left = 0\n    right = len(sorted_lst) - 1\n    toggle = True  # True for min, False for max\n\n    while left <= right:\n        if toggle:\n            result.append(sorted_lst[left])\n            left += 1\n        else:\n            result.append(sorted_lst[right])\n            right -= 1\n        toggle = not toggle\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/69": [{"task_id": "HumanEval/69", "solution": "from collections import defaultdict\ndef search(lst):\n    '''\n    You are given a non-empty list of positive integers. Return the greatest integer that is greater than\n    zero, and has a frequency greater than or equal to the value of the integer itself.\n    The frequency of an integer is the number of times it appears in the list.\n    If no such a value exist, return -1.\n    Examples:\n        search([4, 1, 2, 2, 3, 1]) == 2\n        search([1, 2, 2, 3, 3, 3, 4, 4, 4]) == 3\n        search([5, 5, 4, 4, 4]) == -1\n    '''\n    frequency = defaultdict(int)\n    for num in lst:\n        frequency[num] += 1\n\n    candidates = []\n    for num in frequency:\n        if num > 0 and frequency[num] >= num:\n            candidates.append(num)\n\n    if not candidates:\n        return -1\n\n    return max(candidates)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/68": [{"task_id": "HumanEval/68", "solution": "def pluck(arr):\n    \"\"\"\n    Given an array representing a branch of a tree that has non-negative integer nodes\n    your task is to pluck one of the nodes and return it.\n    The plucked node should be the node with the smallest even value.\n    If multiple nodes with the same smallest even value are found return the node that has smallest index.\n\n    The plucked node should be returned in a list, [ smallest_value, its index ],\n    If there are no even values or the given array is empty, return [].\n\n    Example 1:\n        Input: [4,2,3]\n        Output: [2, 1]\n        Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n    Example 2:\n        Input: [1,2,3]\n        Output: [2, 1]\n        Explanation: 2 has the smallest even value, and 2 has the smallest index.\n\n    Example 3:\n        Input: []\n        Output: []\n\n    Example 4:\n        Input: [5, 0, 3, 0, 4, 2]\n        Output: [0, 1]\n        Explanation: 0 is the smallest value, but there are two zeros,\n                     so we will choose the first zero, which has the smallest index.\n\n    Constraints:\n        * 1 <= nodes.length <= 10000\n        * 0 <= node.value\n    \"\"\"\n    smallest_even = None\n    smallest_index = -1\n\n    for index, value in enumerate(arr):\n        if value % 2 == 0:  # Check if the value is even\n            if smallest_even is None or value < smallest_even:\n                smallest_even = value\n                smallest_index = index\n            elif value == smallest_even and index < smallest_index:\n                smallest_index = index\n\n    if smallest_even is not None:\n        return [smallest_even, smallest_index]\n    else:\n        return []", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/73": [{"task_id": "HumanEval/73", "solution": "def smallest_change(arr):\n    \"\"\"\n    Given an array arr of integers, find the minimum number of elements that\n    need to be changed to make the array palindromic. A palindromic array is an array that\n    is read the same backwards and forwards. In one change, you can change one element to any other element.\n\n    For example:\n    smallest_change([1,2,3,5,4,7,9,6]) == 4\n    smallest_change([1, 2, 3, 4, 3, 2, 2]) == 1\n    smallest_change([1, 2, 3, 2, 1]) == 0\n    \"\"\"\n    n = len(arr)\n    changes = 0\n\n    for i in range(n // 2):\n        if arr[i] != arr[n - 1 - i]:\n            changes += 1\n\n    return changes", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/75": [{"task_id": "HumanEval/75", "solution": "def is_multiply_prime(a):\n    \"\"\"Return True if the given number is the multiplication of 3 prime numbers, False otherwise.\"\"\"\n    if a < 2:\n        return False\n\n    # Find all prime factors of a\n    factors = []\n    temp = a\n    # Check for factor 2\n    if temp % 2 == 0:\n        factors.append(2)\n        temp = temp // 2\n        while temp % 2 == 0:\n            factors.append(2)\n            temp = temp // 2\n\n    # Check for odd factors\n    i = 3\n    while i * i <= temp:\n        if temp % i == 0:\n            factors.append(i)\n            temp = temp // i\n            while temp % i == 0:\n                factors.append(i)\n                temp = temp // i\n        i += 2\n\n    if temp > 1:\n        factors.append(temp)\n\n    # Count distinct prime factors\n    distinct_primes = set(factors)\n\n    # Check if there are exactly 3 distinct prime factors\n    # and the product of these primes equals a\n    if len(distinct_primes) == 3:\n        product = 1\n        for p in distinct_primes:\n            product *= p\n        return product == a\n    else:\n        return False", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[8]], "plus_fail_tests": [[99]]}], "HumanEval/74": [{"task_id": "HumanEval/74", "solution": "def total_match(lst1, lst2):\n    '''\n    Write a function that accepts two lists of strings and returns the list that has\n    total number of chars in the all strings of the list less than the other list.\n\n    if the two lists have the same number of chars, return the first list.\n\n    Examples\n    total_match([], []) \u279e []\n    total_match(['hi', 'admin'], ['hI', 'Hi']) \u279e ['hI', 'Hi']\n    total_match(['hi', 'admin'], ['hi', 'hi', 'admin', 'project']) \u279e ['hi', 'admin']\n    total_match(['hi', 'admin'], ['hI', 'hi', 'hi']) \u279e ['hI', 'hi', 'hi']\n    total_match(['4'], ['1', '2', '3', '4', '5']) \u279e ['4']\n    '''\n    total1 = sum(len(s) for s in lst1)\n    total2 = sum(len(s) for s in lst2)\n\n    if total1 < total2:\n        return lst1\n    else:\n        return lst2", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[["hi", "admin"], ["hI", "hi", "hii"]]], "plus_fail_tests": [[["happy", "birthday", "sarah"], ["happy", "birthday", "sally"]]]}], "HumanEval/79": [{"task_id": "HumanEval/79", "solution": "def decimal_to_binary(decimal):\n    \"\"\"Convert a decimal number to binary string with 'db' prefix and suffix.\n\n    Args:\n        decimal (int): The decimal number to convert.\n\n    Returns:\n        str: Binary string with 'db' at the beginning and end.\n    \"\"\"\n    if decimal < 0:\n        raise ValueError(\"Decimal number must be non-negative\")\n\n    # Handle the special case of 0\n    if decimal == 0:\n        return \"db0db\"\n\n    binary_digits = []\n    num = decimal\n\n    # Convert to binary by repeatedly dividing by 2\n    while num > 0:\n        binary_digits.append(str(num % 2))\n        num = num // 2\n\n    # The digits are collected in reverse order\n    binary_str = ''.join(reversed(binary_digits))\n\n    # Add the 'db' prefix and suffix\n    return f\"db{binary_str}db\"", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/77": [{"task_id": "HumanEval/77", "solution": "def iscube(a):\n    '''\n    Write a function that takes an integer a and returns True\n    if this integer is a cube of some integer number.\n    Note: you may assume the input is always valid.\n    Examples:\n    iscube(1) ==> True\n    iscube(2) ==> False\n    iscube(-1) ==> True\n    iscube(64) ==> True\n    iscube(0) ==> True\n    iscube(180) ==> False\n    '''\n    # Handle negative numbers by working with absolute value\n    abs_a = abs(a)\n    # Calculate the cube root and round to nearest integer\n    cube_root = round(abs_a ** (1/3))\n    # Check if cubing this integer gives back the original absolute value\n    return cube_root ** 3 == abs_a", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/76": [{"task_id": "HumanEval/76", "solution": "def is_simple_power(x, n):\n    \"\"\"Returns True if x is a simple power of n (n**k = x for some integer k >= 0), False otherwise.\"\"\"\n    if n == 1:\n        return x == 1  # 1**k is always 1 for any k\n\n    if x == 1:\n        return True  # n**0 = 1 for any n != 0\n\n    if x < 1:\n        return False  # negative numbers can't be powers of positive n\n\n    k = 0\n    power = 1\n    while power < x:\n        power *= n\n        k += 1\n        if power == x:\n            return True\n\n    return False", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[-2, -2]]}], "HumanEval/80": [{"task_id": "HumanEval/80", "solution": "def is_happy(s):\n    \"\"\"Check if a string is happy.\n\n    A string is happy if:\n    1. Its length is at least 3\n    2. Every 3 consecutive letters are distinct\n\n    Args:\n        s (str): The input string to check\n\n    Returns:\n        bool: True if the string is happy, False otherwise\n\n    Examples:\n        >>> is_happy('a')\n        False\n        >>> is_happy('aa')\n        False\n        >>> is_happy('abcd')\n        True\n        >>> is_happy('aabb')\n        False\n        >>> is_happy('adb')\n        True\n        >>> is_happy('xyy')\n        False\n    \"\"\"\n    if len(s) < 3:\n        return False\n\n    for i in range(len(s) - 2):\n        triplet = s[i:i+3]\n        if len(set(triplet)) != 3:\n            return False\n\n    return True", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/78": [{"task_id": "HumanEval/78", "solution": "def hex_key(num):\n    \"\"\"Counts the number of prime hexadecimal digits in a string.\n\n    Args:\n        num: A string representing a hexadecimal number (empty string allowed).\n\n    Returns:\n        int: The count of prime hexadecimal digits in the string.\n    \"\"\"\n    # Define the set of prime hexadecimal digits\n    prime_hex_digits = {'2', '3', '5', '7', 'B', 'D'}\n\n    # Count how many characters in the input are prime hex digits\n    count = 0\n    for char in num:\n        if char in prime_hex_digits:\n            count += 1\n\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/81": [{"task_id": "HumanEval/81", "solution": "def numerical_letter_grade(grades):\n    \"\"\"Convert a list of GPAs to letter grades based on the given grading scale.\"\"\"\n    letter_grades = []\n    for gpa in grades:\n        if gpa == 4.0:\n            letter_grades.append('A+')\n        elif gpa > 3.7:\n            letter_grades.append('A')\n        elif gpa > 3.3:\n            letter_grades.append('A-')\n        elif gpa > 3.0:\n            letter_grades.append('B+')\n        elif gpa > 2.7:\n            letter_grades.append('B')\n        elif gpa > 2.3:\n            letter_grades.append('B-')\n        elif gpa > 2.0:\n            letter_grades.append('C+')\n        elif gpa > 1.7:\n            letter_grades.append('C')\n        elif gpa > 1.3:\n            letter_grades.append('C-')\n        elif gpa > 1.0:\n            letter_grades.append('D+')\n        elif gpa > 0.7:\n            letter_grades.append('D')\n        elif gpa > 0.0:\n            letter_grades.append('D-')\n        else:\n            letter_grades.append('E')\n    return letter_grades", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/82": [{"task_id": "HumanEval/82", "solution": "def is_prime(n):\n    \"\"\"Helper function to check if a number is prime.\"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    for i in range(3, int(n**0.5) + 1, 2):\n        if n % i == 0:\n            return False\n    return True\ndef prime_length(string):\n    \"\"\"Returns True if the string length is a prime number, False otherwise.\"\"\"\n    return is_prime(len(string))", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/83": [{"task_id": "HumanEval/83", "solution": "def starts_one_ends(n):\n    \"\"\"\n    Given a positive integer n, return the count of the numbers of n-digit\n    positive integers that start or end with 1.\n    \"\"\"\n    if n < 1:\n        return 0\n\n    # Numbers that start with 1\n    start_with_1 = 10 ** (n - 1)\n\n    # Numbers that end with 1\n    end_with_1 = 10 ** (n - 1)\n\n    # Numbers that both start and end with 1 (to avoid double-counting)\n    both_start_end_1 = 10 ** (n - 2) if n > 1 else 1\n\n    # Using inclusion-exclusion principle\n    total = start_with_1 + end_with_1 - both_start_end_1\n    return total", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[2]], "plus_fail_tests": [[6]]}], "HumanEval/87": [{"task_id": "HumanEval/87", "solution": "def get_row(lst, x):\n    \"\"\"\n    You are given a 2 dimensional data, as a nested lists,\n    which is similar to matrix, however, unlike matrices,\n    each row may contain a different number of columns.\n    Given lst, and integer x, find integers x in the list,\n    and return list of tuples, [(x1, y1), (x2, y2) ...] such that\n    each tuple is a coordinate - (row, columns), starting with 0.\n    Sort coordinates initially by rows in ascending order.\n    Also, sort coordinates of the row by columns in descending order.\n\n    Examples:\n    get_row([\n      [1,2,3,4,5,6],\n      [1,2,3,4,1,6],\n      [1,2,3,4,5,1]\n    ], 1) == [(0, 0), (1, 4), (1, 0), (2, 5), (2, 0)]\n    get_row([], 1) == []\n    get_row([[], [1], [1, 2, 3]], 3) == [(2, 2)]\n    \"\"\"\n    result = []\n    for row_idx, row in enumerate(lst):\n        for col_idx, value in enumerate(row):\n            if value == x:\n                result.append((row_idx, col_idx))\n\n    # Sort by row in ascending order, then by column in descending order\n    result.sort(key=lambda coord: (coord[0], -coord[1]))\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/84": [{"task_id": "HumanEval/84", "solution": "def solve(N):\n    \"\"\"Given a positive integer N, return the total sum of its digits in binary.\n\n    Example\n        For N = 1000, the sum of digits will be 1 the output should be \"1\".\n        For N = 150, the sum of digits will be 6 the output should be \"110\".\n        For N = 147, the sum of digits will be 12 the output should be \"1100\".\n\n    Variables:\n        @N integer\n             Constraints: 0 \u2264 N \u2264 10000.\n    Output:\n         a string of binary number\n    \"\"\"\n    # Calculate the sum of digits of N\n    digit_sum = sum(int(d) for d in str(N))\n\n    # Convert the sum to binary and remove the '0b' prefix\n    binary_str = bin(digit_sum)[2:]\n\n    return binary_str", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/85": [{"task_id": "HumanEval/85", "solution": "def add(lst):\n    \"\"\"Given a non-empty list of integers lst. add the even elements that are at odd indices.\n\n    Examples:\n        add([4, 2, 6, 7]) ==> 2\n    \"\"\"\n    total = 0\n    for i in range(1, len(lst), 2):  # Start at index 1 (odd index), step by 2\n        if lst[i] % 2 == 0:  # Check if the element is even\n            total += lst[i]\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/88": [{"task_id": "HumanEval/88", "solution": "def sort_array(array):\n    \"\"\"\n    Given an array of non-negative integers, return a copy of the given array after sorting,\n    you will sort the given array in ascending order if the sum( first index value, last index value) is odd,\n    or sort it in descending order if the sum( first index value, last index value) is even.\n\n    Note:\n    * don't change the given array.\n\n    Examples:\n    * sort_array([]) => []\n    * sort_array([5]) => [5]\n    * sort_array([2, 4, 3, 0, 1, 5]) => [0, 1, 2, 3, 4, 5]\n    * sort_array([2, 4, 3, 0, 1, 5, 6]) => [6, 5, 4, 3, 2, 1, 0]\n    \"\"\"\n    if not array:\n        return []\n\n    first = array[0]\n    last = array[-1]\n    sum_first_last = first + last\n\n    # Create a copy of the array to avoid modifying the original\n    sorted_array = array.copy()\n\n    if sum_first_last % 2 == 1:  # Odd sum\n        sorted_array.sort()\n    else:  # Even sum\n        sorted_array.sort(reverse=True)\n\n    return sorted_array", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/86": [{"task_id": "HumanEval/86", "solution": "def anti_shuffle(s):\n    \"\"\"\n    Write a function that takes a string and returns an ordered version of it.\n    Ordered version of string, is a string where all words (separated by space)\n    are replaced by a new word where all the characters arranged in\n    ascending order based on ascii value.\n    Note: You should keep the order of words and blank spaces in the sentence.\n\n    For example:\n    anti_shuffle('Hi') returns 'Hi'\n    anti_shuffle('hello') returns 'ehllo'\n    anti_shuffle('Hello World!!!') returns 'Hello !!!Wdlor'\n    \"\"\"\n    words = s.split(' ')\n    ordered_words = []\n    for word in words:\n        if word == '':\n            ordered_words.append('')\n            continue\n        # Sort the characters in the word based on ASCII value\n        sorted_word = ''.join(sorted(word))\n        ordered_words.append(sorted_word)\n    # Join the ordered words with spaces\n    return ' '.join(ordered_words)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/89": [{"task_id": "HumanEval/89", "solution": "def encrypt(s):\n    \"\"\"Create a function encrypt that takes a string as an argument and\n    returns a string encrypted with the alphabet being rotated.\n    The alphabet should be rotated in a manner such that the letters\n    shift down by two multiplied to two places.\n    For example:\n    encrypt('hi') returns 'lm'\n    encrypt('asdfghjkl') returns 'ewhjklnop'\n    encrypt('gf') returns 'kj'\n    encrypt('et') returns 'ix'\n    \"\"\"\n    result = []\n    for char in s:\n        if char.isalpha():\n            # Determine the case of the character\n            case = 'lower' if char.islower() else 'upper'\n            # Get the base alphabet\n            alphabet = 'abcdefghijklmnopqrstuvwxyz'\n            # Calculate the new position (shift by 4, since 2*2=4)\n            original_pos = alphabet.index(char.lower())\n            new_pos = (original_pos + 4) % 26\n            # Get the new character and preserve the case\n            new_char = alphabet[new_pos]\n            if case == 'upper':\n                new_char = new_char.upper()\n            result.append(new_char)\n        else:\n            # Leave non-alphabetic characters unchanged\n            result.append(char)\n    return ''.join(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/90": [{"task_id": "HumanEval/90", "solution": "def next_smallest(lst):\n    \"\"\"\n    You are given a list of integers.\n    Write a function next_smallest() that returns the 2nd smallest element of the list.\n    Return None if there is no such element.\n\n    next_smallest([1, 2, 3, 4, 5]) == 2\n    next_smallest([5, 1, 4, 3, 2]) == 2\n    next_smallest([]) == None\n    next_smallest([1, 1]) == None\n    \"\"\"\n    if len(lst) < 2:\n        return None\n\n    # Remove duplicates and sort the list\n    unique_sorted = sorted(set(lst))\n\n    if len(unique_sorted) < 2:\n        return None\n\n    return unique_sorted[1]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/91": [{"task_id": "HumanEval/91", "solution": "import re\ndef is_bored(S):\n    \"\"\"\n    Counts the number of sentences starting with \"I\" in a given string.\n    Sentences are delimited by '.', '?' or '!'.\n\n    Args:\n        S (str): Input string containing sentences\n\n    Returns:\n        int: Number of sentences starting with \"I\"\n\n    Examples:\n        >>> is_bored(\"Hello world\")\n        0\n        >>> is_bored(\"The sky is blue. The sun is shining. I love this weather\")\n        1\n    \"\"\"\n    # Split the string into sentences using punctuation marks\n    sentences = re.split(r'(?<=[.!?])\\s+', S.strip())\n\n    count = 0\n    for sentence in sentences:\n        if not sentence:  # Skip empty strings from splitting\n            continue\n        # Check if sentence starts with \"I\" (case-sensitive)\n        if sentence.startswith(\"I \"):\n            count += 1\n        # Also check for cases where \"I\" is at the start of the sentence\n        # but might have different spacing (like \"I,...\" or \"I!\")\n        elif re.match(r'^I[,.!?]', sentence):\n            count += 1\n\n    return count", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["er.I saw her on the street. I smiled at her. She smiled back. I wanted to talk to her but I was too shy. She walked away. I was sad. She turned around and came back to me. We talked for hours. We went to get some food. We laughed and had a great time. We exchanged numbers. I hope I see her again soon!"]]}], "HumanEval/95": [{"task_id": "HumanEval/95", "solution": "def check_dict_case(dict):\n    \"\"\"\n    Given a dictionary, return True if all keys are strings in lower\n    case or all keys are strings in upper case, else return False.\n    The function should return False is the given dictionary is empty.\n    Examples:\n    check_dict_case({\"a\":\"apple\", \"b\":\"banana\"}) should return True.\n    check_dict_case({\"a\":\"apple\", \"A\":\"banana\", \"B\":\"banana\"}) should return False.\n    check_dict_case({\"a\":\"apple\", 8:\"banana\", \"a\":\"apple\"}) should return False.\n    check_dict_case({\"Name\":\"John\", \"Age\":\"36\", \"City\":\"Houston\"}) should return False.\n    check_dict_case({\"STATE\":\"NC\", \"ZIP\":\"12345\" }) should return True.\n    \"\"\"\n    if not dict:  # Check if dictionary is empty\n        return False\n\n    # Check if all keys are strings\n    if not all(isinstance(key, str) for key in dict.keys()):\n        return False\n\n    # Check if all keys are lowercase or all are uppercase\n    all_lower = all(key.islower() for key in dict.keys())\n    all_upper = all(key.isupper() for key in dict.keys())\n\n    return all_lower or all_upper", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/97": [{"task_id": "HumanEval/97", "solution": "def multiply(a, b):\n    \"\"\"Complete the function that takes two integers and returns\n    the product of their unit digits.\n    Assume the input is always valid.\n    Examples:\n    multiply(148, 412) should return 16.\n    multiply(19, 28) should return 72.\n    multiply(2020, 1851) should return 0.\n    multiply(14,-15) should return 20.\n    \"\"\"\n    # Get the unit digits of both numbers\n    unit_a = abs(a) % 10\n    unit_b = abs(b) % 10\n\n    # Return the product of the unit digits\n    return unit_a * unit_b", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/92": [{"task_id": "HumanEval/92", "solution": "def any_int(x, y, z):\n    '''\n    Create a function that takes 3 numbers.\n    Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.\n    Returns false in any other cases.\n\n    Examples\n    any_int(5, 2, 7) \u279e True\n\n    any_int(3, 2, 2) \u279e False\n\n    any_int(3, -2, 1) \u279e True\n\n    any_int(3.6, -2.2, 2) \u279e False\n    '''\n    # Check if all numbers are integers\n    if not all(isinstance(num, int) for num in [x, y, z]):\n        return False\n\n    # Check if any number equals the sum of the other two\n    return (x == y + z) or (y == x + z) or (z == x + y)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/93": [{"task_id": "HumanEval/93", "solution": "def encode(message):\n    \"\"\"\n    Encodes a message by swapping the case of all letters and replacing vowels\n    with the letter that appears 2 places ahead in the English alphabet.\n\n    Args:\n        message (str): The input message to encode.\n\n    Returns:\n        str: The encoded message.\n\n    Examples:\n        >>> encode('test')\n        'TGST'\n        >>> encode('This is a message')\n        'tHKS KS C MGSSCGG'\n    \"\"\"\n    vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}\n    encoded_chars = []\n\n    for char in message:\n        if char.isalpha():\n            # Swap the case\n            swapped_case = char.swapcase()\n\n            # Check if the character is a vowel\n            if swapped_case.lower() in {'a', 'e', 'i', 'o', 'u'}:\n                # Find the position in the alphabet (0-based)\n                pos = ord(swapped_case.lower()) - ord('a')\n                # Calculate new position (2 places ahead)\n                new_pos = (pos + 2) % 26\n                # Get the new character\n                new_char = chr(ord('a') + new_pos)\n                # Preserve the case\n                if swapped_case.isupper():\n                    new_char = new_char.upper()\n                encoded_chars.append(new_char)\n            else:\n                encoded_chars.append(swapped_case)\n        else:\n            encoded_chars.append(char)\n\n    return ''.join(encoded_chars)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/99": [{"task_id": "HumanEval/99", "solution": "def closest_integer(value):\n    '''\n    Create a function that takes a value (string) representing a number\n    and returns the closest integer to it. If the number is equidistant\n    from two integers, round it away from zero.\n\n    Examples\n    >>> closest_integer(\"10\")\n    10\n    >>> closest_integer(\"15.3\")\n    15\n\n    Note:\n    Rounding away from zero means that if the given number is equidistant\n    from two integers, the one you should return is the one that is the\n    farthest from zero. For example closest_integer(\"14.5\") should\n    return 15 and closest_integer(\"-14.5\") should return -15.\n    '''\n    num = float(value)\n    integer_part = int(num)\n    fractional_part = num - integer_part\n\n    if fractional_part == 0.5:\n        # Equidistant case - round away from zero\n        if num > 0:\n            return integer_part + 1\n        else:\n            return integer_part - 1\n    elif fractional_part > 0.5:\n        return integer_part + 1\n    else:\n        return integer_part", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["-15.5"]], "plus_fail_tests": [["-2.8"]]}], "HumanEval/98": [{"task_id": "HumanEval/98", "solution": "def count_upper(s):\n    \"\"\"\n    Given a string s, count the number of uppercase vowels in even indices.\n\n    For example:\n    count_upper('aBCdEf') returns 1\n    count_upper('abcdefg') returns 0\n    count_upper('dBBE') returns 0\n    \"\"\"\n    uppercase_vowels = {'A', 'E', 'I', 'O', 'U'}\n    count = 0\n\n    for i in range(0, len(s), 2):  # Step through even indices\n        char = s[i]\n        if char in uppercase_vowels:\n            count += 1\n\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/94": [{"task_id": "HumanEval/94", "solution": "def is_prime(n):\n    \"\"\"Check if a number is prime.\"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    for i in range(3, int(n**0.5) + 1, 2):\n        if n % i == 0:\n            return False\n    return True\ndef sum_of_digits(n):\n    \"\"\"Calculate the sum of digits of a number.\"\"\"\n    return sum(int(d) for d in str(abs(n)))\ndef skjkasdkd(lst):\n    \"\"\"Find the largest prime in the list and return the sum of its digits.\"\"\"\n    primes = [num for num in lst if is_prime(num)]\n    if not primes:\n        return 0\n    largest_prime = max(primes)\n    return sum_of_digits(largest_prime)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/102": [{"task_id": "HumanEval/102", "solution": "def choose_num(x, y):\n    \"\"\"This function takes two positive numbers x and y and returns the\n    biggest even integer number that is in the range [x, y] inclusive. If\n    there's no such number, then the function should return -1.\n\n    For example:\n    choose_num(12, 15) = 14\n    choose_num(13, 12) = -1\n    \"\"\"\n    # Determine the start and end of the range\n    start = min(x, y)\n    end = max(x, y)\n\n    # Find the largest even number in the range\n    largest_even = -1\n    for num in range(end, start - 1, -1):\n        if num % 2 == 0:\n            largest_even = num\n            break\n\n    return largest_even", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[13, 12]], "plus_fail_tests": [[100, 6]]}], "HumanEval/101": [{"task_id": "HumanEval/101", "solution": "import re\ndef words_string(s):\n    \"\"\"\n    Splits a string of words separated by commas or spaces into an array of words.\n\n    Args:\n        s (str): Input string containing words separated by commas or spaces\n\n    Returns:\n        list: Array of words with punctuation removed\n\n    Examples:\n        >>> words_string(\"Hi, my name is John\")\n        ['Hi', 'my', 'name', 'is', 'John']\n        >>> words_string(\"One, two, three, four, five, six\")\n        ['One', 'two', 'three', 'four', 'five', 'six']\n    \"\"\"\n    # Split on commas or spaces, then filter out empty strings and strip punctuation\n    words = re.split(r'[,\\s]+', s)\n    # Remove any empty strings that might result from splitting\n    words = [word for word in words if word]\n    # Remove any trailing punctuation from each word\n    words = [re.sub(r'[^\\w\\s]', '', word) for word in words]\n    return words", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["Hi, my    name   is John. How     are    you?   "]]}], "HumanEval/103": [{"task_id": "HumanEval/103", "solution": "def rounded_avg(n, m):\n    \"\"\"You are given two positive integers n and m, and your task is to compute the\n    average of the integers from n through m (including n and m).\n    Round the answer to the nearest integer and convert that to binary.\n    If n is greater than m, return -1.\n    Example:\n    rounded_avg(1, 5) => \"0b11\"\n    rounded_avg(7, 5) => -1\n    rounded_avg(10, 20) => \"0b1111\"\n    rounded_avg(20, 33) => \"0b11010\"\n    \"\"\"\n    if n > m:\n        return -1\n\n    # Calculate the average of numbers from n to m inclusive\n    count = m - n + 1\n    total = (n + m) * count // 2  # Using the formula for sum of consecutive integers\n    average = total / count\n\n    # Round to nearest integer\n    rounded = round(average)\n\n    # Convert to binary string\n    return bin(rounded)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/105": [{"task_id": "HumanEval/105", "solution": "def by_length(arr):\n    \"\"\"\n    Given an array of integers, sort the integers that are between 1 and 9 inclusive,\n    reverse the resulting array, and then replace each digit by its corresponding name from\n    \"One\", \"Two\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\".\n\n    For example:\n      arr = [2, 1, 1, 4, 5, 8, 2, 3]\n            -> sort arr -> [1, 1, 2, 2, 3, 4, 5, 8]\n            -> reverse arr -> [8, 5, 4, 3, 2, 2, 1, 1]\n      return [\"Eight\", \"Five\", \"Four\", \"Three\", \"Two\", \"Two\", \"One\", \"One\"]\n\n      If the array is empty, return an empty array:\n      arr = []\n      return []\n\n      If the array has any strange number ignore it:\n      arr = [1, -1 , 55]\n            -> sort arr -> [-1, 1, 55]\n            -> reverse arr -> [55, 1, -1]\n      return = ['One']\n    \"\"\"\n    # Filter numbers between 1 and 9 inclusive\n    filtered = [x for x in arr if 1 <= x <= 9]\n\n    # Sort the filtered numbers\n    sorted_numbers = sorted(filtered)\n\n    # Reverse the sorted array\n    reversed_numbers = sorted_numbers[::-1]\n\n    # Map numbers to their corresponding names\n    number_to_name = {\n        1: \"One\",\n        2: \"Two\",\n        3: \"Three\",\n        4: \"Four\",\n        5: \"Five\",\n        6: \"Six\",\n        7: \"Seven\",\n        8: \"Eight\",\n        9: \"Nine\"\n    }\n\n    # Convert numbers to names\n    result = [number_to_name[num] for num in reversed_numbers]\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/100": [{"task_id": "HumanEval/100", "solution": "def make_a_pile(n):\n    \"\"\"\n    Given a positive integer n, you have to make a pile of n levels of stones.\n    The first level has n stones.\n    The number of stones in the next level is:\n        - the next odd number if n is odd.\n        - the next even number if n is even.\n    Return the number of stones in each level in a list, where element at index\n    i represents the number of stones in the level (i+1).\n\n    Examples:\n    >>> make_a_pile(3)\n    [3, 5, 7]\n    \"\"\"\n    pile = []\n    current = n\n    for _ in range(n):\n        pile.append(current)\n        if current % 2 == 1:  # odd\n            current += 2\n        else:  # even\n            current += 2\n    return pile", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/104": [{"task_id": "HumanEval/104", "solution": "def unique_digits(x):\n    \"\"\"Given a list of positive integers x. return a sorted list of all\n    elements that hasn't any even digit.\n\n    Note: Returned list should be sorted in increasing order.\n\n    For example:\n    >>> unique_digits([15, 33, 1422, 1])\n    [1, 15, 33]\n    >>> unique_digits([152, 323, 1422, 10])\n    []\n    \"\"\"\n    result = []\n    for num in x:\n        all_odd = True\n        for digit in str(num):\n            if int(digit) % 2 == 0:\n                all_odd = False\n                break\n        if all_odd:\n            result.append(num)\n    return sorted(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/106": [{"task_id": "HumanEval/106", "solution": "def f(n):\n    \"\"\" Implement the function f that takes n as a parameter,\n    and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even\n    or the sum of numbers from 1 to i otherwise.\n    i starts from 1.\n    the factorial of i is the multiplication of the numbers from 1 to i (1 * 2 * ... * i).\n    Example:\n    f(5) == [1, 2, 6, 24, 15]\n    \"\"\"\n    result = []\n    for i in range(1, n + 1):\n        if i % 2 == 0:\n            # Calculate factorial for even i\n            factorial = 1\n            for j in range(1, i + 1):\n                factorial *= j\n            result.append(factorial)\n        else:\n            # Calculate sum from 1 to i for odd i\n            sum_val = sum(range(1, i + 1))\n            result.append(sum_val)\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/108": [{"task_id": "HumanEval/108", "solution": "def count_nums(arr):\n    \"\"\"\n    Write a function count_nums which takes an array of integers and returns\n    the number of elements which has a sum of digits > 0.\n    If a number is negative, then its first signed digit will be negative:\n    e.g. -123 has signed digits -1, 2, and 3.\n    >>> count_nums([]) == 0\n    >>> count_nums([-1, 11, -11]) == 1\n    >>> count_nums([1, 1, 2]) == 3\n    \"\"\"\n    count = 0\n    for num in arr:\n        if num == 0:\n            continue  # sum of digits is 0, skip\n        digits = []\n        n = abs(num)\n        while n > 0:\n            digits.append(n % 10)\n            n = n // 10\n        if num < 0:\n            digits[0] = -digits[0]  # make first digit negative\n        digit_sum = sum(digits)\n        if digit_sum > 0:\n            count += 1\n    return count", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[12, 23, 34, -45, -56, 0]]], "plus_fail_tests": [[[0, -1, -20, 30]]]}], "HumanEval/109": [{"task_id": "HumanEval/109", "solution": "def move_one_ball(arr):\n    \"\"\"Determine if the array can be sorted in non-decreasing order by performing right shifts.\"\"\"\n    if not arr:\n        return True\n\n    n = len(arr)\n    sorted_arr = sorted(arr)\n\n    # Check all possible right shifts\n    for i in range(n):\n        # Check if the current rotation matches the sorted array\n        match = True\n        for j in range(n):\n            if arr[(i + j) % n] != sorted_arr[j]:\n                match = False\n                break\n        if match:\n            return True\n\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/107": [{"task_id": "HumanEval/107", "solution": "def is_palindrome(num):\n    \"\"\"Check if a number is a palindrome.\"\"\"\n    s = str(num)\n    return s == s[::-1]\ndef even_odd_palindrome(n):\n    \"\"\"\n    Given a positive integer n, return a tuple that has the number of even and odd\n    integer palindromes that fall within the range(1, n), inclusive.\n\n    Example 1:\n        Input: 3\n        Output: (1, 2)\n        Explanation:\n        Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.\n\n    Example 2:\n        Input: 12\n        Output: (4, 6)\n        Explanation:\n        Integer palindrome are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11. four of them are even, and 6 of them are odd.\n\n    Note:\n        1. 1 <= n <= 10^3\n        2. returned tuple has the number of even and odd integer palindromes respectively.\n    \"\"\"\n    even_count = 0\n    odd_count = 0\n\n    for num in range(1, n + 1):\n        if is_palindrome(num):\n            if num % 2 == 0:\n                even_count += 1\n            else:\n                odd_count += 1\n\n    return (even_count, odd_count)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/111": [{"task_id": "HumanEval/111", "solution": "def histogram(test):\n    \"\"\"Given a string representing a space separated lowercase letters, return a dictionary\n    of the letter with the most repetition and containing the corresponding count.\n    If several letters have the same occurrence, return all of them.\n\n    Example:\n    histogram('a b c') == {'a': 1, 'b': 1, 'c': 1}\n    histogram('a b b a') == {'a': 2, 'b': 2}\n    histogram('a b c a b') == {'a': 2, 'b': 2}\n    histogram('b b b b a') == {'b': 4}\n    histogram('') == {}\n\n    \"\"\"\n    if not test.strip():\n        return {}\n\n    letters = test.split()\n    count = {}\n\n    for letter in letters:\n        count[letter] = count.get(letter, 0) + 1\n\n    if not count:\n        return {}\n\n    max_count = max(count.values())\n    result = {letter: cnt for letter, cnt in count.items() if cnt == max_count}\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/112": [{"task_id": "HumanEval/112", "solution": "def reverse_delete(s, c):\n    \"\"\"Task\n    We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c\n    then check if the result string is palindrome.\n    A string is called palindrome if it reads the same backward as forward.\n    You should return a tuple containing the result string and True/False for the check.\n    Example\n    For s = \"abcde\", c = \"ae\", the result should be ('bcd',False)\n    For s = \"abcdef\", c = \"b\"  the result should be ('acdef',False)\n    For s = \"abcdedcba\", c = \"ab\", the result should be ('cdedc',True)\n    \"\"\"\n    # Create a set of characters to delete for O(1) lookups\n    delete_chars = set(c)\n    # Filter out characters that are in c\n    result = ''.join(char for char in s if char not in delete_chars)\n    # Check if the result is a palindrome\n    is_palindrome = result == result[::-1]\n    return (result, is_palindrome)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/110": [{"task_id": "HumanEval/110", "solution": "def exchange(lst1, lst2):\n    \"\"\"In this problem, you will implement a function that takes two lists of numbers,\n    and determines whether it is possible to perform an exchange of elements\n    between them to make lst1 a list of only even numbers.\n    There is no limit on the number of exchanged elements between lst1 and lst2.\n    If it is possible to exchange elements between the lst1 and lst2 to make\n    all the elements of lst1 to be even, return \"YES\".\n    Otherwise, return \"NO\".\n    For example:\n    exchange([1, 2, 3, 4], [1, 2, 3, 4]) => \"YES\"\n    exchange([1, 2, 3, 4], [1, 5, 3, 4]) => \"NO\"\n    It is assumed that the input lists will be non-empty.\n    \"\"\"\n    # Count the number of odd numbers in lst1 and even numbers in lst2\n    odd_in_lst1 = sum(1 for num in lst1 if num % 2 != 0)\n    even_in_lst2 = sum(1 for num in lst2 if num % 2 == 0)\n\n    # We need at least as many even numbers in lst2 as there are odd numbers in lst1\n    return \"YES\" if even_in_lst2 >= odd_in_lst1 else \"NO\"", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/113": [{"task_id": "HumanEval/113", "solution": "def odd_count(lst):\n    \"\"\"Given a list of strings, where each string consists of only digits, return a list.\n    Each element i of the output should be \"the number of odd elements in the\n    string i of the input.\" where all the i's should be replaced by the number\n    of odd digits in the i'th string of the input.\n\n    >>> odd_count(['1234567'])\n    [\"the number of odd elements 4n the str4ng 4 of the 4nput.\"]\n    >>> odd_count(['3',\"11111111\"])\n    [\"the number of odd elements 1n the str1ng 1 of the 1nput.\",\n     \"the number of odd elements 8n the str8ng 8 of the 8nput.\"]\n    \"\"\"\n    result = []\n    for s in lst:\n        odd_count = sum(1 for char in s if int(char) % 2 != 0)\n        template = f\"the number of odd elements {odd_count}n the str{odd_count}ng {odd_count} of the {odd_count}nput.\"\n        result.append(template)\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/115": [{"task_id": "HumanEval/115", "solution": "import math\ndef max_fill(grid, capacity):\n    \"\"\"\n    You are given a rectangular grid of wells. Each row represents a single well,\n    and each 1 in a row represents a single unit of water.\n    Each well has a corresponding bucket that can be used to extract water from it,\n    and all buckets have the same capacity.\n    Your task is to use the buckets to empty the wells.\n    Output the number of times you need to lower the buckets.\n\n    Example 1:\n        Input:\n            grid : [[0,0,1,0], [0,1,0,0], [1,1,1,1]]\n            bucket_capacity : 1\n        Output: 6\n\n    Example 2:\n        Input:\n            grid : [[0,0,1,1], [0,0,0,0], [1,1,1,1], [0,1,1,1]]\n            bucket_capacity : 2\n        Output: 5\n\n    Example 3:\n        Input:\n            grid : [[0,0,0], [0,0,0]]\n            bucket_capacity : 5\n        Output: 0\n\n    Constraints:\n        * all wells have the same length\n        * 1 <= grid.length <= 10^2\n        * 1 <= grid[:,1].length <= 10^2\n        * grid[i][j] -> 0 | 1\n        * 1 <= capacity <= 10\n    \"\"\"\n    total_water = 0\n    for well in grid:\n        total_water += sum(well)\n\n    if total_water == 0:\n        return 0\n\n    return math.ceil(total_water / capacity)", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[[1, 1, 1, 1], [1, 1, 1, 1]], 9]], "plus_fail_tests": [[[[1, 0, 0, 1], [0, 1, 1, 1], [0, 0, 0, 0], [1, 0, 1, 1]], 2]]}], "HumanEval/116": [{"task_id": "HumanEval/116", "solution": "def sort_array(arr):\n    \"\"\"\n    Sorts an array of integers based on the number of ones in their binary representation.\n    For numbers with the same number of ones, sorts by their decimal value.\n\n    Args:\n        arr: List of integers (can be positive or negative)\n\n    Returns:\n        List of integers sorted according to the specified criteria\n\n    Examples:\n        >>> sort_array([1, 5, 2, 3, 4])\n        [1, 2, 3, 4, 5]\n        >>> sort_array([-2, -3, -4, -5, -6])\n        [-6, -5, -4, -3, -2]\n        >>> sort_array([1, 0, 2, 3, 4])\n        [0, 1, 2, 3, 4]\n    \"\"\"\n    def count_ones(n):\n        # Handle negative numbers by converting to their two's complement representation\n        if n < 0:\n            return bin(n & 0xFFFFFFFF).count('1')  # Using 32-bit mask for negative numbers\n        return bin(n).count('1')\n\n    # Sort by number of ones, then by value\n    return sorted(arr, key=lambda x: (count_ones(x), x))", "base_status": "fail", "plus_status": "pass", "base_fail_tests": [[[-2, -3, -4, -5, -6]]], "plus_fail_tests": []}], "HumanEval/114": [{"task_id": "HumanEval/114", "solution": "def minSubArraySum(nums):\n    \"\"\"\n    Given an array of integers nums, find the minimum sum of any non-empty sub-array\n    of nums.\n    Example:\n    minSubArraySum([2, 3, 4, 1, 2, 4]) == 1\n    minSubArraySum([-1, -2, -3]) == -6\n    \"\"\"\n    if not nums:\n        return 0  # or raise an error, depending on requirements\n\n    min_sum = current_sum = nums[0]\n\n    for num in nums[1:]:\n        current_sum = min(num, current_sum + num)\n        min_sum = min(min_sum, current_sum)\n\n    return min_sum", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/117": [{"task_id": "HumanEval/117", "solution": "def select_words(s, n):\n    \"\"\"Given a string s and a natural number n, returns a list of all words from string s that contain exactly n consonants, in order these words appear in the string s.\"\"\"\n    if not s.strip():\n        return []\n\n    vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}\n    words = s.split()\n    result = []\n\n    for word in words:\n        consonant_count = 0\n        for char in word:\n            if char.isalpha() and char not in vowels:\n                consonant_count += 1\n        if consonant_count == n:\n            result.append(word)\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/118": [{"task_id": "HumanEval/118", "solution": "def get_closest_vowel(word):\n    \"\"\"You are given a word. Your task is to find the closest vowel that stands between\n    two consonants from the right side of the word (case sensitive).\n\n    Vowels in the beginning and ending doesn't count. Return empty string if you didn't\n    find any vowel met the above condition.\n\n    You may assume that the given string contains English letter only.\n\n    Example:\n    get_closest_vowel(\"yogurt\") ==> \"u\"\n    get_closest_vowel(\"FULL\") ==> \"U\"\n    get_closest_vowel(\"quick\") ==> \"\"\n    get_closest_vowel(\"ab\") ==> \"\"\n    \"\"\"\n    vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}\n    consonants = set('bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ')\n\n    # Iterate from the end of the word towards the beginning\n    for i in range(len(word)-2, 0, -1):\n        current_char = word[i]\n        prev_char = word[i-1]\n        next_char = word[i+1]\n\n        # Check if current character is a vowel and surrounded by consonants\n        if (current_char in vowels and\n            prev_char in consonants and\n            next_char in consonants):\n            return current_char\n\n    return \"\"", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/119": [{"task_id": "HumanEval/119", "solution": "def match_parens(lst):\n    '''\n    You are given a list of two strings, both strings consist of open\n    parentheses '(' or close parentheses ')' only.\n    Your job is to check if it is possible to concatenate the two strings in\n    some order, that the resulting string will be good.\n    A string S is considered to be good if and only if all parentheses in S\n    are balanced. For example: the string '(())()' is good, while the string\n    '())' is not.\n    Return 'Yes' if there's a way to make a good string, and return 'No' otherwise.\n\n    Examples:\n    match_parens(['()(', ')']) == 'Yes'\n    match_parens([')', ')']) == 'No'\n    '''\n    def is_balanced(s):\n        balance = 0\n        for char in s:\n            if char == '(':\n                balance += 1\n            else:\n                balance -= 1\n            if balance < 0:\n                return False\n        return balance == 0\n\n    s1, s2 = lst\n    # Check both possible concatenations\n    if is_balanced(s1 + s2) or is_balanced(s2 + s1):\n        return 'Yes'\n    else:\n        return 'No'", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/120": [{"task_id": "HumanEval/120", "solution": "def maximum(arr, k):\n    \"\"\"\n    Given an array arr of integers and a positive integer k, return a sorted list\n    of length k with the maximum k numbers in arr.\n\n    Example 1:\n        Input: arr = [-3, -4, 5], k = 3\n        Output: [-4, -3, 5]\n\n    Example 2:\n        Input: arr = [4, -4, 4], k = 2\n        Output: [4, 4]\n\n    Example 3:\n        Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1\n        Output: [2]\n\n    Note:\n        1. The length of the array will be in the range of [1, 1000].\n        2. The elements in the array will be in the range of [-1000, 1000].\n        3. 0 <= k <= len(arr)\n    \"\"\"\n    if k == 0:\n        return []\n\n    # Sort the array in descending order\n    sorted_arr = sorted(arr, reverse=True)\n\n    # Take the first k elements and sort them in ascending order\n    result = sorted(sorted_arr[:k])\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/123": [{"task_id": "HumanEval/123", "solution": "def get_odd_collatz(n):\n    \"\"\"\n    Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.\n\n    The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined\n    as follows: start with any positive integer n. Then each term is obtained from the\n    previous term as follows: if the previous term is even, the next term is one half of\n    the previous term. If the previous term is odd, the next term is 3 times the previous\n    term plus 1. The conjecture is that no matter what value of n, the sequence will always reach 1.\n\n    Note:\n        1. Collatz(1) is [1].\n        2. returned list sorted in increasing order.\n\n    For example:\n    get_odd_collatz(5) returns [1, 5] # The collatz sequence for 5 is [5, 16, 8, 4, 2, 1], so the odd numbers are only 1, and 5.\n    \"\"\"\n    if n <= 0:\n        return []\n\n    sequence = []\n    current = n\n\n    while current != 1:\n        sequence.append(current)\n        if current % 2 == 0:\n            current = current // 2\n        else:\n            current = 3 * current + 1\n\n    sequence.append(1)  # Add the final 1 to the sequence\n\n    # Extract odd numbers and sort them\n    odd_numbers = [num for num in sequence if num % 2 != 0]\n    odd_numbers.sort()\n\n    return odd_numbers", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/121": [{"task_id": "HumanEval/121", "solution": "def solution(lst):\n    \"\"\"Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.\n\n    Examples\n    solution([5, 8, 7, 1]) ==> 12\n    solution([3, 3, 3, 3, 3]) ==> 9\n    solution([30, 13, 24, 321]) ==> 0\n    \"\"\"\n    total = 0\n    for i in range(1, len(lst), 2):  # Start at 1 (second element) and step by 2\n        if lst[i] % 2 != 0:  # Check if the element is odd\n            total += lst[i]\n    return total", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[5, 8, 7, 1]]], "plus_fail_tests": [[[1, 2, 3, 4, 5, 6]]]}], "HumanEval/122": [{"task_id": "HumanEval/122", "solution": "def add_elements(arr, k):\n    \"\"\"\n    Given a non-empty array of integers arr and an integer k, return\n    the sum of the elements with at most two digits from the first k elements of arr.\n\n    Example:\n\n        Input: arr = [111,21,3,4000,5,6,7,8,9], k = 4\n        Output: 24 # sum of 21 + 3\n\n    Constraints:\n        1. 1 <= len(arr) <= 100\n        2. 1 <= k <= len(arr)\n    \"\"\"\n    total = 0\n    for num in arr[:k]:\n        if num < 100:  # Check if the number has at most two digits\n            total += num\n    return total", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[[-100, -89, -77, -55, 900, -44, -22, -11], 7]]}], "HumanEval/125": [{"task_id": "HumanEval/125", "solution": "def split_words(txt):\n    '''\n    Given a string of words, return a list of words split on whitespace, if no whitespaces exists in the text you\n    should split on commas ',' if no commas exists you should return the number of lower-case letters with odd order in the\n    alphabet, ord('a') = 0, ord('b') = 1, ... ord('z') = 25\n    Examples\n    split_words(\"Hello world!\") \u279e [\"Hello\", \"world!\"]\n    split_words(\"Hello,world!\") \u279e [\"Hello\", \"world!\"]\n    split_words(\"abcdef\") == 3\n    '''\n    # Check if there's any whitespace\n    if ' ' in txt:\n        return txt.split()\n    # Check if there's any comma\n    elif ',' in txt:\n        return [word for word in txt.split(',') if word]  # handles empty strings from split\n    # If neither whitespace nor comma exists, count odd-order lowercase letters\n    else:\n        count = 0\n        for char in txt:\n            if char.islower():\n                order = ord(char) - ord('a')\n                if order % 2 != 0:  # odd order\n                    count += 1\n        return count", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["as,words,,a"]]}], "HumanEval/126": [{"task_id": "HumanEval/126", "solution": "def is_sorted(lst):\n    '''\n    Given a list of numbers, return whether or not they are sorted\n    in ascending order. If list has more than 1 duplicate of the same\n    number, return False. Assume no negative numbers and only integers.\n\n    Examples\n    is_sorted([5]) \u279e True\n    is_sorted([1, 2, 3, 4, 5]) \u279e True\n    is_sorted([1, 3, 2, 4, 5]) \u279e False\n    is_sorted([1, 2, 3, 4, 5, 6]) \u279e True\n    is_sorted([1, 2, 3, 4, 5, 6, 7]) \u279e True\n    is_sorted([1, 3, 2, 4, 5, 6, 7]) \u279e False\n    is_sorted([1, 2, 2, 3, 3, 4]) \u279e True\n    is_sorted([1, 2, 2, 2, 3, 4]) \u279e False\n    '''\n    # Check for more than one duplicate\n    seen = set()\n    for num in lst:\n        if num in seen:\n            return False\n        seen.add(num)\n\n    # Check if sorted in ascending order\n    for i in range(len(lst) - 1):\n        if lst[i] > lst[i + 1]:\n            return False\n\n    return True", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[1, 2, 2, 3, 3, 4]]], "plus_fail_tests": [[[1, 1, 2, 2, 3, 3, 4]]]}], "HumanEval/124": [{"task_id": "HumanEval/124", "solution": "import re\ndef valid_date(date):\n    \"\"\"Validates a given date string and returns True if the date is valid otherwise False.\"\"\"\n    # Check if the date string is empty\n    if not date:\n        return False\n\n    # Check the format using regex (mm-dd-yyyy)\n    if not re.fullmatch(r'\\d{2}-\\d{2}-\\d{4}', date):\n        return False\n\n    try:\n        month, day, year = map(int, date.split('-'))\n    except ValueError:\n        return False\n\n    # Check month validity (1-12)\n    if month < 1 or month > 12:\n        return False\n\n    # Check day validity based on month\n    if month in {1, 3, 5, 7, 8, 10, 12}:\n        if day < 1 or day > 31:\n            return False\n    elif month in {4, 6, 9, 11}:\n        if day < 1 or day > 30:\n            return False\n    elif month == 2:\n        if day < 1 or day > 29:  # Note: We're not checking for leap years as per the problem statement\n            return False\n\n    return True", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/127": [{"task_id": "HumanEval/127", "solution": "def is_prime(n):\n    \"\"\"Check if a number is prime.\"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    for i in range(3, int(n**0.5) + 1, 2):\n        if n % i == 0:\n            return False\n    return True\ndef intersection(interval1, interval2):\n    \"\"\"Determine if the intersection of two intervals has a prime length.\"\"\"\n    start1, end1 = interval1\n    start2, end2 = interval2\n\n    # Calculate the intersection\n    intersection_start = max(start1, start2)\n    intersection_end = min(end1, end2)\n\n    # Check if there is an intersection\n    if intersection_start > intersection_end:\n        return \"NO\"\n\n    # Calculate the length of the intersection\n    length = intersection_end - intersection_start + 1\n\n    # Check if the length is a prime number\n    if is_prime(length):\n        return \"YES\"\n    else:\n        return \"NO\"", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[-1, 1], [0, 4]]], "plus_fail_tests": [[[10, 20], [15, 25]]]}], "HumanEval/129": [{"task_id": "HumanEval/129", "solution": "import heapq\ndef minPath(grid, k):\n    \"\"\"\n    Given a grid with N rows and N columns (N >= 2) and a positive integer k,\n    each cell of the grid contains a value. Every integer in the range [1, N * N]\n    inclusive appears exactly once on the cells of the grid.\n\n    You have to find the minimum path of length k in the grid. You can start\n    from any cell, and in each step you can move to any of the neighbor cells,\n    in other words, you can go to cells which share an edge with you current\n    cell.\n    Please note that a path of length k means visiting exactly k cells (not\n    necessarily distinct).\n    You CANNOT go off the grid.\n    A path A (of length k) is considered less than a path B (of length k) if\n    after making the ordered lists of the values on the cells that A and B go\n    through (let's call them lst_A and lst_B), lst_A is lexicographically less\n    than lst_B, in other words, there exist an integer index i (1 <= i <= k)\n    such that lst_A[i] < lst_B[i] and for any j (1 <= j < i) we have\n    lst_A[j] = lst_B[j].\n    It is guaranteed that the answer is unique.\n    Return an ordered list of the values on the cells that the minimum path go through.\n    \"\"\"\n    N = len(grid)\n    # Directions for moving to neighboring cells (up, down, left, right)\n    directions = [(-1, 0), (1, 0), (0, -1), (0, 1)]\n\n    # Priority queue: (current_path, current_value, row, col)\n    # We use a tuple (current_path, current_value, row, col) to represent the state\n    # The priority is determined by the current_path (lex order)\n    heap = []\n\n    # Initialize the heap with all possible starting positions\n    for i in range(N):\n        for j in range(N):\n            heapq.heappush(heap, ([grid[i][j]], grid[i][j], i, j))\n\n    # We'll explore paths in order of increasing lex order\n    while heap:\n        current_path, current_value, row, col = heapq.heappop(heap)\n        if len(current_path) == k:\n            return current_path\n        # Explore all neighboring cells\n        for dr, dc in directions:\n            nr, nc = row + dr, col + dc\n            if 0 <= nr < N and 0 <= nc < N:\n                new_value = grid[nr][nc]\n                new_path = current_path + [new_value]\n                # Push the new path into the heap\n                heapq.heappush(heap, (new_path, new_value, nr, nc))\n\n    # This line should theoretically never be reached since k >= 1 and grid is non-empty\n    return []", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/128": [{"task_id": "HumanEval/128", "solution": "def prod_signs(arr):\n    \"\"\"\n    You are given an array arr of integers and you need to return\n    sum of magnitudes of integers multiplied by product of all signs\n    of each number in the array, represented by 1, -1 or 0.\n    Note: return None for empty arr.\n\n    Example:\n    >>> prod_signs([1, 2, 2, -4]) == -9\n    >>> prod_signs([0, 1]) == 0\n    >>> prod_signs([]) == None\n    \"\"\"\n    if not arr:\n        return None\n\n    sum_magnitudes = sum(abs(num) for num in arr)\n    product_signs = 1\n\n    for num in arr:\n        if num == 0:\n            product_signs = 0\n            break\n        elif num < 0:\n            product_signs *= -1\n\n    return sum_magnitudes * product_signs", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/132": [{"task_id": "HumanEval/132", "solution": "def is_nested(string):\n    '''\n    Create a function that takes a string as input which contains only square brackets.\n    The function should return True if and only if there is a valid subsequence of brackets\n    where at least one bracket in the subsequence is nested.\n\n    is_nested('[[]]') \u279e True\n    is_nested('[]]]]]]][[[[[]') \u279e False\n    is_nested('[][]') \u279e False\n    is_nested('[]') \u279e False\n    is_nested('[[][]]') \u279e True\n    is_nested('[[]][[') \u279e True\n    '''\n    stack = []\n    for char in string:\n        if char == '[':\n            stack.append(char)\n        else:\n            if stack:\n                stack.pop()\n            else:\n                # If we encounter a ']' with no matching '[', it's invalid\n                return False\n\n    # If the stack is empty, all brackets are properly matched\n    # Now check if there's any nesting\n    if len(stack) == 0:\n        # We need to check if there's any nesting in the original string\n        # A nested structure would have at least one '[' that comes after another '['\n        # and before its corresponding ']'\n        # We can do this by tracking the positions of '[' and ']'\n        open_positions = []\n        close_positions = []\n        for i, char in enumerate(string):\n            if char == '[':\n                open_positions.append(i)\n            else:\n                close_positions.append(i)\n\n        # For nesting to exist, there must be at least one '[' that comes after another '['\n        # and before its corresponding ']'\n        # This means there should be at least one pair where the first '[' is not the last one\n        # and its corresponding ']' is not the first one\n        for i in range(len(open_positions)):\n            for j in range(i+1, len(open_positions)):\n                # Check if the j-th '[' is inside the i-th '[' and its corresponding ']'\n                # The j-th '[' must be after the i-th '[' and before the i-th ']' (which is close_positions[i])\n                if open_positions[j] < close_positions[i]:\n                    return True\n        return False\n    else:\n        # If the stack is not empty, there are unmatched '[', so no valid nesting\n        return False", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["[[]][["]], "plus_fail_tests": [["[[]]]"]]}], "HumanEval/131": [{"task_id": "HumanEval/131", "solution": "def digits(n):\n    \"\"\"Given a positive integer n, return the product of the odd digits.\n    Return 0 if all digits are even.\n    For example:\n    digits(1)  == 1\n    digits(4)  == 0\n    digits(235) == 15\n    \"\"\"\n    product = 1\n    has_odd = False\n\n    for digit in str(n):\n        d = int(digit)\n        if d % 2 != 0:\n            has_odd = True\n            product *= d\n\n    return product if has_odd else 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/133": [{"task_id": "HumanEval/133", "solution": "import math\ndef sum_squares(lst):\n    \"\"\"You are given a list of numbers.\n    You need to return the sum of squared numbers in the given list,\n    round each element in the list to the upper int(Ceiling) first.\n    Examples:\n    For lst = [1,2,3] the output should be 14\n    For lst = [1,4,9] the output should be 98\n    For lst = [1,3,5,7] the output should be 84\n    For lst = [1.4,4.2,0] the output should be 29\n    For lst = [-2.4,1,1] the output should be 6\n    \"\"\"\n    total = 0\n    for num in lst:\n        # Round to upper int (ceiling)\n        rounded = math.ceil(num)\n        # Square the rounded number\n        squared = rounded ** 2\n        # Add to total\n        total += squared\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/130": [{"task_id": "HumanEval/130", "solution": "def tri(n):\n    \"\"\"Returns the first n+1 numbers of the Tribonacci sequence.\"\"\"\n    if n < 0:\n        return []\n\n    sequence = [1]  # tri(0) = 1 (implied by the examples)\n\n    for i in range(1, n + 1):\n        if i == 1:\n            sequence.append(3)  # tri(1) = 3\n        elif i % 2 == 0:\n            sequence.append(1 + i // 2)\n        else:\n            # For odd numbers, we need to look ahead to tri(n+1)\n            # Since we're building the sequence sequentially, we can't compute it directly\n            # So we'll handle this case by computing the required terms\n            if i + 1 <= n:\n                # We need tri(i+1) which is even, so we can compute it\n                next_term = 1 + (i + 1) // 2\n            else:\n                # If we're at the last odd term, we can't compute it yet\n                # So we'll skip this term and come back to it later\n                # This approach won't work for sequential computation\n                pass\n\n    # The above approach doesn't work for odd terms because we need future terms\n    # Let's try a different approach: compute all terms up to n+1 first\n\n    # Initialize a list to hold all terms up to n+1\n    all_terms = [0] * (n + 2)  # We'll compute up to n+1 to handle odd terms\n\n    # Base cases\n    all_terms[0] = 1  # tri(0) = 1\n    all_terms[1] = 3  # tri(1) = 3\n\n    # Compute even terms first\n    for i in range(2, n + 2):\n        if i % 2 == 0:\n            all_terms[i] = 1 + i // 2\n\n    # Now compute odd terms (except tri(1) which we already have)\n    for i in range(3, n + 2, 2):\n        all_terms[i] = all_terms[i - 1] + all_terms[i - 2] + all_terms[i + 1]\n\n    # The sequence we want is tri(0) to tri(n)\n    return all_terms[:n + 1]", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[4]], "plus_fail_tests": [[2]]}], "HumanEval/134": [{"task_id": "HumanEval/134", "solution": "def check_if_last_char_is_a_letter(txt):\n    '''\n    Create a function that returns True if the last character\n    of a given string is an alphabetical character and is not\n    a part of a word, and False otherwise.\n    Note: \"word\" is a group of characters separated by space.\n\n    Examples:\n    check_if_last_char_is_a_letter(\"apple pie\") \u279e False\n    check_if_last_char_is_a_letter(\"apple pi e\") \u279e True\n    check_if_last_char_is_a_letter(\"apple pi e \") \u279e False\n    check_if_last_char_is_a_letter(\"\") \u279e False\n    '''\n    if not txt:\n        return False\n\n    # Check if the last character is a letter\n    last_char = txt[-1]\n    if not last_char.isalpha():\n        return False\n\n    # Check if the last character is not part of a word\n    # (i.e., it's not preceded by a non-space character)\n    if len(txt) > 1 and txt[-2] != ' ':\n        return False\n\n    return True", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/135": [{"task_id": "HumanEval/135", "solution": "def can_arrange(arr):\n    \"\"\"Create a function which returns the largest index of an element which\n    is not greater than or equal to the element immediately preceding it. If\n    no such element exists then return -1. The given array will not contain\n    duplicate values.\n\n    Examples:\n    can_arrange([1,2,4,3,5]) = 3\n    can_arrange([1,2,3]) = -1\n    \"\"\"\n    max_index = -1\n    for i in range(1, len(arr)):\n        if arr[i] < arr[i-1]:\n            max_index = i\n    return max_index", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/136": [{"task_id": "HumanEval/136", "solution": "def largest_smallest_integers(lst):\n    '''\n    Create a function that returns a tuple (a, b), where 'a' is\n    the largest of negative integers, and 'b' is the smallest\n    of positive integers in a list.\n    If there is no negative or positive integers, return them as None.\n\n    Examples:\n    largest_smallest_integers([2, 4, 1, 3, 5, 7]) == (None, 1)\n    largest_smallest_integers([]) == (None, None)\n    largest_smallest_integers([0]) == (None, None)\n    '''\n    negatives = [x for x in lst if x < 0]\n    positives = [x for x in lst if x > 0]\n\n    a = max(negatives) if negatives else None\n    b = min(positives) if positives else None\n\n    return (a, b)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/137": [{"task_id": "HumanEval/137", "solution": "def compare_one(a, b):\n    \"\"\"\n    Create a function that takes integers, floats, or strings representing\n    real numbers, and returns the larger variable in its given variable type.\n    Return None if the values are equal.\n    Note: If a real number is represented as a string, the floating point might be . or ,\n\n    compare_one(1, 2.5) \u279e 2.5\n    compare_one(1, \"2,3\") \u279e \"2,3\"\n    compare_one(\"5,1\", \"6\") \u279e \"6\"\n    compare_one(\"1\", 1) \u279e None\n    \"\"\"\n    def parse_number(x):\n        if isinstance(x, (int, float)):\n            return x\n        # Handle string numbers with either . or , as decimal separator\n        x_str = str(x)\n        if ',' in x_str:\n            x_str = x_str.replace(',', '.')\n        try:\n            return float(x_str)\n        except ValueError:\n            return x  # return original if not a number\n\n    # Parse both inputs to numbers if possible\n    num_a = parse_number(a)\n    num_b = parse_number(b)\n\n    # If both are numbers, compare them\n    if isinstance(num_a, (int, float)) and isinstance(num_b, (int, float)):\n        if num_a > num_b:\n            return a\n        elif num_b > num_a:\n            return b\n        else:\n            return None\n    # If one is a string and the other is a number, return the string\n    elif isinstance(a, str) and isinstance(b, (int, float)):\n        return a\n    elif isinstance(b, str) and isinstance(a, (int, float)):\n        return b\n    # If both are strings, return the one that would be larger as a number\n    elif isinstance(a, str) and isinstance(b, str):\n        try:\n            a_num = float(a.replace(',', '.'))\n            b_num = float(b.replace(',', '.'))\n            if a_num > b_num:\n                return a\n            elif b_num > a_num:\n                return b\n            else:\n                return None\n        except ValueError:\n            # If they can't be converted to numbers, return the longer string\n            return a if len(a) > len(b) else (b if len(b) > len(a) else None)\n    # If both are same type and not numbers, return the larger one\n    else:\n        return a if a > b else (b if b > a else None)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/138": [{"task_id": "HumanEval/138", "solution": "def is_equal_to_sum_even(n):\n    \"\"\"Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers\n    Example\n    is_equal_to_sum_even(4) == False\n    is_equal_to_sum_even(6) == False\n    is_equal_to_sum_even(8) == True\n    \"\"\"\n    # The smallest sum of 4 positive even numbers is 2+2+2+2 = 8\n    if n < 8:\n        return False\n\n    # Check if n is even (since sum of even numbers is even)\n    if n % 2 != 0:\n        return False\n\n    # Check if we can find 4 positive even numbers that sum to n\n    # We can represent the numbers as 2a, 2b, 2c, 2d where a,b,c,d are positive integers\n    # So we need to find positive integers a,b,c,d such that 2(a+b+c+d) = n\n    # Which simplifies to a+b+c+d = n/2\n    # We need to find at least one solution where a,b,c,d \u2265 1\n\n    # The minimal sum is 1+1+1+1 = 4, so n/2 must be \u2265 4\n    if n // 2 < 4:\n        return False\n\n    # We can always find such numbers if n is even and \u22658\n    # For example, we can take three 2's and one (n/2 - 3)\n    # We just need to ensure (n/2 - 3) \u2265 1\n    if n // 2 - 3 >= 1:\n        return True\n\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/140": [{"task_id": "HumanEval/140", "solution": "import re\ndef fix_spaces(text):\n    \"\"\"\n    Given a string text, replace all spaces in it with underscores,\n    and if a string has more than 2 consecutive spaces,\n    then replace all consecutive spaces with -\n    \"\"\"\n    # First replace sequences of 3+ spaces with '-'\n    text = re.sub(r' {3,}', '-', text)\n    # Then replace remaining single spaces with '_'\n    text = re.sub(r' ', '_', text)\n    return text", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/141": [{"task_id": "HumanEval/141", "solution": "def file_name_check(file_name):\n    \"\"\"Create a function which takes a string representing a file's name, and returns\n    'Yes' if the the file's name is valid, and returns 'No' otherwise.\n    A file's name is considered to be valid if and only if all the following conditions\n    are met:\n    - There should not be more than three digits ('0'-'9') in the file's name.\n    - The file's name contains exactly one dot '.'\n    - The substring before the dot should not be empty, and it starts with a letter from\n    the latin alphapet ('a'-'z' and 'A'-'Z').\n    - The substring after the dot should be one of these: ['txt', 'exe', 'dll']\n    Examples:\n    file_name_check(\"example.txt\") # => 'Yes'\n    file_name_check(\"1example.dll\") # => 'No' (the name should start with a latin alphapet letter)\n    \"\"\"\n    # Check for exactly one dot\n    if file_name.count('.') != 1:\n        return 'No'\n\n    # Split into name and extension\n    name_part, ext_part = file_name.split('.')\n\n    # Check name part is not empty and starts with a letter\n    if not name_part or not name_part[0].isalpha():\n        return 'No'\n\n    # Check extension is valid\n    valid_extensions = {'txt', 'exe', 'dll'}\n    if ext_part not in valid_extensions:\n        return 'No'\n\n    # Check digit count (no more than three digits in entire filename)\n    digit_count = sum(c.isdigit() for c in file_name)\n    if digit_count > 3:\n        return 'No'\n\n    return 'Yes'", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/142": [{"task_id": "HumanEval/142", "solution": "def sum_squares(lst):\n    \"\"\"\n    This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a\n    multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not\n    change the entries in the list whose indexes are not a multiple of 3 or 4. The function shall then return the sum of all entries.\n\n    Examples:\n    For lst = [1,2,3] the output should be 6\n    For lst = []  the output should be 0\n    For lst = [-1,-5,2,-1,-5]  the output should be -126\n    \"\"\"\n    total = 0\n    for index, num in enumerate(lst):\n        if index % 3 == 0:\n            total += num ** 2\n        elif index % 4 == 0:\n            total += num ** 3\n        else:\n            total += num\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/143": [{"task_id": "HumanEval/143", "solution": "def is_prime(n):\n    \"\"\"Check if a number is prime.\"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    for i in range(3, int(n**0.5) + 1, 2):\n        if n % i == 0:\n            return False\n    return True\ndef words_in_sentence(sentence):\n    \"\"\"\n    Returns a string containing words from the original sentence whose lengths are prime numbers,\n    maintaining the original order.\n    \"\"\"\n    words = sentence.split()\n    prime_length_words = [word for word in words if is_prime(len(word))]\n    return ' '.join(prime_length_words)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/96": [{"task_id": "HumanEval/96", "solution": "def count_up_to(n):\n    \"\"\"Implement a function that takes an non-negative integer and returns an array of the first n\n    integers that are prime numbers and less than n.\n    for example:\n    count_up_to(5) => [2,3]\n    count_up_to(11) => [2,3,5,7]\n    count_up_to(0) => []\n    count_up_to(20) => [2,3,5,7,11,13,17,19]\n    count_up_to(1) => []\n    count_up_to(18) => [2,3,5,7,11,13,17]\n    \"\"\"\n    if n <= 1:\n        return []\n\n    primes = []\n    num = 2\n    while len(primes) < n:\n        is_prime = True\n        for p in primes:\n            if p * p > num:\n                break\n            if num % p == 0:\n                is_prime = False\n                break\n        if is_prime and num < n:\n            primes.append(num)\n        num += 1\n    return primes", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[5]], "plus_fail_tests": [[2]]}], "HumanEval/145": [{"task_id": "HumanEval/145", "solution": "def order_by_points(nums):\n    \"\"\"\n    Write a function which sorts the given list of integers\n    in ascending order according to the sum of their digits.\n    Note: if there are several items with similar sum of their digits,\n    order them based on their index in original list.\n\n    For example:\n    >>> order_by_points([1, 11, -1, -11, -12]) == [-1, -11, 1, -12, 11]\n    >>> order_by_points([]) == []\n    \"\"\"\n    def digit_sum(n):\n        return sum(int(d) for d in str(abs(n)))\n\n    # Create a list of tuples (digit_sum, original_index, value)\n    indexed_nums = [(digit_sum(num), i, num) for i, num in enumerate(nums)]\n\n    # Sort by digit_sum, then by original index\n    indexed_nums.sort(key=lambda x: (x[0], x[1]))\n\n    # Extract the sorted values\n    return [num for (_, _, num) in indexed_nums]", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[[1, 11, -1, -11, -12]]], "plus_fail_tests": [[[-5, -12, 9, 15]]]}], "HumanEval/144": [{"task_id": "HumanEval/144", "solution": "def simplify(x, n):\n    \"\"\"Simplify the expression x * n and return True if the result is a whole number, False otherwise.\n\n    Args:\n        x: String representation of a fraction in the format \"numerator/denominator\"\n        n: String representation of a fraction in the format \"numerator/denominator\"\n\n    Returns:\n        bool: True if x * n is a whole number, False otherwise\n\n    Examples:\n        >>> simplify(\"1/5\", \"5/1\")\n        True\n        >>> simplify(\"1/6\", \"2/1\")\n        False\n        >>> simplify(\"7/10\", \"10/2\")\n        False\n    \"\"\"\n    # Parse the fractions\n    x_num, x_den = map(int, x.split('/'))\n    n_num, n_den = map(int, n.split('/'))\n\n    # Calculate the product of the fractions\n    product_num = x_num * n_num\n    product_den = x_den * n_den\n\n    # Check if the denominator divides the numerator evenly\n    return product_num % product_den == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/146": [{"task_id": "HumanEval/146", "solution": "def specialFilter(nums):\n    \"\"\"Write a function that takes an array of numbers as input and returns\n    the number of elements in the array that are greater than 10 and both\n    first and last digits of a number are odd (1, 3, 5, 7, 9).\n    For example:\n    specialFilter([15, -73, 14, -15]) => 1\n    specialFilter([33, -2, -3, 45, 21, 109]) => 2\n    \"\"\"\n    count = 0\n    for num in nums:\n        # Skip negative numbers and numbers <= 10\n        if num <= 10:\n            continue\n\n        # Convert to string to check digits\n        num_str = str(num)\n        first_digit = num_str[0]\n        last_digit = num_str[-1]\n\n        # Check if both first and last digits are odd\n        if (int(first_digit) % 2 != 0 and\n            int(last_digit) % 2 != 0):\n            count += 1\n\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/147": [{"task_id": "HumanEval/147", "solution": "def get_max_triples(n):\n    \"\"\"\n    You are given a positive integer n. You have to create an integer array a of length n.\n        For each i (1 \u2264 i \u2264 n), the value of a[i] = i * i - i + 1.\n        Return the number of triples (a[i], a[j], a[k]) of a where i < j < k,\n    and a[i] + a[j] + a[k] is a multiple of 3.\n\n    Example :\n        Input: n = 5\n        Output: 1\n        Explanation:\n        a = [1, 3, 7, 13, 21]\n        The only valid triple is (1, 7, 13).\n    \"\"\"\n    # Generate the array a\n    a = [i * i - i + 1 for i in range(1, n + 1)]\n\n    # Count the number of elements congruent to 0, 1, 2 mod 3\n    count = [0, 0, 0]\n    for num in a:\n        count[num % 3] += 1\n\n    # Calculate the number of valid triples\n    # The sum is divisible by 3 if:\n    # 1. All three numbers are divisible by 3 (0+0+0)\n    # 2. All three numbers are \u22611 mod 3 (1+1+1)\n    # 3. All three numbers are \u22612 mod 3 (2+2+2)\n    # 4. One number from each residue (0+1+2)\n    total = 0\n    total += count[0] * (count[0] - 1) * (count[0] - 2) // 6  # All 0s\n    total += count[1] * (count[1] - 1) * (count[1] - 2) // 6  # All 1s\n    total += count[2] * (count[2] - 1) * (count[2] - 2) // 6  # All 2s\n    total += count[0] * count[1] * count[2]  # One of each\n\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/148": [{"task_id": "HumanEval/148", "solution": "def bf(planet1, planet2):\n    '''\n    There are eight planets in our solar system: the closest to the Sun\n    is Mercury, the next one is Venus, then Earth, Mars, Jupiter, Saturn,\n    Uranus, Neptune.\n    Write a function that takes two planet names as strings planet1 and planet2.\n    The function should return a tuple containing all planets whose orbits are\n    located between the orbit of planet1 and the orbit of planet2, sorted by\n    the proximity to the sun.\n    The function should return an empty tuple if planet1 or planet2\n    are not correct planet names.\n    Examples\n    bf(\"Jupiter\", \"Neptune\") ==> (\"Saturn\", \"Uranus\")\n    bf(\"Earth\", \"Mercury\") ==> (\"Venus\")\n    bf(\"Mercury\", \"Uranus\") ==> (\"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\")\n    '''\n    planets = [\"Mercury\", \"Venus\", \"Earth\", \"Mars\", \"Jupiter\", \"Saturn\", \"Uranus\", \"Neptune\"]\n\n    # Check if both planets are valid\n    if planet1 not in planets or planet2 not in planets:\n        return ()\n\n    # Get the indices of the planets\n    index1 = planets.index(planet1)\n    index2 = planets.index(planet2)\n\n    # Determine the start and end indices for the slice\n    start = min(index1, index2) + 1\n    end = max(index1, index2)\n\n    # Get the planets between them\n    between_planets = planets[start:end]\n\n    return tuple(between_planets)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/149": [{"task_id": "HumanEval/149", "solution": "def sorted_list_sum(lst):\n    \"\"\"Write a function that accepts a list of strings as a parameter,\n    deletes the strings that have odd lengths from it,\n    and returns the resulted list with a sorted order,\n    The list is always a list of strings and never an array of numbers,\n    and it may contain duplicates.\n    The order of the list should be ascending by length of each word, and you\n    should return the list sorted by that rule.\n    If two words have the same length, sort the list alphabetically.\n    The function should return a list of strings in sorted order.\n    You may assume that all words will have the same length.\n    For example:\n    assert list_sort([\"aa\", \"a\", \"aaa\"]) => [\"aa\"]\n    assert list_sort([\"ab\", \"a\", \"aaa\", \"cd\"]) => [\"ab\", \"cd\"]\n    \"\"\"\n    # Filter out strings with odd lengths\n    filtered = [s for s in lst if len(s) % 2 == 0]\n\n    # Sort by length (ascending) and then alphabetically\n    sorted_list = sorted(filtered, key=lambda x: (len(x), x))\n\n    return sorted_list", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/150": [{"task_id": "HumanEval/150", "solution": "def is_prime(n):\n    \"\"\"Check if a number is prime.\"\"\"\n    if n <= 1:\n        return False\n    if n == 2:\n        return True\n    if n % 2 == 0:\n        return False\n    for i in range(3, int(n**0.5) + 1, 2):\n        if n % i == 0:\n            return False\n    return True\ndef x_or_y(n, x, y):\n    \"\"\"Return x if n is prime, otherwise return y.\"\"\"\n    return x if is_prime(n) else y", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/152": [{"task_id": "HumanEval/152", "solution": "def compare(game, guess):\n    \"\"\"\n    Determines how far off each guess was compared to the actual game scores.\n\n    Args:\n        game: List of actual scores for each match.\n        guess: List of guessed scores for each match.\n\n    Returns:\n        List of absolute differences between each guess and actual score.\n        If the guess is correct, the value is 0.\n    \"\"\"\n    return [abs(g - s) for g, s in zip(game, guess)]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/151": [{"task_id": "HumanEval/151", "solution": "def double_the_difference(lst):\n    '''\n    Given a list of numbers, return the sum of squares of the numbers\n    in the list that are odd. Ignore numbers that are negative or not integers.\n\n    double_the_difference([1, 3, 2, 0]) == 1 + 9 + 0 + 0 = 10\n    double_the_difference([-1, -2, 0]) == 0\n    double_the_difference([9, -2]) == 81\n    double_the_difference([0]) == 0\n\n    If the input list is empty, return 0.\n    '''\n    total = 0\n    for num in lst:\n        # Check if the number is a non-negative integer\n        if isinstance(num, int) and num >= 0:\n            if num % 2 == 1:  # Check if the number is odd\n                total += num ** 2\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/153": [{"task_id": "HumanEval/153", "solution": "def Strongest_Extension(class_name, extensions):\n    \"\"\"Finds the strongest extension for a given class based on the strength formula.\n\n    Args:\n        class_name: Name of the class (string)\n        extensions: List of extension names (list of strings)\n\n    Returns:\n        String in format \"ClassName.StrongestExtensionName\"\n    \"\"\"\n    if not extensions:\n        return f\"{class_name}.\"\n\n    max_strength = -float('inf')\n    strongest_extension = extensions[0]\n\n    for ext in extensions:\n        cap = sum(1 for c in ext if c.isupper())\n        sm = sum(1 for c in ext if c.islower())\n        strength = cap - sm\n\n        if strength > max_strength:\n            max_strength = strength\n            strongest_extension = ext\n        elif strength == max_strength:\n            # Keep the first one encountered\n            pass\n\n    return f\"{class_name}.{strongest_extension}\"", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/154": [{"task_id": "HumanEval/154", "solution": "def cycpattern_check(a, b):\n    \"\"\"Check if any rotation of word b is a substring of word a.\"\"\"\n    if not b:\n        return True  # empty string is always a substring\n\n    # Generate all possible rotations of b\n    rotations = [b[i:] + b[:i] for i in range(len(b))]\n\n    # Check if any rotation is a substring of a\n    for rotation in rotations:\n        if rotation in a:\n            return True\n    return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/139": [{"task_id": "HumanEval/139", "solution": "def factorial(k):\n    \"\"\"Calculate the factorial of k (k!).\"\"\"\n    if k == 0:\n        return 1\n    result = 1\n    for i in range(1, k + 1):\n        result *= i\n    return result\ndef special_factorial(n):\n    \"\"\"Calculate the Brazilian factorial: n! * (n-1)! * ... * 1!\"\"\"\n    if n <= 0:\n        return 0  # or raise an error, since n > 0 per problem statement\n    result = 1\n    for k in range(1, n + 1):\n        result *= factorial(k)\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/156": [{"task_id": "HumanEval/156", "solution": "def int_to_mini_roman(number):\n    \"\"\"\n    Given a positive integer, obtain its roman numeral equivalent as a string,\n    and return it in lowercase.\n    Restrictions: 1 <= num <= 1000\n\n    Examples:\n    >>> int_to_mini_roman(19) == 'xix'\n    >>> int_to_mini_roman(152) == 'clii'\n    >>> int_to_mini_roman(426) == 'cdxxvi'\n    \"\"\"\n    if not 1 <= number <= 1000:\n        raise ValueError(\"Number must be between 1 and 1000\")\n\n    val_to_roman = [\n        (1000, 'm'),\n        (900, 'cm'),\n        (500, 'd'),\n        (400, 'cd'),\n        (100, 'c'),\n        (90, 'xc'),\n        (50, 'l'),\n        (40, 'xl'),\n        (10, 'x'),\n        (9, 'ix'),\n        (5, 'v'),\n        (4, 'iv'),\n        (1, 'i')\n    ]\n\n    roman_num = []\n    for val, roman in val_to_roman:\n        while number >= val:\n            roman_num.append(roman)\n            number -= val\n    return ''.join(roman_num)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/155": [{"task_id": "HumanEval/155", "solution": "def even_odd_count(num):\n    \"\"\"Given an integer. return a tuple that has the number of even and odd digits respectively.\n\n     Example:\n        even_odd_count(-12) ==> (1, 1)\n        even_odd_count(123) ==> (1, 2)\n    \"\"\"\n    # Handle negative numbers by converting to positive\n    num = abs(num)\n\n    even = 0\n    odd = 0\n\n    for digit in str(num):\n        d = int(digit)\n        if d % 2 == 0:\n            even += 1\n        else:\n            odd += 1\n\n    return (even, odd)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/157": [{"task_id": "HumanEval/157", "solution": "def right_angle_triangle(a, b, c):\n    '''\n    Given the lengths of the three sides of a triangle. Return True if the three\n    sides form a right-angled triangle, False otherwise.\n    A right-angled triangle is a triangle in which one angle is right angle or\n    90 degree.\n    Example:\n    right_angle_triangle(3, 4, 5) == True\n    right_angle_triangle(1, 2, 3) == False\n    '''\n    # First check if the sides can form a valid triangle\n    if a + b <= c or a + c <= b or b + c <= a:\n        return False\n\n    # Check all three possible cases for the right angle\n    sides = sorted([a, b, c])\n    return sides[0]**2 + sides[1]**2 == sides[2]**2", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/159": [{"task_id": "HumanEval/159", "solution": "def eat(number, need, remaining):\n    \"\"\"\n    You're a hungry rabbit, and you already have eaten a certain number of carrots,\n    but now you need to eat more carrots to complete the day's meals.\n    you should return an array of [ total number of eaten carrots after your meals,\n                                    the number of carrots left after your meals ]\n    if there are not enough remaining carrots, you will eat all remaining carrots, but will still be hungry.\n\n    Example:\n    * eat(5, 6, 10) -> [11, 4]\n    * eat(4, 8, 9) -> [12, 1]\n    * eat(1, 10, 10) -> [11, 0]\n    * eat(2, 11, 5) -> [7, 0]\n\n    Variables:\n    @number : integer\n        the number of carrots that you have eaten.\n    @need : integer\n        the number of carrots that you need to eat.\n    @remaining : integer\n        the number of remaining carrots thet exist in stock\n\n    Constrain:\n    * 0 <= number <= 1000\n    * 0 <= need <= 1000\n    * 0 <= remaining <= 1000\n\n    Have fun :)\n    \"\"\"\n    eaten = number + min(need, remaining)\n    left = remaining - min(need, remaining)\n    return [eaten, left]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/158": [{"task_id": "HumanEval/158", "solution": "def find_max(words):\n    \"\"\"Write a function that accepts a list of strings.\n    The list contains different words. Return the word with maximum number\n    of unique characters. If multiple strings have maximum number of unique\n    characters, return the one which comes first in lexicographical order.\n\n    find_max([\"name\", \"of\", \"string\"]) == \"string\"\n    find_max([\"name\", \"enam\", \"game\"]) == \"enam\"\n    find_max([\"aaaaaaa\", \"bb\" ,\"cc\"]) == \"aaaaaaa\"\n    \"\"\"\n    if not words:\n        return \"\"\n\n    max_unique = -1\n    result = \"\"\n\n    for word in words:\n        unique_chars = len(set(word))\n        if unique_chars > max_unique:\n            max_unique = unique_chars\n            result = word\n        elif unique_chars == max_unique:\n            if word < result:\n                result = word\n\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/160": [{"task_id": "HumanEval/160", "solution": "def do_algebra(operator, operand):\n    \"\"\"\n    Given two lists operator, and operand. The first list has basic algebra operations, and\n    the second list is a list of integers. Use the two given lists to build the algebraic\n    expression and return the evaluation of this expression.\n\n    The basic algebra operations:\n    Addition ( + )\n    Subtraction ( - )\n    Multiplication ( * )\n    Floor division ( // )\n    Exponentiation ( ** )\n\n    Example:\n    operator = ['+', '*', '-']\n    operand = [2, 3, 4, 5]\n    result = 2 + 3 * 4 - 5\n    => result = 9\n\n    Note:\n        The length of operator list is equal to the length of operand list minus one.\n        Operand is a list of of non-negative integers.\n        Operator list has at least one operator, and operand list has at least two operands.\n    \"\"\"\n    if len(operand) != len(operator) + 1:\n        raise ValueError(\"Invalid input: operand length must be operator length + 1\")\n\n    if len(operand) < 2 or len(operator) < 1:\n        raise ValueError(\"Invalid input: operand list must have at least two elements and operator list at least one\")\n\n    result = operand[0]\n    for i in range(len(operator)):\n        op = operator[i]\n        next_num = operand[i+1]\n\n        if op == '+':\n            result += next_num\n        elif op == '-':\n            result -= next_num\n        elif op == '*':\n            result *= next_num\n        elif op == '//':\n            result //= next_num\n        elif op == '**':\n            result **= next_num\n        else:\n            raise ValueError(f\"Unknown operator: {op}\")\n\n    return result", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[["+", "*", "-"], [2, 3, 4, 5]]], "plus_fail_tests": [[["+", "-", "*", "//"], [5, 2, 3, 4, 7]]]}], "HumanEval/161": [{"task_id": "HumanEval/161", "solution": "def solve(s):\n    \"\"\"You are given a string s.\n    if s[i] is a letter, reverse its case from lower to upper or vise versa,\n    otherwise keep it as it is.\n    If the string contains no letters, reverse the string.\n    The function should return the resulted string.\n    Examples\n    solve(\"1234\") = \"4321\"\n    solve(\"ab\") = \"AB\"\n    solve(\"#a@C\") = \"#A@c\"\n    \"\"\"\n    has_letters = any(c.isalpha() for c in s)\n\n    if not has_letters:\n        return s[::-1]\n\n    result = []\n    for c in s:\n        if c.isalpha():\n            if c.islower():\n                result.append(c.upper())\n            else:\n                result.append(c.lower())\n        else:\n            result.append(c)\n\n    return ''.join(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/162": [{"task_id": "HumanEval/162", "solution": "import hashlib\ndef string_to_md5(text):\n    \"\"\"\n    Given a string 'text', return its md5 hash equivalent string.\n    If 'text' is an empty string, return None.\n\n    >>> string_to_md5('Hello world') == '3e25960a79dbc69b674cd4ec67a72c62'\n    \"\"\"\n    if not text:\n        return None\n    return hashlib.md5(text.encode()).hexdigest()", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/163": [{"task_id": "HumanEval/163", "solution": "def generate_integers(a, b):\n    \"\"\"\n    Given two positive integers a and b, return the even digits between a\n    and b, in ascending order.\n\n    For example:\n    generate_integers(2, 8) => [2, 4, 6, 8]\n    generate_integers(8, 2) => [2, 4, 6, 8]\n    generate_integers(10, 14) => []\n    \"\"\"\n    # Determine the start and end of the range\n    start = min(a, b)\n    end = max(a, b)\n\n    # Generate all even digits between start and end\n    even_digits = []\n    for num in range(start, end + 1):\n        # Check if the number is a single digit and even\n        if 0 <= num <= 9 and num % 2 == 0:\n            even_digits.append(num)\n\n    return even_digits", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[987654321, 123456789]]}]}, "pass_at_k": {"base": {"pass@1": 0.8841463414634146}, "plus": {"pass@1": 0.823170731707317}}}