{"date": "2026-11-02 21:24", "hash": "fe585eb4df8c88d844eeb463ea4d0302", "eval": {"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    return number - int(number)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    # Remove all spaces from the input string\n    cleaned = paren_string.replace(' ', '')\n    \n    result = []\n    current_group = []\n    depth = 0\n    \n    for char in cleaned:\n        if char == '(':\n            depth += 1\n            current_group.append(char)\n        elif char == ')':\n            depth -= 1\n            current_group.append(char)\n            # When depth returns to 0, we've completed a balanced group\n            if depth == 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/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 numbers to efficiently check adjacent pairs\n    sorted_numbers = sorted(numbers)\n    for i in range(len(sorted_numbers) - 1):\n        if abs(sorted_numbers[i] - sorted_numbers[i + 1]) < threshold:\n            return True\n    return False", "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_val = sum(numbers) / len(numbers)\n    mad = sum(abs(x - mean_val) for x in numbers) / len(numbers)\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 fallls 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/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/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    result = []\n    for group in groups:\n        max_depth = 0\n        current_depth = 0\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        result.append(max_depth)\n    return result", "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/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    result = []\n    for bit_a, bit_b in zip(a, b):\n        if bit_a == bit_b:\n            result.append('0')\n        else:\n            result.append('1')\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 ''\n    \n    # Find the longest palindromic suffix\n    # We iterate from the end to find the longest suffix that is a palindrome\n    n = len(string)\n    longest_pal_suffix_len = 0\n    \n    for i in range(n):\n        # Check if string[i:] is a palindrome\n        suffix = string[i:]\n        if is_palindrome(suffix):\n            longest_pal_suffix_len = n - i\n            break  # Since we start from i=0, the first one we find is the longest\n    \n    # The prefix before the palindromic suffix\n    prefix = string[:n - longest_pal_suffix_len]\n    \n    # Reverse the prefix and append it to the end\n    return string + prefix[::-1]", "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    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/9": [{"task_id": "HumanEval/9", "solution": "from typing import List, Tuple\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    for num in numbers:\n        if num > current_max:\n            current_max = num\n        result.append(current_max)\n    return result", "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    longest_str = strings[0]\n    for s in strings[1:]:\n        if len(s) > len(longest_str):\n            longest_str = s\n    \n    return longest_str", "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    if not numbers:\n        return (0, 1)\n    \n    total_sum = sum(numbers)\n    total_product = 1\n    for num in numbers:\n        total_product *= num\n    \n    return (total_sum, total_product)", "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    >>> all_prefixes('abc')\n    ['a', 'ab', 'abc']\n    \"\"\"\n    return [string[:i+1] for i in range(len(string))]", "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    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    num_to_word = {v: k for k, v in word_to_num.items()}\n    \n    words = numbers.split()\n    # Sort by the numeric value\n    sorted_words = sorted(words, key=lambda w: word_to_num[w])\n    \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    \"\"\" Input to this function is a string representing musical notes in a special ASCII format.\n    Your task is to parse this string and return list of integers corresponding to how many beats does each\n    not last.\n\n    Here is a legend:\n    'o' - whole note, lasts four beats\n    'o|' - half note, lasts two beats\n    '.|' - quater note, lasts one beat\n\n    >>> parse_music('o o| .| o| o| .| .| .| .| o o')\n    [4, 2, 1, 2, 2, 1, 1, 1, 1, 4, 4]\n    \"\"\"\n    # Split the string by spaces to get individual note tokens\n    tokens = music_string.split()\n    \n    result = []\n    for token in tokens:\n        if token == 'o':\n            result.append(4)\n        elif token == 'o|':\n            result.append(2)\n        elif token == '.|':\n            result.append(1)\n    \n    return result", "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    return len(set(string.lower()))", "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 overlapping 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:\n        return 0\n    \n    count = 0\n    start = 0\n    while True:\n        pos = string.find(substring, start)\n        if pos == -1:\n            break\n        count += 1\n        start = pos + 1  # Move forward by 1 to allow overlapping matches\n    return count", "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 numbers to easily find the closest pair\n    sorted_numbers = sorted(numbers)\n    \n    min_diff = float('inf')\n    closest_pair = (sorted_numbers[0], sorted_numbers[1])\n    \n    for i in range(len(sorted_numbers) - 1):\n        diff = abs(sorted_numbers[i + 1] - sorted_numbers[i])\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 not numbers or len(numbers) < 2:\n        return numbers\n    \n    min_val = min(numbers)\n    max_val = max(numbers)\n    \n    # Handle the case where all elements are the same\n    if max_val == min_val:\n        return [0.0] * len(numbers)\n    \n    range_val = max_val - min_val\n    result = [(x - min_val) / range_val for x in numbers]\n    \n    return result", "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 [v for v in values if isinstance(v, int) and not isinstance(v, 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/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    # The largest divisor of n that is smaller than n is n divided by its smallest prime factor.\n    # We can find this by iterating from 2 up to sqrt(n) to find the smallest divisor.\n    if n <= 1:\n        return n  # Edge case, though typically n > 1\n    \n    # Find the smallest divisor d of n (d > 1)\n    # Then the largest divisor smaller than n is n // d\n    for i in range(2, int(n**0.5) + 1):\n        if n % i == 0:\n            return n // i\n    # If no divisor found, n is prime, so the largest divisor smaller than n is 1\n    return 1", "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    return string.swapcase()", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/26": [{"task_id": "HumanEval/26", "solution": "from typing import List\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 = {}\n    for num in numbers:\n        count[num] = count.get(num, 0) + 1\n    \n    # Keep only elements that appear exactly once, preserving order\n    result = [num for num in numbers if count[num] == 1]\n    return result", "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/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/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/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    if n <= 1:\n        return []\n    \n    factors = []\n    d = 2\n    while d * d <= n:\n        while n % d == 0:\n            factors.append(d)\n            n //= d\n        d += 1\n    if n > 1:\n        factors.append(n)\n    return factors", "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/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    # Use Newton's method to find a root of the polynomial\n    # Start with an initial guess and iterate\n    \n    def poly_derivative(xs):\n        \"\"\"Compute the derivative coefficients of the polynomial.\"\"\"\n        if len(xs) <= 1:\n            return [0.0]\n        return [i * xs[i] for i in range(1, len(xs))]\n    \n    # Initial guess\n    x = 1.0\n    \n    # Newton's method\n    for _ in range(1000):  # Max iterations\n        fx = poly(xs, x)\n        if abs(fx) < 1e-10:\n            return x\n        \n        # Compute derivative at x\n        deriv_coeffs = poly_derivative(xs)\n        dfx = poly(deriv_coeffs, x)\n        \n        if abs(dfx) < 1e-10:\n            # Derivative is too small, perturb x\n            x += 0.001\n            continue\n        \n        x = x - fx / dfx\n    \n    return x", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[[-36, 6, -1440, -36]]]}], "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 < 2:\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", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    indices = [i for i in range(len(l)) if i % 3 == 0]\n    values = [l[i] for i in indices]\n    # Sort those values\n    values.sort()\n    # Create a copy of the original list\n    result = l.copy()\n    # Place sorted values back into the positions divisible by 3\n    for idx, val in zip(indices, values):\n        result[idx] = val\n    return result", "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    return max(l)", "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/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 values at even indices\n    even_indices_values = [l[i] for i in range(0, len(l), 2)]\n    # Sort the even index values\n    even_indices_values.sort()\n    \n    # Create the result list\n    result = l.copy()\n    # Place sorted even index values back into even positions\n    for i, val in enumerate(even_indices_values):\n        result[i * 2] = val\n    \n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/36": [{"task_id": "HumanEval/36", "solution": "def fizz_buzz(n: 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 i in range(1, n):\n        if i % 11 == 0 or i % 13 == 0:\n            # Count occurrences of digit '7' in the number\n            count += str(i).count('7')\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/38": [{"task_id": "HumanEval/38", "solution": "def decode_cyclic(s: str):\n    \"\"\"\n    takes as input string encoded with encode_cyclic function. Returns decoded string.\n    \"\"\"\n    # split string to groups. Each of length 3.\n    groups = [s[(3 * i):min((3 * i + 3), len(s))] for i in range((len(s) + 2) // 3)]\n    # reverse the cycling: for groups of length 3, shift right by 1 (or left by 2)\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/41": [{"task_id": "HumanEval/41", "solution": "def car_race_collision(n: 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    # Each of the n cars moving left-to-right will collide with each of the n cars\n    # moving right-to-left. Since they all move at the same speed and start far apart,\n    # every left-to-right car will eventually meet every right-to-left car exactly once.\n    # So the total number of collisions is n * n = n^2.\n    return n * n", "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):\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 x == 0:\n        return '0'\n    \n    negative = False\n    if x < 0:\n        negative = True\n        x = -x\n    \n    digits = []\n    while x > 0:\n        digits.append(str(x % base))\n        x //= base\n    \n    result = ''.join(reversed(digits))\n    if negative:\n        result = '-' + result\n    \n    return result", "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):\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    # Sort the list to use two-pointer technique\n    l_sorted = sorted(l)\n    \n    for i in range(n - 2):\n        # Skip duplicate values for the first element to avoid redundant checks\n        if i > 0 and l_sorted[i] == l_sorted[i - 1]:\n            continue\n        \n        left = i + 1\n        right = n - 1\n        \n        while left < right:\n            total = l_sorted[i] + l_sorted[left] + l_sorted[right]\n            \n            if total == 0:\n                return True\n            elif total < 0:\n                left += 1\n            else:\n                right -= 1\n    \n    return False", "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/42": [{"task_id": "HumanEval/42", "solution": "def incr_list(l: 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/46": [{"task_id": "HumanEval/46", "solution": "def fib4(n: int):\n    \"\"\"The Fib4 number sequence is a sequence similar to the Fibbonacci sequnece 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    Please write a function to efficiently compute the n-th element of the fib4 number sequence.  Do not use recursion.\n    >>> fib4(5)\n    4\n    >>> fib4(6)\n    8\n    >>> fib4(7)\n    14\n    \"\"\"\n    if n == 0:\n        return 0\n    if 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  # fib4(0), fib4(1), fib4(2), fib4(3)\n    \n    for i in range(4, n + 1):\n        # fib4(i) = fib4(i-1) + fib4(i-2) + fib4(i-3) + fib4(i-4)\n        next_val = d + c + b + a\n        # Shift values: a<-b, b<-c, c<-d, d<-next_val\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/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/48": [{"task_id": "HumanEval/48", "solution": "def is_palindrome(text: str):\n    \"\"\"\n    Checks if given string is a palindrome\n    >>> is_palindrome('')\n    True\n    >>> is_palindrome('aba')\n    True\n    >>> is_palindrome('aaaaa')\n    True\n    >>> is_palindrome('zbcd')\n    False\n    \"\"\"\n    return text == text[::-1]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/49": [{"task_id": "HumanEval/49", "solution": "def modp(n: int, p: int):\n    \"\"\"Return 2^n modulo p (be aware of numerics).\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    return pow(2, n, p)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/50": [{"task_id": "HumanEval/50", "solution": "def decode_shift(s: str):\n    \"\"\"\n    takes as input string encoded with encode_shift function. Returns decoded string.\n    \"\"\"\n    return \"\".join([chr(((ord(ch) - 5 - ord(\"a\")) % 26) + ord(\"a\")) for ch in s])", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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_l = sorted(l)\n    n = len(sorted_l)\n    if n % 2 == 1:\n        return sorted_l[n // 2]\n    else:\n        return (sorted_l[n // 2 - 1] + sorted_l[n // 2]) / 2.0", "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 = set('aeiouAEIOU')\n    return ''.join(char for char in text if char not in vowels)", "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):\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):\n    \"\"\"Add two numbers x and y\n    >>> add(2, 3)\n    5\n    >>> add(5, 7)\n    12\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):\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        return 0\n    if n == 1:\n        return 1\n    a, b = 0, 1\n    for _ in range(2, n + 1):\n        a, b = b, a + b\n    return b", "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):\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    \"\"\"\n    set1 = set(l1)\n    set2 = set(l2)\n    common_elements = set1 & set2\n    return sorted(list(common_elements))", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/56": [{"task_id": "HumanEval/56", "solution": "def correct_bracketing(brackets: str):\n    \"\"\" brackets is a string of \"<\" and \">\".\n    return True if every opening bracket has a corresponding closing bracket.\n\n    >>> correct_bracketing(\"<\")\n    False\n    >>> correct_bracketing(\"<>\")\n    True\n    >>> correct_bracketing(\"<<><>>\")\n    True\n    >>> correct_bracketing(\"><<>\")\n    False\n    \"\"\"\n    count = 0\n    for char in brackets:\n        if char == '<':\n            count += 1\n        elif char == '>':\n            count -= 1\n        if count < 0:\n            return False\n    return count == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/54": [{"task_id": "HumanEval/54", "solution": "def same_chars(s0: str, s1: str):\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 set(s0) == set(s1)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/57": [{"task_id": "HumanEval/57", "solution": "def monotonic(l: list):\n    \"\"\"Return True is 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) <= 2:\n        return True\n    \n    # Check if monotonically increasing\n    is_increasing = True\n    for i in range(1, len(l)):\n        if l[i] < l[i-1]:\n            is_increasing = False\n            break\n    \n    # Check if monotonically decreasing\n    is_decreasing = True\n    for i in range(1, len(l)):\n        if l[i] > l[i-1]:\n            is_decreasing = False\n            break\n    \n    return is_increasing or is_decreasing", "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):\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    # Handle factor of 2\n    max_prime = -1\n    \n    # Divide out all factors of 2\n    while n % 2 == 0:\n        max_prime = 2\n        n //= 2\n    \n    # Now n must be odd. Check odd factors from 3 upwards.\n    i = 3\n    while i * i <= n:\n        while n % i == 0:\n            max_prime = i\n            n //= i\n        i += 2\n    \n    # If n is still greater than 1, then it's a prime factor\n    if n > 1:\n        max_prime = n\n    \n    return max_prime", "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):\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/63": [{"task_id": "HumanEval/63", "solution": "def fibfib(n: int):\n    \"\"\"The FibFib number sequence is a sequence similar to the Fibbonacci sequnece 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    Please write a function to efficiently compute the n-th element of the fibfib number sequence.\n    >>> fibfib(1)\n    0\n    >>> fibfib(5)\n    4\n    >>> fibfib(8)\n    24\n    \"\"\"\n    if n == 0:\n        return 0\n    if n == 1:\n        return 0\n    if n == 2:\n        return 1\n    \n    # Use iterative approach with O(n) time and O(1) space\n    a, b, c = 0, 0, 1  # fibfib(0), fibfib(1), fibfib(2)\n    for i 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):\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    return [xs[i] * i for i in range(1, len(xs))]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/61": [{"task_id": "HumanEval/61", "solution": "def correct_bracketing(brackets: str):\n    \"\"\" brackets is a string of \"(\" and \")\".\n    return True if every opening bracket has a corresponding closing bracket.\n\n    >>> correct_bracketing(\"(\")\n    False\n    >>> correct_bracketing(\"()\")\n    True\n    >>> correct_bracketing(\"(()())\")\n    True\n    >>> correct_bracketing(\")(()\")\n    False\n    \"\"\"\n    count = 0\n    for char in brackets:\n        if char == '(':\n            count += 1\n        elif char == ')':\n            count -= 1\n        if count < 0:\n            return False\n    return count == 0", "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    s = str(x)\n    n = len(s)\n    if shift > n:\n        return s[::-1]\n    else:\n        # Circular shift right by shift\n        # Right shift by k means the last k digits move to the front\n        shift = shift % n\n        return s[-shift:] + s[:-shift]", "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    if not s:\n        return 0\n    \n    vowels = set('aeiouAEIOU')\n    count = 0\n    \n    for i, char in enumerate(s):\n        if char in vowels:\n            count += 1\n        elif char == 'y' or char == 'Y':\n            # 'y' is a vowel only when it is at the end of the word\n            if i == len(s) - 1:\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 prime_fib(n: int):\n    \"\"\"\n    prime_fib returns n-th number that is a Fibonacci number and it's also prime.\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    def is_prime(num):\n        if num < 2:\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\n    \n    # Generate Fibonacci numbers and check if they are prime\n    count = 0\n    a, b = 0, 1\n    while True:\n        fib = a\n        if is_prime(fib):\n            count += 1\n            if count == n:\n                return fib\n        a, b = b, a + b", "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 examble:\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    # Extract the numbers from the string\n    # The format is \"<num> apples and <num> oranges\"\n    parts = s.split()\n    # Find the numbers: they are the first and third elements (indices 0 and 2)\n    # But let's be more robust: find all integers in the string\n    import re\n    numbers = re.findall(r'\\d+', s)\n    if len(numbers) >= 2:\n        apples = int(numbers[0])\n        oranges = int(numbers[1])\n        mangoes = n - apples - oranges\n        return mangoes\n    else:\n        return 0", "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    return sum(ord(c) for c in s if c.isupper())", "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 q is a palindrome (balanced)\n    if q != q[::-1]:\n        return False\n    # Check if sum of elements is less than or equal to w\n    if sum(q) > w:\n        return False\n    return True", "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.0\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/69": [{"task_id": "HumanEval/69", "solution": "def 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    from collections import Counter\n    \n    freq = Counter(lst)\n    \n    result = -1\n    for num, count in freq.items():\n        if num > 0 and count >= num:\n            if num > result:\n                result = num\n    \n    return result", "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, [ smalest_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    if not arr:\n        return []\n    \n    smallest_even = None\n    smallest_index = -1\n    \n    for i, val in enumerate(arr):\n        if val % 2 == 0:\n            if smallest_even is None or val < smallest_even:\n                smallest_even = val\n                smallest_index = i\n    \n    if smallest_even is None:\n        return []\n    \n    return [smallest_even, smallest_index]", "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    # Sort the list\n    sorted_lst = sorted(lst)\n    \n    result = []\n    left = 0\n    right = len(sorted_lst) - 1\n    toggle = True  # True means pick from left (minimum), False means pick from right (maximum)\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/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    for i in range(n // 2):\n        if arr[i] != arr[n - 1 - i]:\n            changes += 1\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    \"\"\"Write a function that returns true if the given number is the multiplication of 3 prime numbers\n    and false otherwise.\n    Knowing that (a) is less then 100. \n    Example:\n    is_multiply_prime(30) == True\n    30 = 2 * 3 * 5\n    \"\"\"\n    if a < 2:\n        return False\n    \n    # Find all prime factors of a\n    def get_prime_factors(n):\n        factors = []\n        d = 2\n        while d * d <= n:\n            while n % d == 0:\n                factors.append(d)\n                n //= d\n            d += 1\n        if n > 1:\n            factors.append(n)\n        return factors\n    \n    prime_factors = get_prime_factors(a)\n    \n    # Check if there are exactly 3 prime factors (counting multiplicity)\n    # and all of them are prime (which they are by construction)\n    if len(prime_factors) == 3:\n        return True\n    else:\n        return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    def total_chars(lst):\n        return sum(len(s) for s in lst)\n    \n    total1 = total_chars(lst1)\n    total2 = total_chars(lst2)\n    \n    if total1 <= total2:\n        return lst1\n    else:\n        return lst2", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/79": [{"task_id": "HumanEval/79", "solution": "def decimal_to_binary(decimal):\n    \"\"\"You will be given a number in decimal form and your task is to convert it to\n    binary format. The function should return a string, with each character representing a binary\n    number. Each character in the string will be '0' or '1'.\n\n    There will be an extra couple of characters 'db' at the beginning and at the end of the string.\n    The extra characters are there to help with the format.\n\n    Examples:\n    decimal_to_binary(15)   # returns \"db1111db\"\n    decimal_to_binary(32)   # returns \"db100000db\"\n    \"\"\"\n    if decimal == 0:\n        binary_str = \"0\"\n    else:\n        binary_str = \"\"\n        n = decimal\n        while n > 0:\n            binary_str = str(n % 2) + binary_str\n            n //= 2\n    return \"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 ingeger 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    if a == 0:\n        return True\n    \n    # Handle negative numbers: if a is negative, check if -a is a perfect cube\n    # and the cube root is negative\n    if a < 0:\n        a = -a\n        # Find the cube root\n        root = round(a ** (1/3))\n        # Check nearby values due to floating point inaccuracies\n        for candidate in [root - 1, root, root + 1]:\n            if candidate >= 0 and candidate ** 3 == a:\n                return True\n        return False\n    else:\n        root = round(a ** (1/3))\n        for candidate in [root - 1, root, root + 1]:\n            if candidate >= 0 and candidate ** 3 == a:\n                return True\n        return False", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/78": [{"task_id": "HumanEval/78", "solution": "def hex_key(num):\n    \"\"\"You have been tasked to write a function that receives \n    a hexadecimal number as a string and counts the number of hexadecimal \n    digits that are primes (prime number, or a prime, is a natural number \n    greater than 1 that is not a product of two smaller natural numbers).\n    Hexadecimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.\n    Prime numbers are 2, 3, 5, 7, 11, 13, 17,...\n    So you have to determine a number of the following digits: 2, 3, 5, 7, \n    B (=decimal 11), D (=decimal 13).\n    Note: you may assume the input is always correct or empty string, \n    and symbols A,B,C,D,E,F are always uppercase.\n    Examples:\n    For num = \"AB\" the output should be 1.\n    For num = \"1077E\" the output should be 2.\n    For num = \"ABED1A33\" the output should be 4.\n    For num = \"123456789ABCDEF0\" the output should be 6.\n    For num = \"2020\" the output should be 2.\n    \"\"\"\n    # Prime hex digits: 2, 3, 5, 7, B (11), D (13)\n    prime_hex_digits = {'2', '3', '5', '7', 'B', 'D'}\n    count = 0\n    for char in num:\n        if char in prime_hex_digits:\n            count += 1\n    return count", "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    \"\"\"Your task is to write a function that returns true if a number x is a simple\n    power of n and false in other cases.\n    x is a simple power of n if n**int=x\n    For example:\n    is_simple_power(1, 4) => true\n    is_simple_power(2, 2) => true\n    is_simple_power(8, 2) => true\n    is_simple_power(3, 2) => false\n    is_simple_power(3, 1) => false\n    is_simple_power(5, 3) => false\n    \"\"\"\n    # Handle edge cases\n    if n == 1:\n        return x == 1\n    if x == 1:\n        return n != 0  # n**0 = 1, but we need n**int = x where int >= 0\n        # Actually, 1 = n**0 for any n, but the problem says \"n**int=x\"\n        # Let's think: is_simple_power(1, 4) => true, so 1 = 4**0, int=0\n        # But is_simple_power(3, 1) => false, so 1 != 1**something? \n        # 1**k = 1 for any k, so if x=1 and n=1, it should be true? \n        # But the example says is_simple_power(3, 1) => false, which is x=3, n=1.\n        # 1**k = 1 for any k, so 3 is never a power of 1. That makes sense.\n        # For x=1, n=4: 4**0 = 1, so true.\n        # For x=1, n=1: 1**0 = 1, so true? But let's check the examples.\n        # The examples don't have (1, 1). Let's assume x=1 is always true for any n (since n**0=1).\n        # But wait, is_simple_power(1, 4) => true. So x=1 is a simple power of any n.\n        # Let me reconsider: if x == 1, return True (since n**0 = 1 for any n != 0)\n        # But what if n == 0? 0**0 is undefined or 1 depending on convention. Let's handle n=0 separately.\n    \n    if n == 0:\n        return x == 0  # 0**k = 0 for k >= 1, but 0**0 = 1. So x=0 is 0**1, true. x=1 is 0**0, true? \n        # Hmm, this is tricky. Let's just handle the common cases.\n    \n    # For n == 0:\n    # If x == 0, then 0**1 = 0, so true.\n    # If x == 1, then 0**0 = 1 (by convention in many contexts), so true.\n    # Otherwise false.\n    if n == 0:\n        return x == 0 or x == 1\n    \n    # For x == 1:\n    if x == 1:\n        return True  # n**0 = 1 for any n\n    \n    # Now handle general case: find if there exists an integer k >= 0 such that n**k == x\n    # We can do this by repeatedly dividing x by n\n    if n == 1:\n        return x == 1  # 1**k = 1, so only x=1 works\n    \n    # For |n| > 1, we can check by repeated division\n    # Handle negative n: (-2)**2 = 4, (-2)**3 = -8, etc.\n    # Let's just try to find k such that n**k == x\n    \n    # Simple approach: iterate k from 0 upwards\n    k = 0\n    while True:\n        val = n ** k\n        if val == x:\n            return True\n        if abs(val) > abs(x) and abs(n) > 1:\n            return False\n        k += 1\n        if k > 100:  # Safety limit\n            return False", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [[1, 0]]}], "HumanEval/80": [{"task_id": "HumanEval/80", "solution": "def is_happy(s):\n    \"\"\"You are given a string s.\n    Your task is to check if the string is happy or not.\n    A string is happy if its length is at least 3 and every 3 consecutive letters are distinct\n    For example:\n    is_happy(a) => False\n    is_happy(aa) => False\n    is_happy(abcd) => True\n    is_happy(aabb) => False\n    is_happy(adb) => True\n    is_happy(xyy) => False\n    \"\"\"\n    if len(s) < 3:\n        return False\n    \n    for i in range(len(s) - 2):\n        # Check if three consecutive characters are distinct\n        if s[i] == s[i+1] or s[i] == s[i+2] or s[i+1] == s[i+2]:\n            return False\n    \n    return True", "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    \"\"\"It is the last week of the semester and the teacher has to give the grades\n    to students. The teacher has been making her own algorithm for grading.\n    The only problem is, she has lost the code she used for grading.\n    She has given you a list of GPAs for some students and you have to write \n    a function that can output a list of letter grades using the following table:\n             GPA       |    Letter grade\n              4.0                A+\n            > 3.7                A \n            > 3.3                A- \n            > 3.0                B+\n            > 2.7                B \n            > 2.3                B-\n            > 2.0                C+\n            > 1.7                C\n            > 1.3                C-\n            > 1.0                D+ \n            > 0.7                D \n            > 0.0                D-\n              0.0                E\n    \n\n    Example:\n    grade_equation([4.0, 3, 1.7, 2, 3.5]) ==> ['A+', 'B', 'C-', 'C', 'A-']\n    \"\"\"\n    result = []\n    for gpa in grades:\n        if gpa == 4.0:\n            result.append('A+')\n        elif gpa > 3.7:\n            result.append('A')\n        elif gpa > 3.3:\n            result.append('A-')\n        elif gpa > 3.0:\n            result.append('B+')\n        elif gpa > 2.7:\n            result.append('B')\n        elif gpa > 2.3:\n            result.append('B-')\n        elif gpa > 2.0:\n            result.append('C+')\n        elif gpa > 1.7:\n            result.append('C')\n        elif gpa > 1.3:\n            result.append('C-')\n        elif gpa > 1.0:\n            result.append('D+')\n        elif gpa > 0.7:\n            result.append('D')\n        elif gpa > 0.0:\n            result.append('D-')\n        else:\n            result.append('E')\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/82": [{"task_id": "HumanEval/82", "solution": "def prime_length(string):\n    \"\"\"Write a function that takes a string and returns True if the string\n    length is a prime number or False otherwise\n    Examples\n    prime_length('Hello') == True\n    prime_length('abcdcba') == True\n    prime_length('kittens') == True\n    prime_length('orange') == False\n    \"\"\"\n    length = len(string)\n    \n    if length < 2:\n        return False\n    \n    if length == 2:\n        return True\n    \n    if length % 2 == 0:\n        return False\n    \n    for i in range(3, int(length**0.5) + 1, 2):\n        if length % i == 0:\n            return False\n    \n    return True", "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    # Sum the digits of N (in decimal representation)\n    digit_sum = sum(int(d) for d in str(N))\n    \n    # Convert the sum to binary string (without '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/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    results = []\n    for row_idx, row in enumerate(lst):\n        for col_idx, val in enumerate(row):\n            if val == x:\n                results.append((row_idx, col_idx))\n    # Sort by row ascending, then by column descending\n    results.sort(key=lambda t: (t[0], -t[1]))\n    return results", "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\n    Examples:\n        add([4, 2, 6, 7]) ==> 2 \n    \"\"\"\n    total = 0\n    for i in range(1, len(lst), 2):  # odd indices: 1, 3, 5, ...\n        if lst[i] % 2 == 0:\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    # Get the first and last index values\n    first_val = array[0]\n    last_val = array[-1]\n    total = first_val + last_val\n    \n    # Create a copy of the array\n    sorted_array = sorted(array)\n    \n    # If sum is even, sort in descending order; if odd, ascending\n    if total % 2 == 0:\n        return sorted_array[::-1]\n    else:\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    # Split the string by spaces to preserve word boundaries and spaces\n    # We need to handle multiple spaces correctly\n    # Split by space, but we need to preserve the exact spacing\n    \n    # Let's process character by character to preserve spaces exactly\n    result = []\n    current_word = []\n    \n    for char in s:\n        if char == ' ':\n            # Process the current word if any\n            if current_word:\n                sorted_word = ''.join(sorted(current_word))\n                result.append(sorted_word)\n                current_word = []\n            result.append(' ')\n        else:\n            current_word.append(char)\n    \n    # Don't forget the last word\n    if current_word:\n        sorted_word = ''.join(sorted(current_word))\n        result.append(sorted_word)\n    \n    return ''.join(result)", "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 base (lowercase or uppercase)\n            if char.islower():\n                base = ord('a')\n            else:\n                base = ord('A')\n            # Shift by 4 (2 * 2)\n            shifted = (ord(char) - base + 4) % 26 + base\n            result.append(chr(shifted))\n        else:\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    # Get unique sorted values\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/93": [{"task_id": "HumanEval/93", "solution": "def encode(message):\n    \"\"\"\n    Write a function that takes a message, and encodes in such a \n    way that it swaps case of all letters, replaces all vowels in \n    the message with the letter that appears 2 places ahead of that \n    vowel in the english alphabet. \n    Assume only letters. \n    \n    Examples:\n    >>> encode('test')\n    'TGST'\n    >>> encode('This is a message')\n    'tHKS KS C MGSSCGG'\n    \"\"\"\n    vowels = 'aeiouAEIOU'\n    result = []\n    for char in message:\n        if char in vowels:\n            # Replace vowel with the letter 2 places ahead\n            # Determine if it's uppercase or lowercase\n            if char in 'aeiou':\n                # lowercase vowel\n                idx = 'aeiou'.index(char)\n                new_char = 'aeiou'[idx + 2] if idx + 2 < 5 else 'aeiou'[idx + 2 - 5]\n                # But we need to swap case after? No, the problem says:\n                # \"swaps case of all letters, replaces all vowels in the message with the letter that appears 2 places ahead of that vowel\"\n                # Let's re-read: it swaps case AND replaces vowels with letter 2 ahead.\n                # So for a vowel, we first replace it with the letter 2 ahead, then swap case?\n                # Or swap case first, then replace? Let's check the examples.\n                \n                # Example: 'test' -> 'TGST'\n                # t -> T (swap case), e -> g (e + 2 = g), s -> S (swap case), t -> T (swap case)\n                # So 'test' -> 'TGST'\n                # For 'e', it's a vowel. e + 2 = g. Then swap case of g -> G.\n                # So the process is: for each character, if it's a vowel, replace with letter 2 ahead, then swap case.\n                # If it's not a vowel, just swap case.\n                \n                # Let's verify with 'This is a message'\n                # T -> t (swap case, T is not vowel? Wait, T is not a vowel)\n                # h -> H (swap case)\n                # i -> k (i + 2 = k, then swap case -> K)\n                # s -> S (swap case)\n                # So 'This' -> 'tHKS'\n                # ' ' -> ' '\n                # 'i' -> 'k' (i + 2 = k, swap case -> K)\n                # 's' -> 'S'\n                # So 'is' -> 'KS'\n                # ' ' -> ' '\n                # 'a' -> 'c' (a + 2 = c, swap case -> C)\n                # ' ' -> ' '\n                # 'm' -> 'M'\n                # 'e' -> 'g' (e + 2 = g, swap case -> G)\n                # 's' -> 'S'\n                # 's' -> 'S'\n                # 'a' -> 'c' (a + 2 = c, swap case -> C)\n                # 'g' -> 'G'\n                # 'e' -> 'g' (e + 2 = g, swap case -> G)\n                # So 'message' -> 'MGSSCGG'\n                # Full: 'tHKS KS C MGSSCGG'\n                \n                # So the algorithm is:\n                # For each character:\n                #   If it's a vowel (case-insensitive), replace it with the letter 2 places ahead in the alphabet (preserving the original case's \"type\" but the new letter's case will be swapped).\n                #   Actually, let's think more carefully:\n                #   - If the character is a vowel, we first compute the letter 2 ahead, then swap its case.\n                #   - If the character is not a vowel, we just swap its case.\n                \n                # For lowercase vowel 'a': a + 2 = 'c', then swap case -> 'C'\n                # For uppercase vowel 'A': A + 2 = 'C', then swap case -> 'c'\n                \n                # Let's handle this properly.\n                if char in 'aeiou':\n                    # Get the letter 2 ahead\n                    new_char = chr(ord(char) + 2)\n                    # Swap case\n                    new_char = new_char.swapcase()\n                    result.append(new_char)\n                else:\n                    result.append(char.swapcase())\n            else:\n                # uppercase vowel\n                idx = 'AEIOU'.index(char)\n                new_char = 'AEIOU'[idx + 2] if idx + 2 < 5 else 'AEIOU'[idx + 2 - 5]\n                new_char = new_char.swapcase()\n                result.append(new_char)\n        else:\n            result.append(char.swapcase())\n    return ''.join(result)", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["TEST"]], "plus_fail_tests": [["ZYXWVUTSRQPONMLKJIHGFEDCBA"]]}], "HumanEval/91": [{"task_id": "HumanEval/91", "solution": "def is_bored(S):\n    \"\"\"\n    You'll be given a string of words, and your task is to count the number\n    of boredoms. A boredom is a sentence that starts with the word \"I\".\n    Sentences are delimited by '.', '?' or '!'.\n   \n    For example:\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    import re\n    \n    # Split the string into sentences using '.', '?', or '!' as delimiters\n    # We need to handle multiple delimiters and extract sentences\n    # Split by sentence boundaries: '.', '?', '!'\n    sentences = re.split(r'[.?!]', S)\n    \n    count = 0\n    for sentence in sentences:\n        # Strip whitespace from the sentence\n        stripped = sentence.strip()\n        if not stripped:\n            continue\n        # Check if the sentence starts with \"I\" as a word\n        # The first word should be exactly \"I\"\n        words = stripped.split()\n        if words and words[0] == \"I\":\n            count += 1\n    \n    return count", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["I"]]}], "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:\n        return False\n    \n    keys = dict.keys()\n    \n    # Check if all keys are strings\n    for key in keys:\n        if not isinstance(key, str):\n            return False\n    \n    # Now all keys are strings. Check if all are lowercase or all are uppercase.\n    all_lower = all(key == key.lower() for key in keys)\n    all_upper = all(key == key.upper() for key in keys)\n    \n    return all_lower or all_upper", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [[{"p": "pineapple", "5": "banana", "a": "apple"}]], "plus_fail_tests": [[{"1": "apple", "2": "banana", "3": "cherry"}]]}], "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    '''\n    # Check if all numbers are integers\n    if not (isinstance(x, int) and isinstance(y, int) and isinstance(z, int)):\n        return False\n    \n    # Check if one number is the sum of the other two\n    if x == y + z:\n        return True\n    if y == x + z:\n        return True\n    if z == x + y:\n        return True\n    \n    return False", "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 <= 2:\n        return []\n    \n    def is_prime(num):\n        if num < 2:\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\n    \n    primes = []\n    for num in range(2, n):\n        if is_prime(num):\n            primes.append(num)\n    return primes", "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    unit_a = abs(a) % 10\n    unit_b = abs(b) % 10\n    return unit_a * unit_b", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/94": [{"task_id": "HumanEval/94", "solution": "def skjkasdkd(lst):\n    \"\"\"You are given a list of integers.\n    You need to find the largest prime value and return the sum of its digits.\n\n    Examples:\n    For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10\n    For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should be 25\n    For lst = [1,3,1,32,5107,34,83278,109,163,23,2323,32,30,1,9,3] the output should be 13\n    For lst = [0,724,32,71,99,32,6,0,5,91,83,0,5,6] the output should be 11\n    For lst = [0,81,12,3,1,21] the output should be 3\n    For lst = [0,8,1,2,1,7] the output should be 7\n    \"\"\"\n    \n    def is_prime(n):\n        \"\"\"Check if a number is prime.\"\"\"\n        if n < 2:\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\n    \n    def sum_digits(n):\n        \"\"\"Return the sum of digits of a positive integer.\"\"\"\n        return sum(int(d) for d in str(abs(n)))\n    \n    # Find all primes in the list\n    primes = [x for x in lst if is_prime(x)]\n    \n    if not primes:\n        return 0\n    \n    # Find the largest prime\n    largest_prime = max(primes)\n    \n    # Return the sum of its digits\n    return sum_digits(largest_prime)", "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        # Single digit numbers: 1-9. Those that start or end with 1: just 1.\n        return 1\n    \n    # n-digit numbers range from 10^(n-1) to 10^n - 1\n    # Count numbers that start with 1:\n    #   First digit is 1, remaining n-1 digits can be anything (0-9)\n    #   So: 1 * 10^(n-1)\n    # Count numbers that end with 1:\n    #   Last digit is 1, first digit can be 1-9 (9 choices), middle n-2 digits can be 0-9\n    #   So: 9 * 10^(n-2)\n    # But we double-count numbers that both start AND end with 1:\n    #   First digit is 1, last digit is 1, middle n-2 digits can be anything\n    #   So: 1 * 10^(n-2)\n    # By inclusion-exclusion: start_with_1 + end_with_1 - both\n    # = 10^(n-1) + 9 * 10^(n-2) - 10^(n-2)\n    # = 10^(n-1) + 8 * 10^(n-2)\n    \n    if n == 1:\n        return 1\n    \n    start_with_1 = 10 ** (n - 1)\n    end_with_1 = 9 * (10 ** (n - 2))\n    both = 10 ** (n - 2)\n    \n    return start_with_1 + end_with_1 - both", "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    # Get the floor and ceiling\n    floor_val = int(num)\n    ceil_val = floor_val + 1\n    \n    # If num is exactly halfway between floor and ceil\n    # We need to round away from zero\n    \n    # Check if num is exactly at the midpoint\n    # The midpoint between floor_val and ceil_val is floor_val + 0.5\n    \n    # Calculate the distance to floor and ceil\n    diff_floor = abs(num - floor_val)\n    diff_ceil = abs(num - ceil_val)\n    \n    if diff_floor < diff_ceil:\n        return floor_val\n    elif diff_ceil < diff_floor:\n        return ceil_val\n    else:\n        # Equidistant: round away from zero\n        if num >= 0:\n            return ceil_val\n        else:\n            return floor_val", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["-15.5"]], "plus_fail_tests": [["-2.8"]]}], "HumanEval/101": [{"task_id": "HumanEval/101", "solution": "def words_string(s):\n    \"\"\"\n    You will be given a string of words separated by commas or spaces. Your task is\n    to split the string into words and return an array of the words.\n    \n    For example:\n    words_string(\"Hi, my name is John\") == [\"Hi\", \"my\", \"name\", \"is\", \"John\"]\n    words_string(\"One, two, three, four, five, six\") == [\"One\", \"two\", \"three\", \"four\", \"five\", \"six\"]\n    \"\"\"\n    # Replace commas with spaces, then split by whitespace\n    s = s.replace(',', ' ')\n    words = s.split()\n    return words", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    for i in range(0, len(s), 2):\n        if s[i] in uppercase_vowels:\n            count += 1\n    return count", "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    result = []\n    current = n\n    for i in range(n):\n        result.append(current)\n        if n % 2 == 1:\n            # Next odd number: add 2\n            current += 2\n        else:\n            # Next even number: add 2\n            current += 2\n    return result", "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    # Ensure x <= y\n    if x > y:\n        return -1\n    \n    # Start from y and go down to x to find the largest even number\n    for num in range(y, x - 1, -1):\n        if num % 2 == 0:\n            return num\n    \n    return -1", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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 integers from n to m (inclusive)\n    # Sum of arithmetic sequence: (n + m) * (m - n + 1) / 2\n    # Average = Sum / count = (n + m) / 2\n    # This is because the average of an arithmetic sequence is (first + last) / 2\n    \n    avg = (n + m) / 2.0\n    \n    # Round to the nearest integer\n    rounded = round(avg)\n    \n    # Convert to binary string with '0b' prefix\n    binary_str = bin(rounded)\n    \n    return binary_str", "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        # Check if all digits are odd\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    result.sort()\n    return result", "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    digit_names = {\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    # 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    filtered.sort()\n    \n    # Reverse the sorted array\n    filtered.reverse()\n    \n    # Replace each digit with its corresponding name\n    result = [digit_names[x] for x in filtered]\n    \n    return 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            # Even index: factorial of i\n            factorial = 1\n            for j in range(1, i + 1):\n                factorial *= j\n            result.append(factorial)\n        else:\n            # Odd index: sum of numbers from 1 to i\n            result.append(i * (i + 1) // 2)\n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/107": [{"task_id": "HumanEval/107", "solution": "def 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\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\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    def is_palindrome(num):\n        s = str(num)\n        return s == s[::-1]\n    \n    even_count = 0\n    odd_count = 0\n    \n    for i in range(1, n + 1):\n        if is_palindrome(i):\n            if i % 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/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            # Sum of digits of 0 is 0, which is not > 0\n            continue\n        if num < 0:\n            # For negative numbers, the first digit is negative\n            s = str(num)\n            # e.g., -123 -> digits are -1, 2, 3\n            # Remove the '-' sign\n            digits_str = s[1:]\n            first_digit = int(digits_str[0])\n            sum_digits = -first_digit\n            for ch in digits_str[1:]:\n                sum_digits += int(ch)\n        else:\n            s = str(num)\n            sum_digits = sum(int(ch) for ch in s)\n        if sum_digits > 0:\n            count += 1\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/109": [{"task_id": "HumanEval/109", "solution": "def move_one_ball(arr):\n    \"\"\"We have an array 'arr' of N integers arr[1], arr[2], ..., arr[N].The\n    numbers in the array will be randomly ordered. Your task is to determine if\n    it is possible to get an array sorted in non-decreasing order by performing \n    the following operation on the given array:\n        You are allowed to perform right shift operation any number of times.\n    \n    One right shift operation means shifting all elements of the array by one\n    position in the right direction. The last element of the array will be moved to\n    the starting position in the array i.e. 0th index. \n\n    If it is possible to obtain the sorted array by performing the above operation\n    then return True else return False.\n    If the given array is empty then return True.\n\n    Note: The given list is guaranteed to have unique elements.\n\n    For Example:\n    \n    move_one_ball([3, 4, 5, 1, 2])==>True\n    Explanation: By performin 2 right shift operations, non-decreasing order can\n                 be achieved for the given array.\n    move_one_ball([3, 5, 4, 1, 2])==>False\n    Explanation:It is not possible to get non-decreasing order for the given\n                array by performing any number of right shift operations.\n                \n    \"\"\"\n    if not arr:\n        return True\n    \n    n = len(arr)\n    # A right shift by k positions is equivalent to taking the last k elements\n    # and moving them to the front. So we need to check if any rotation of arr\n    # is sorted in non-decreasing order.\n    \n    # Since elements are unique, we can check for the number of \"drops\" (where\n    # arr[i] > arr[i+1]) in the circular array. For a sorted rotation, there\n    # should be at most one drop.\n    \n    drops = 0\n    for i in range(n):\n        if arr[i] > arr[(i + 1) % n]:\n            drops += 1\n        if drops > 1:\n            return False\n    \n    return True", "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 how many odd numbers are in lst1\n    odd_in_lst1 = sum(1 for x in lst1 if x % 2 != 0)\n    \n    # Count how many even numbers are in lst2\n    even_in_lst2 = sum(1 for x in lst2 if x % 2 == 0)\n    \n    # We need to replace all odd numbers in lst1 with even numbers from lst2\n    # So we need at least as many even numbers in lst2 as there are odd numbers in lst1\n    if even_in_lst2 >= odd_in_lst1:\n        return \"YES\"\n    else:\n        return \"NO\"", "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:\n        return {}\n    \n    # Split the string by spaces to get individual letters\n    letters = test.split()\n    \n    # Count occurrences of each letter\n    counts = {}\n    for letter in letters:\n        counts[letter] = counts.get(letter, 0) + 1\n    \n    # Find the maximum count\n    max_count = max(counts.values())\n    \n    # Return all letters with the maximum count\n    result = {letter: count for letter, count in counts.items() if count == 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    \"\"\"\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 remove from c\n    chars_to_remove = set(c)\n    \n    # Filter s to remove any character that is in chars_to_remove\n    result = ''.join(char for char in s if char not in chars_to_remove)\n    \n    # Check if the result is a palindrome\n    is_palindrome = result == result[::-1]\n    \n    return (result, is_palindrome)", "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        # Count the number of odd digits in the string\n        odd_count_num = 0\n        for ch in s:\n            digit = int(ch)\n            if digit % 2 == 1:\n                odd_count_num += 1\n        \n        # Replace all occurrences of 'i' with the count in the template string\n        template = \"the number of odd elements in the string i of the input.\"\n        # Replace 'i' with the count (as a string)\n        # But we need to replace all 'i' characters with the count\n        # The template has 'i' in several places: \"elements in the string i of the input.\"\n        # We need to replace each 'i' with the count\n        \n        # Let's build the result string by replacing 'i' with the count\n        # The template: \"the number of odd elements in the string i of the input.\"\n        # Replace 'i' with str(odd_count_num)\n        new_s = template.replace('i', str(odd_count_num))\n        result.append(new_s)\n    \n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/116": [{"task_id": "HumanEval/116", "solution": "def sort_array(arr):\n    \"\"\"\n    In this Kata, you have to sort an array of non-negative integers according to\n    number of ones in their binary representation in ascending order.\n    For similar number of ones, sort based on decimal value.\n\n    It must be implemented like this:\n    >>> sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n    >>> sort_array([-2, -3, -4, -5, -6]) == [-6, -5, -4, -3, -2]\n    >>> sort_array([1, 0, 2, 3, 4]) [0, 1, 2, 3, 4]\n    \"\"\"\n    # For non-negative integers, sort by number of 1s in binary representation,\n    # then by decimal value.\n    # For negative integers, the problem seems to just sort by decimal value.\n    # Looking at the examples:\n    # sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n    # 1: 1 -> 1 one\n    # 5: 101 -> 2 ones\n    # 2: 10 -> 1 one\n    # 3: 11 -> 2 ones\n    # 4: 100 -> 1 one\n    # Sorted by ones: 1 (1), 2 (1), 4 (1), 3 (2), 5 (2)\n    # Then by decimal: 1, 2, 4, 3, 5 -> but expected is [1, 2, 3, 4, 5]\n    # Wait, let me re-check:\n    # 1: bin '1' -> 1 one\n    # 2: bin '10' -> 1 one\n    # 3: bin '11' -> 2 ones\n    # 4: bin '100' -> 1 one\n    # 5: bin '101' -> 2 ones\n    # Group by ones:\n    # 1 one: 1, 2, 4 -> sorted by value: 1, 2, 4\n    # 2 ones: 3, 5 -> sorted by value: 3, 5\n    # Result: [1, 2, 4, 3, 5]\n    # But expected is [1, 2, 3, 4, 5]\n    # Hmm, that doesn't match. Let me re-read the problem.\n    \n    # Actually, looking more carefully at the example:\n    # sort_array([1, 5, 2, 3, 4]) == [1, 2, 3, 4, 5]\n    # This is just sorted by decimal value. But the problem says sort by number of ones.\n    # Let me check if maybe the example is wrong, or I'm misunderstanding.\n    \n    # Wait, maybe for this specific case, sorting by ones then by value gives [1, 2, 4, 3, 5],\n    # but the expected output is [1, 2, 3, 4, 5]. These don't match unless...\n    \n    # Let me re-examine: perhaps the problem statement's example is just showing a simple case\n    # where the result happens to be the same as sorted by value? No, [1, 2, 4, 3, 5] != [1, 2, 3, 4, 5].\n    \n    # I think there might be an error in the example. Let me implement according to the specification:\n    # Sort by number of 1s in binary, then by decimal value.\n    \n    def count_ones(n):\n        \"\"\"Count the number of 1s in the binary representation of a non-negative integer.\"\"\"\n        return bin(n).count('1')\n    \n    # Separate negative and non-negative numbers\n    negatives = [x for x in arr if x < 0]\n    non_negatives = [x for x in arr if x >= 0]\n    \n    # Sort non-negatives by number of 1s, then by value\n    non_negatives.sort(key=lambda x: (count_ones(x), x))\n    \n    # For negatives, just sort by decimal value (as per the example)\n    negatives.sort()\n    \n    return negatives + non_negatives", "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\n    \n    min_sum = nums[0]\n    current_sum = nums[0]\n    \n    for i in range(1, len(nums)):\n        # Either extend the previous subarray or start a new one at current element\n        current_sum = min(nums[i], current_sum + nums[i])\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/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_drops = 0\n    for well in grid:\n        water_units = sum(well)\n        if water_units > 0:\n            # Number of bucket lowers needed for this well\n            drops = math.ceil(water_units / capacity)\n            total_drops += drops\n    return total_drops", "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    if len(word) < 3:\n        return \"\"\n    \n    vowels = set('aeiouAEIOU')\n    \n    # We need to find a vowel that is between two consonants, scanning from the right.\n    # \"Closest\" means the rightmost such vowel.\n    # The vowel cannot be at the beginning (index 0) or at the end (index len-1).\n    \n    # Iterate from right to left, starting from index len-2 down to 1\n    for i in range(len(word) - 2, 0, -1):\n        char = word[i]\n        if char in vowels:\n            # Check if the characters before and after are consonants\n            prev_char = word[i - 1]\n            next_char = word[i + 1]\n            # A consonant is a letter that is not a vowel\n            if prev_char not in vowels and next_char not in vowels:\n                return char\n    \n    return \"\"", "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, you have been tasked to implement \n    a function that returns a list of all words from string s that contain exactly \n    n consonants, in order these words appear in the string s.\n    If the string s is empty then the function should return an empty list.\n    Note: you may assume the input string contains only letters and spaces.\n    Examples:\n    select_words(\"Mary had a little lamb\", 4) ==> [\"little\"]\n    select_words(\"Mary had a little lamb\", 3) ==> [\"Mary\", \"lamb\"]\n    select_words(\"simple white space\", 2) ==> []\n    select_words(\"Hello world\", 4) ==> [\"world\"]\n    select_words(\"Uncle sam\", 3) ==> [\"Uncle\"]\n    \"\"\"\n    if not s:\n        return []\n    \n    vowels = set('aeiouAEIOU')\n    \n    def count_consonants(word):\n        count = 0\n        for char in word:\n            if char.isalpha() and char not in vowels:\n                count += 1\n        return count\n    \n    words = s.split()\n    result = []\n    for word in words:\n        if count_consonants(word) == n:\n            result.append(word)\n    \n    return result", "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    # Try both concatenation orders\n    s1, s2 = lst[0], lst[1]\n    \n    # Check if s1 + s2 is balanced\n    if is_balanced(s1 + s2):\n        return 'Yes'\n    \n    # Check if s2 + s1 is balanced\n    if is_balanced(s2 + s1):\n        return 'Yes'\n    \n    return 'No'\ndef is_balanced(s):\n    \"\"\"Check if a string of parentheses is balanced.\"\"\"\n    count = 0\n    for char in s:\n        if char == '(':\n            count += 1\n        elif char == ')':\n            count -= 1\n        # If count goes negative, it's unbalanced\n        if count < 0:\n            return False\n    return count == 0", "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\n        Input: arr = [-3, -4, 5], k = 3\n        Output: [-4, -3, 5]\n\n    Example 2:\n\n        Input: arr = [4, -4, 4], k = 2\n        Output: [4, 4]\n\n    Example 3:\n\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    # Sort the array in descending order and take the top k elements\n    sorted_arr = sorted(arr, reverse=True)\n    top_k = sorted_arr[:k]\n    # Return them in sorted (ascending) order\n    return sorted(top_k)", "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\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(0, len(lst), 2):  # even positions: 0, 2, 4, ...\n        if lst[i] % 2 != 0:  # odd element\n            total += lst[i]\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/124": [{"task_id": "HumanEval/124", "solution": "def valid_date(date):\n    \"\"\"You have to write a function which validates a given date string and\n    returns True if the date is valid otherwise False.\n    The date is valid if all of the following rules are satisfied:\n    1. The date string is not empty.\n    2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,8,10,12. And the number of days is not less than 1 or higher than 30 days for months 4,6,9,11. And, the number of days is not less than 1 or higher than 29 for the month 2.\n    3. The months should not be less than 1 or higher than 12.\n    4. The date should be in the format: mm-dd-yyyy\n\n    for example: \n    valid_date('03-11-2000') => True\n\n    valid_date('15-01-2012') => False\n\n    valid_date('04-0-2040') => False\n\n    valid_date('06-04-2020') => True\n\n    valid_date('06/04/2020') => False\n    \"\"\"\n    # Rule 1: The date string is not empty\n    if not date:\n        return False\n    \n    # Rule 4: The date should be in the format: mm-dd-yyyy\n    # Split by '-'\n    parts = date.split('-')\n    if len(parts) != 3:\n        return False\n    \n    mm_str, dd_str, yyyy_str = parts\n    \n    # Check that each part is a valid number string (digits only)\n    if not mm_str.isdigit() or not dd_str.isdigit() or not yyyy_str.isdigit():\n        return False\n    \n    # Check that the format is exactly mm-dd-yyyy (two digits for month, two for day, four for year)\n    if len(mm_str) != 2 or len(dd_str) != 2 or len(yyyy_str) != 4:\n        return False\n    \n    # Convert to integers\n    try:\n        mm = int(mm_str)\n        dd = int(dd_str)\n        yyyy = int(yyyy_str)\n    except ValueError:\n        return False\n    \n    # Rule 3: The months should not be less than 1 or higher than 12\n    if mm < 1 or mm > 12:\n        return False\n    \n    # Rule 2: Check days based on month\n    # Months with 31 days: 1, 3, 5, 7, 8, 10, 12\n    # Months with 30 days: 4, 6, 9, 11\n    # Month 2: 29 days (but we need to check for leap year for February)\n    \n    if mm in [1, 3, 5, 7, 8, 10, 12]:\n        if dd < 1 or dd > 31:\n            return False\n    elif mm in [4, 6, 9, 11]:\n        if dd < 1 or dd > 30:\n            return False\n    elif mm == 2:\n        # Check for leap year\n        is_leap = (yyyy % 4 == 0 and yyyy % 100 != 0) or (yyyy % 400 == 0)\n        max_days = 29 if is_leap else 28\n        if dd < 1 or dd > max_days:\n            return False\n    \n    return True", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["02-29-2021"]]}], "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    odd_numbers = []\n    current = n\n    \n    while current != 1:\n        if current % 2 == 1:\n            odd_numbers.append(current)\n        if current % 2 == 0:\n            current = current // 2\n        else:\n            current = 3 * current + 1\n    \n    # Don't forget to add 1 if it's odd (which it always is)\n    if 1 % 2 == 1:\n        odd_numbers.append(1)\n    \n    # Sort in increasing order\n    odd_numbers.sort()\n    \n    return odd_numbers", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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 i in range(k):\n        num = arr[i]\n        # Check if the number has at most two digits\n        # A number has at most two digits if its absolute value is less than 100\n        abs_num = abs(num)\n        if abs_num < 100:\n            total += num\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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 are whitespaces\n    if ' ' in txt:\n        return txt.split()\n    \n    # Check if there are commas\n    if ',' in txt:\n        return txt.split(',')\n    \n    # No whitespaces and no commas: count lowercase letters with odd order in alphabet\n    # ord('a') = 0, ord('b') = 1, ..., ord('z') = 25\n    # Odd order means: ord(c) - ord('a') is odd\n    count = 0\n    for char in txt:\n        if 'a' <= char <= 'z':\n            order = ord(char) - ord('a')\n            if order % 2 == 1:\n                count += 1\n    return count", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    if len(lst) <= 1:\n        return True\n    \n    # Check if sorted in ascending order\n    for i in range(1, len(lst)):\n        if lst[i] < lst[i-1]:\n            return False\n    \n    # Check for duplicates: if any number appears more than 2 times, return False\n    from collections import Counter\n    counts = Counter(lst)\n    for count in counts.values():\n        if count > 2:\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 intersection(interval1, interval2):\n    \"\"\"You are given two intervals,\n    where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).\n    The given intervals are closed which means that the interval (start, end)\n    includes both start and end.\n    For each given interval, it is assumed that its start is less or equal its end.\n    Your task is to determine whether the length of intersection of these two \n    intervals is a prime number.\n    Example, the intersection of the intervals (1, 3), (2, 4) is (2, 3)\n    which its length is 1, which not a prime number.\n    If the length of the intersection is a prime number, return \"YES\",\n    otherwise, return \"NO\".\n    If the two intervals don't intersect, return \"NO\".\n\n\n    [input/output] samples:\n    intersection((1, 2), (2, 3)) ==> \"NO\"\n    intersection((-1, 1), (0, 4)) ==> \"NO\"\n    intersection((-3, -1), (-5, 5)) ==> \"YES\"\n    \"\"\"\n    \n    def is_prime(n):\n        \"\"\"Check if a number is prime.\"\"\"\n        if n < 2:\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\n    \n    # Find the intersection of the two intervals\n    start1, end1 = interval1\n    start2, end2 = interval2\n    \n    # The intersection is [max(start1, start2), min(end1, end2)]\n    inter_start = max(start1, start2)\n    inter_end = min(end1, end2)\n    \n    # Check if the intervals intersect\n    if inter_start > inter_end:\n        return \"NO\"\n    \n    # Calculate the length of the intersection\n    # The length is defined as end - start (as in the example: (2,3) has length 1)\n    length = inter_end - inter_start\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": "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    # Calculate the product of signs\n    sign_product = 1\n    has_zero = False\n    \n    for num in arr:\n        if num == 0:\n            has_zero = True\n            sign_product = 0\n            break\n        elif num < 0:\n            sign_product *= -1\n    \n    # If there's a zero, the product of signs is 0, so result is 0\n    if has_zero:\n        return 0\n    \n    # Sum of magnitudes\n    sum_magnitudes = sum(abs(num) for num in arr)\n    \n    # Multiply by the product of signs\n    return sign_product * sum_magnitudes", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/129": [{"task_id": "HumanEval/129", "solution": "def 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    Examples:\n\n        Input: grid = [ [1,2,3], [4,5,6], [7,8,9]], k = 3\n        Output: [1, 2, 1]\n\n        Input: grid = [ [5,9,3], [4,1,6], [7,8,2]], k = 1\n        Output: [1]\n    \"\"\"\n    N = len(grid)\n    \n    # For k=1, the answer is simply the minimum value in the grid, which is 1.\n    # But we need to return the path, which is just [1].\n    if k == 1:\n        return [1]\n    \n    # We need to find the lexicographically smallest path of length k.\n    # A path is a sequence of k cells where consecutive cells are adjacent (share an edge).\n    # The path is represented by the sequence of values in those cells.\n    \n    # Approach: Use BFS/priority queue based on the lexicographic order.\n    # Since k can be large, we need an efficient approach.\n    \n    # Key insight: The first element of the path determines the starting cell.\n    # To minimize lexicographically, we want the smallest possible first element.\n    # The smallest value in the grid is 1. So the first element of the optimal path\n    # must be 1 (since 1 is the smallest possible value, any path starting with 1\n    # is lexicographically smaller than any path starting with a value > 1).\n    \n    # Wait, but what if there are multiple cells with value 1? No, every integer\n    # in [1, N*N] appears exactly once. So there's exactly one cell with value 1.\n    \n    # So the first element of the minimum path is always 1.\n    # Find the position of 1 in the grid.\n    \n    # Find position of 1\n    start_pos = None\n    for r in range(N):\n        for c in range(N):\n            if grid[r][c] == 1:\n                start_pos = (r, c)\n                break\n        if start_pos:\n            break\n    \n    # Now, from the starting cell (where value is 1), we need to find a path of length k\n    # that is lexicographically smallest.\n    \n    # This is a shortest path problem in a graph where nodes are (row, col, steps_taken)\n    # and we want the lexicographically smallest sequence of values.\n    \n    # We can use dynamic programming or BFS with priority.\n    # Since k can be large, let's think about it.\n    \n    # For each step, we choose the next cell such that the value is minimized,\n    # but we also need to consider future steps. However, since we want the\n    # lexicographically smallest path, we should greedily pick the smallest\n    # next value at each step? Not necessarily, because a larger value now\n    # might allow a much smaller value later. But lexicographic order means\n    # the first difference matters most.\n    \n    # Actually, for lexicographic order, we want to minimize the first element,\n    # then the second, etc. Since the first element is fixed (1), we then want\n    # to minimize the second element, then the third, etc.\n    \n    # So we can use a BFS-like approach where at each step, we explore all\n    # possible next cells, and we keep track of the best path found so far.\n    \n    # But k can be large. Let's think about the constraints.\n    # The problem doesn't specify constraints on N and k, but let's assume\n    # they are reasonable.\n    \n    # Approach: Use Dijkstra-like algorithm where the \"distance\" is the\n    # lexicographic order of the path. We use a priority queue.\n    \n    # State: (row, col, steps_taken)\n    # Priority: the path so far (as a tuple of values)\n    \n    # Since we start from the cell with value 1, the first element is 1.\n    \n    import heapq\n    \n    # Priority queue: (path_so_far, row, col, steps_taken)\n    # path_so_far is a tuple of values\n    \n    # Start from the cell with value 1\n    sr, sc = start_pos\n    \n    # Initial path: (1,)\n    # Priority queue entries: (path_tuple, r, c, steps)\n    pq = [( (grid[sr][sc],), sr, sc, 1 )]\n    \n    # We need to find the lexicographically smallest path of length k.\n    # Since paths can revisit cells, there's no simple DP.\n    \n    # For small k, we can just do BFS. For large k, this might be slow.\n    # Let's assume k is not too large.\n    \n    while pq:\n        path, r, c, steps = heapq.heappop(pq)\n        \n        if steps == k:\n            return list(path)\n        \n        # Explore neighbors\n        for dr, dc in [(-1, 0), (1, 0), (0, -1), (0, 1)]:\n            nr, nc = r + dr, c + dc\n            if 0 <= nr < N and 0 <= nc < N:\n                new_path = path + (grid[nr][nc],)\n                heapq.heappush(pq, (new_path, nr, nc, steps + 1))\n    \n    return []", "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\n    \"\"\"\n    total = 0\n    for num in lst:\n        # Round up to the nearest integer (ceiling)\n        ceiling_val = math.ceil(num)\n        total += ceiling_val ** 2\n    return total", "base_status": "pass", "plus_status": "pass", "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    for digit in str(n):\n        d = int(digit)\n        if d % 2 == 1:\n            product *= d\n            has_odd = True\n    if not has_odd:\n        return 0\n    return product", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    # Strip trailing spaces\n    stripped = txt.rstrip(' ')\n    \n    if not stripped:\n        return False\n    \n    # Get the last character\n    last_char = stripped[-1]\n    \n    # Check if it's an alphabetical character\n    if not last_char.isalpha():\n        return False\n    \n    # Check if it's the last character of a word (i.e., not followed by more letters in the same word)\n    # Since we stripped trailing spaces, the last character is the end of the last word.\n    # We need to check that this last character is not part of a longer word.\n    # Actually, the condition is: the last character is an alphabetical character and is not a part of a word.\n    # Wait, re-reading: \"is an alphabetical character and is not a part of a word\"\n    # This seems contradictory. Let me re-read the examples.\n    \n    # \"apple pie\" -> False: last char is 'e', which is part of the word \"pie\"\n    # \"apple pi e\" -> True: last char is 'e', which is a word by itself (separated by space)\n    # \"apple pi e \" -> False: after stripping, last char is 'e', but there's a trailing space, so it's not the end of a word? \n    # Wait, \"apple pi e \" has a trailing space. After rstrip, it becomes \"apple pi e\". The last char is 'e'.\n    # But the expected output is False. So what's the difference between \"apple pi e\" and \"apple pi e \"?\n    \n    # Let me think again. The problem says \"is not a part of a word\". \n    # In \"apple pi e\", 'e' is a word by itself (a single-letter word). Is a single-letter word considered \"a part of a word\"?\n    # The key insight: \"is not a part of a word\" might mean the character stands alone as a word, not embedded within a larger word.\n    \n    # Let me re-interpret: The last character should be an alphabetical character that forms its own word (i.e., it's separated by spaces on both sides, or it's the only character).\n    \n    # For \"apple pie\": last char 'e' is part of \"pie\" -> False\n    # For \"apple pi e\": last char 'e' is a standalone word -> True\n    # For \"apple pi e \": after stripping, same as above, but expected False. Hmm.\n    \n    # Wait, maybe the trailing space matters. Let me reconsider without stripping.\n    \n    # \"apple pi e \" - the last character is ' ' (space), so it's not alphabetical -> False. That makes sense!\n    # \"apple pi e\" - the last character is 'e', which is alphabetical. Is it a part of a word? It's a word by itself.\n    # \"apple pie\" - the last character is 'e', which is part of the word \"pie\".\n    \n    # So the logic is:\n    # 1. The last character of the original string (not stripped) must be an alphabetical character.\n    # 2. That character must not be part of a word (i.e., it must be a standalone word).\n    \n    # For a character to be a standalone word, it must be preceded by a space (or be the first character), and it's the last character.\n    \n    # Let's check:\n    # \"apple pie\" -> last char 'e'. Is it preceded by a space? The string before 'e' is \"apple pie\". The character before 'e' is 'i', not a space. So 'e' is part of \"pie\". -> False\n    # \"apple pi e\" -> last char 'e'. The character before 'e' is ' ' (space). So 'e' is a standalone word. -> True\n    # \"apple pi e \" -> last char is ' ' (space), not alphabetical. -> False\n    # \"\" -> empty. -> False\n    \n    # So the algorithm:\n    # 1. If the string is empty, return False.\n    # 2. If the last character is not an alphabetical character, return False.\n    # 3. If the last character is an alphabetical character, check if it's a standalone word.\n    #    - It's a standalone word if either:\n    #      a) The string has only one character (and it's alphabetical), OR\n    #      b) The character immediately before the last character is a space.\n    \n    if len(txt) == 1:\n        return txt[0].isalpha()\n    \n    # Check if the character before the last character is a space\n    if txt[-2] == ' ':\n        return last_char.isalpha()\n    else:\n        return False", "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    # We need to find the largest index i such that arr[i] < arr[i-1]\n    # (i.e., the element is not greater than or equal to the preceding element)\n    # Since there are no duplicates, \"not greater than or equal\" means strictly less than.\n    \n    result = -1\n    for i in range(1, len(arr)):\n        if arr[i] < arr[i - 1]:\n            result = i\n    return result", "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    # A valid subsequence of brackets means a substring that is a valid bracket sequence.\n    # \"At least one bracket in the subsequence is nested\" means that within that valid\n    # bracket sequence, there is at least one pair of brackets that contains another pair.\n    # In other words, the valid bracket sequence has depth >= 2 somewhere.\n    \n    # We need to check if there exists ANY valid bracket subsequence (contiguous substring)\n    # that is balanced and has nesting (depth >= 2).\n    \n    # Approach: Check all substrings to see if any is a valid bracket sequence with depth >= 2.\n    # But that's O(n^3) which might be okay for reasonable string lengths.\n    \n    # Alternatively, we can think: a valid bracket sequence with nesting exists if and only\n    # if there is a substring that is a valid bracket sequence and contains \"[[\" or \"]]\" \n    # in a nested way. More precisely, if we find any valid bracket sequence that has depth >= 2.\n    \n    # Let's use a stack-based approach to find all valid bracket sequences and check if any has depth >= 2.\n    \n    # Actually, let's think differently. A valid bracket sequence with nesting means there's a pattern like \"[...[...]]...]\"\n    # where the inner brackets are inside outer brackets.\n    \n    # Simple approach: iterate over all possible substrings, check if it's a valid bracket sequence,\n    # and if so, check if it has depth >= 2.\n    \n    n = len(string)\n    \n    def is_valid_bracket_seq(s):\n        \"\"\"Check if s is a valid (balanced) bracket sequence.\"\"\"\n        stack = []\n        for ch in s:\n            if ch == '[':\n                stack.append(ch)\n            elif ch == ']':\n                if not stack:\n                    return False\n                stack.pop()\n        return len(stack) == 0\n    \n    def max_depth(s):\n        \"\"\"Find the maximum nesting depth of a valid bracket sequence.\"\"\"\n        depth = 0\n        max_d = 0\n        for ch in s:\n            if ch == '[':\n                depth += 1\n                max_d = max(max_d, depth)\n            elif ch == ']':\n                depth -= 1\n        return max_d\n    \n    # Check all substrings\n    for i in range(n):\n        for j in range(i + 1, n + 1):\n            substr = string[i:j]\n            if is_valid_bracket_seq(substr):\n                if max_depth(substr) >= 2:\n                    return True\n    \n    return False", "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_value(val):\n        \"\"\"Parse a value (int, float, or string) into a float for comparison.\"\"\"\n        if isinstance(val, str):\n            # Replace comma with dot for parsing\n            normalized = val.replace(',', '.')\n            return float(normalized)\n        else:\n            return float(val)\n    \n    val_a = parse_value(a)\n    val_b = parse_value(b)\n    \n    if val_a > val_b:\n        return a\n    elif val_b > val_a:\n        return b\n    else:\n        return 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    # All positive even numbers are >= 2\n    # So the minimum sum is 8\n    # Also, the sum of 4 even numbers is always even\n    # So n must be even and >= 8\n    \n    if n < 8:\n        return False\n    \n    # If n is even and >= 8, we can always write it as the sum of 4 positive even numbers\n    # For example: 2 + 2 + 2 + (n - 6) where n - 6 is even and >= 2 (since n >= 8)\n    # n - 6 >= 2 when n >= 8, and n - 6 is even when n is even\n    return n % 2 == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/140": [{"task_id": "HumanEval/140", "solution": "def 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    fix_spaces(\"Example\") == \"Example\"\n    fix_spaces(\"Example 1\") == \"Example_1\"\n    fix_spaces(\" Example 2\") == \"_Example_2\"\n    fix_spaces(\" Example   3\") == \"_Example-3\"\n    \"\"\"\n    import re\n    \n    # First, handle sequences of more than 2 consecutive spaces: replace them with '-'\n    # Then, replace remaining single spaces with '_'\n    \n    # Replace sequences of 3 or more spaces with '-'\n    result = re.sub(r' {3,}', '-', text)\n    # Replace remaining single spaces (1 or 2 consecutive) with '_'\n    result = re.sub(r' {1,2}', '_', result)\n    \n    return result", "base_status": "fail", "plus_status": "fail", "base_fail_tests": [["Yellow Yellow  Dirty  Fellow"]], "plus_fail_tests": [["  spaces  every  where  "]]}], "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 that there is exactly one dot\n    if file_name.count('.') != 1:\n        return 'No'\n    \n    # Split by the dot\n    parts = file_name.split('.')\n    if len(parts) != 2:\n        return 'No'\n    \n    name_part = parts[0]\n    extension_part = parts[1]\n    \n    # Check that the name part is not empty\n    if not name_part:\n        return 'No'\n    \n    # Check that the name part starts with a latin alphabet letter\n    if not name_part[0].isalpha() or not (name_part[0].isascii() and (name_part[0].islower() or name_part[0].isupper())):\n        return 'No'\n    \n    # Check that the extension is one of ['txt', 'exe', 'dll']\n    if extension_part not in ['txt', 'exe', 'dll']:\n        return 'No'\n    \n    # Count digits in the entire file name\n    digit_count = sum(1 for c in file_name if c.isdigit())\n    if digit_count > 3:\n        return 'No'\n    \n    return 'Yes'", "base_status": "pass", "plus_status": "fail", "base_fail_tests": [], "plus_fail_tests": [["\u00e9xample.exe"]]}], "HumanEval/130": [{"task_id": "HumanEval/130", "solution": "def tri(n):\n    \"\"\"Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in \n    the last couple centuries. However, what people don't know is Tribonacci sequence.\n    Tribonacci sequence is defined by the recurrence:\n    tri(1) = 3\n    tri(n) = 1 + n / 2, if n is even.\n    tri(n) =  tri(n - 1) + tri(n - 2) + tri(n + 1), if n is odd.\n    For example:\n    tri(2) = 1 + (2 / 2) = 2\n    tri(4) = 3\n    tri(3) = tri(2) + tri(1) + tri(4)\n           = 2 + 3 + 3 = 8 \n    You are given a non-negative integer number n, you have to a return a list of the \n    first n + 1 numbers of the Tribonacci sequence.\n    Examples:\n    tri(3) = [1, 3, 2, 8]\n    \"\"\"\n    if n == 0:\n        return [1]\n    \n    # We need to compute tri(0), tri(1), ..., tri(n)\n    # From the problem:\n    # tri(1) = 3\n    # tri(n) = 1 + n/2 if n is even\n    # tri(n) = tri(n-1) + tri(n-2) + tri(n+1) if n is odd\n    \n    # Wait, the recurrence for odd n depends on tri(n+1), which is a future value.\n    # This is tricky. Let's look at the examples:\n    # tri(3) = [1, 3, 2, 8]\n    # So tri(0) = 1, tri(1) = 3, tri(2) = 2, tri(3) = 8\n    \n    # Let's verify:\n    # tri(1) = 3 (given)\n    # tri(2) = 1 + 2/2 = 2 (even case)\n    # tri(4) = 1 + 4/2 = 3 (even case)\n    # tri(3) = tri(2) + tri(1) + tri(4) = 2 + 3 + 3 = 8 (odd case)\n    \n    # So for n=3, we need tri(0), tri(1), tri(2), tri(3).\n    # tri(0): The problem says \"first n+1 numbers\". For n=3, we return 4 numbers.\n    # The example shows tri(3) = [1, 3, 2, 8], so tri(0) = 1.\n    \n    # Let's figure out tri(0). The recurrence doesn't directly give tri(0).\n    # But from the example, tri(0) = 1.\n    \n    # For computing tri(n) when n is odd, we need tri(n+1). But tri(n+1) where n+1 is even,\n    # so tri(n+1) = 1 + (n+1)/2.\n    \n    # So for odd n: tri(n) = tri(n-1) + tri(n-2) + (1 + (n+1)/2)\n    \n    # Let's compute iteratively:\n    # We know tri(0) = 1 (from example)\n    # tri(1) = 3 (given)\n    # For n=2 (even): tri(2) = 1 + 2/2 = 2\n    # For n=3 (odd): tri(3) = tri(2) + tri(1) + tri(4). But tri(4) = 1 + 4/2 = 3. So tri(3) = 2 + 3 + 3 = 8.\n    \n    # So the approach:\n    # 1. Start with tri(0) = 1\n    # 2. tri(1) = 3\n    # 3. For each i from 2 to n:\n    #    if i is even: tri(i) = 1 + i // 2\n    #    if i is odd: tri(i) = tri(i-1) + tri(i-2) + (1 + (i+1) // 2)  [since i+1 is even]\n    \n    # Wait, let's re-read: tri(n) = 1 + n/2 if n is even. So for even n, it's straightforward.\n    # For odd n, tri(n) = tri(n-1) + tri(n-2) + tri(n+1). And since n+1 is even, tri(n+1) = 1 + (n+1)/2.\n    \n    # Let's implement this:\n    \n    result = [0] * (n + 1)\n    result[0] = 1\n    if n >= 1:\n        result[1] = 3\n    \n    for i in range(2, n + 1):\n        if i % 2 == 0:\n            result[i] = 1 + i // 2\n        else:\n            # i is odd, so i+1 is even\n            tri_i_plus_1 = 1 + (i + 1) // 2\n            result[i] = result[i-1] + result[i-2] + tri_i_plus_1\n    \n    return result", "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 i, val in enumerate(lst):\n        if i % 3 == 0:\n            total += val ** 2\n        elif i % 4 == 0:\n            total += val ** 3\n        else:\n            total += val\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/143": [{"task_id": "HumanEval/143", "solution": "def words_in_sentence(sentence):\n    \"\"\"\n    You are given a string representing a sentence,\n    the sentence contains some words separated by a space,\n    and you have to return a string that contains the words from the original sentence,\n    whose lengths are prime numbers,\n    the order of the words in the new string should be the same as the original one.\n\n    Example 1:\n        Input: sentence = \"This is a test\"\n        Output: \"is\"\n\n    Example 2:\n        Input: sentence = \"lets go for swimming\"\n        Output: \"go for\"\n\n    Constraints:\n        * 1 <= len(sentence) <= 100\n        * sentence contains only letters\n    \"\"\"\n    def is_prime(n):\n        if n < 2:\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\n    \n    words = sentence.split()\n    result = [word for word in words if is_prime(len(word))]\n    return ' '.join(result)", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/144": [{"task_id": "HumanEval/144", "solution": "def simplify(x, n):\n    \"\"\"Your task is to implement a function that will simplify the expression\n    x * n. The function returns True if x * n evaluates to a whole number and False\n    otherwise. Both x and n, are string representation of a fraction, and have the following format,\n    <numerator>/<denominator> where both numerator and denominator are positive whole numbers.\n\n    You can assume that x, and n are valid fractions, and do not have zero as denominator.\n\n    simplify(\"1/5\", \"5/1\") = True\n    simplify(\"1/6\", \"2/1\") = False\n    simplify(\"7/10\", \"10/2\") = False\n    \"\"\"\n    # Parse x\n    x_num, x_den = map(int, x.split('/'))\n    # Parse n\n    n_num, n_den = map(int, n.split('/'))\n    \n    # Compute x * n = (x_num * n_num) / (x_den * n_den)\n    numerator = x_num * n_num\n    denominator = x_den * n_den\n    \n    # Check if the result is a whole number: numerator % denominator == 0\n    return numerator % denominator == 0", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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        \"\"\"Calculate the sum of digits of an integer, treating negative sign separately.\"\"\"\n        if n < 0:\n            return -int(str(n)[1:])  # Negative of the digit sum of absolute value\n        else:\n            return sum(int(d) for d in str(n))\n    \n    # Create a list of (digit_sum, index, value) tuples\n    indexed_nums = [(digit_sum(n), i, n) for i, n in enumerate(nums)]\n    \n    # Sort by digit_sum first, then by original index\n    indexed_nums.sort(key=lambda x: (x[0], x[1]))\n    \n    # Extract the sorted values\n    return [x[2] for x 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/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    def get_first_and_last_digits(n):\n        # Work with absolute value for digit extraction\n        abs_n = abs(n)\n        if abs_n == 0:\n            return 0, 0\n        # Get last digit\n        last_digit = abs_n % 10\n        # Get first digit\n        while abs_n >= 10:\n            abs_n //= 10\n        first_digit = abs_n\n        return first_digit, last_digit\n    \n    count = 0\n    for num in nums:\n        if num > 10:\n            first_digit, last_digit = get_first_and_last_digits(num)\n            # Check if both first and last digits are odd\n            if first_digit % 2 != 0 and last_digit % 2 != 0:\n                count += 1\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 where a[i] = i*i - i + 1 for i from 1 to n\n    # Note: The problem uses 1-based indexing for i, so a[1] = 1*1 - 1 + 1 = 1\n    # a[2] = 4 - 2 + 1 = 3, a[3] = 9 - 3 + 1 = 7, etc.\n    \n    # We need to count triples (i, j, k) with 1 <= i < j < k <= n such that\n    # a[i] + a[j] + a[k] is divisible by 3.\n    \n    # Let's compute a[i] mod 3 for each i.\n    # a[i] = i^2 - i + 1\n    # Let's see what a[i] mod 3 is for different i mod 3:\n    # If i \u2261 0 (mod 3): i = 3m, a[i] = 9m^2 - 3m + 1 \u2261 1 (mod 3)\n    # If i \u2261 1 (mod 3): i = 3m+1, a[i] = (3m+1)^2 - (3m+1) + 1 = 9m^2 + 6m + 1 - 3m - 1 + 1 = 9m^2 + 3m + 1 \u2261 1 (mod 3)\n    # If i \u2261 2 (mod 3): i = 3m+2, a[i] = (3m+2)^2 - (3m+2) + 1 = 9m^2 + 12m + 4 - 3m - 2 + 1 = 9m^2 + 9m + 3 \u2261 0 (mod 3)\n    \n    # So:\n    # i \u2261 0 mod 3 => a[i] \u2261 1 mod 3\n    # i \u2261 1 mod 3 => a[i] \u2261 1 mod 3\n    # i \u2261 2 mod 3 => a[i] \u2261 0 mod 3\n    \n    # Let's count how many indices i (from 1 to n) have a[i] \u2261 0, 1, or 2 mod 3.\n    # From above, a[i] is either 0 or 1 mod 3, never 2.\n    \n    # Let c0 = count of i in [1, n] where a[i] \u2261 0 mod 3 (i.e., i \u2261 2 mod 3)\n    # Let c1 = count of i in [1, n] where a[i] \u2261 1 mod 3 (i.e., i \u2261 0 or 1 mod 3)\n    # Let c2 = count of i in [1, n] where a[i] \u2261 2 mod 3 (this is 0)\n    \n    # We need a[i] + a[j] + a[k] \u2261 0 mod 3.\n    # Since each a[i] is either 0 or 1 mod 3, the sum of three values can be:\n    # 0+0+0 = 0 \u2713\n    # 0+0+1 = 1 \u2717\n    # 0+1+1 = 2 \u2717\n    # 1+1+1 = 3 \u2261 0 \u2713\n    \n    # So valid triples are:\n    # 1. All three elements have a[i] \u2261 0 mod 3: choose 3 from c0 elements\n    # 2. All three elements have a[i] \u2261 1 mod 3: choose 3 from c1 elements\n    \n    # Count c0: number of i in [1, n] where i \u2261 2 mod 3\n    # Count c1: number of i in [1, n] where i \u2261 0 or 1 mod 3\n    \n    c0 = 0  # count of i where i % 3 == 2\n    c1 = 0  # count of i where i % 3 == 0 or i % 3 == 1\n    \n    for i in range(1, n + 1):\n        if i % 3 == 2:\n            c0 += 1\n        else:\n            c1 += 1\n    \n    # Number of ways to choose 3 from c0: C(c0, 3)\n    # Number of ways to choose 3 from c1: C(c1, 3)\n    \n    def comb3(x):\n        if x < 3:\n            return 0\n        return x * (x - 1) * (x - 2) // 6\n    \n    return comb3(c0) + comb3(c1)", "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 closerst 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 indices\n    idx1 = planets.index(planet1)\n    idx2 = planets.index(planet2)\n    \n    # Determine the range between the two planets\n    if idx1 < idx2:\n        # Planets between planet1 and planet2 (exclusive)\n        result = planets[idx1 + 1:idx2]\n    else:\n        # planet1 is farther from sun than planet2\n        result = planets[idx2 + 1:idx1]\n    \n    return tuple(result)", "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    # Sort by length first, then alphabetically\n    filtered.sort(key=lambda s: (len(s), s))\n    return filtered", "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        # Ignore numbers that are not integers (e.g., floats like 1.5)\n        if not isinstance(num, int):\n            continue\n        # Ignore negative numbers\n        if num < 0:\n            continue\n        # Check if the number is odd\n        if num % 2 == 1:\n            total += num ** 2\n    return total", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/150": [{"task_id": "HumanEval/150", "solution": "def x_or_y(n, x, y):\n    \"\"\"A simple program which should return the value of x if n is \n    a prime number and should return the value of y otherwise.\n\n    Examples:\n    for x_or_y(7, 34, 12) == 34\n    for x_or_y(15, 8, 5) == 5\n    \n    \"\"\"\n    def is_prime(num):\n        if num < 2:\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\n    \n    if is_prime(n):\n        return x\n    else:\n        return y", "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    \"\"\"You will be given the name of a class (a string) and a list of extensions.\n    The extensions are to be used to load additional classes to the class. The\n    strength of the extension is as follows: Let CAP be the number of the uppercase\n    letters in the extension's name, and let SM be the number of lowercase letters \n    in the extension's name, the strength is given by the fraction CAP - SM. \n    You should find the strongest extension and return a string in this \n    format: ClassName.StrongestExtensionName.\n    If there are two or more extensions with the same strength, you should\n    choose the one that comes first in the list.\n    For example, if you are given \"Slices\" as the class and a list of the\n    extensions: ['SErviNGSliCes', 'Cheese', 'StuFfed'] then you should\n    return 'Slices.SErviNGSliCes' since 'SErviNGSliCes' is the strongest extension \n    (its strength is -1).\n    Example:\n    for Strongest_Extension('my_class', ['AA', 'Be', 'CC']) == 'my_class.AA'\n    \"\"\"\n    best_extension = None\n    best_strength = None\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 best_strength is None or strength > best_strength:\n            best_strength = strength\n            best_extension = ext\n    \n    return f\"{class_name}.{best_extension}\"", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/152": [{"task_id": "HumanEval/152", "solution": "def compare(game, guess):\n    \"\"\"I think we all remember that feeling when the result of some long-awaited\n    event is finally known. The feelings and thoughts you have at that moment are\n    definitely worth noting down and comparing.\n    Your task is to determine if a person correctly guessed the results of a number of matches.\n    You are given two arrays of scores and guesses of equal length, where each index shows a match. \n    Return an array of the same length denoting how far off each guess was. If they have guessed correctly,\n    the value is 0, and if not, the value is the absolute difference between the guess and the score.\n    \n    \n    example:\n\n    compare([1,2,3,4,5,1],[1,2,3,4,2,-2]) -> [0,0,0,0,3,3]\n    compare([0,5,0,0,0,4],[4,1,1,0,0,-2]) -> [4,4,1,0,0,6]\n    \"\"\"\n    return [abs(g - gu) for g, gu in zip(game, guess)]", "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    \"\"\"You are given 2 words. You need to return True if the second word or any of its rotations is a substring in the first word\n    cycpattern_check(\"abcd\",\"abd\") => False\n    cycpattern_check(\"hello\",\"ell\") => True\n    cycpattern_check(\"whassup\",\"psus\") => False\n    cycpattern_check(\"abab\",\"baa\") => True\n    cycpattern_check(\"efef\",\"eeff\") => False\n    cycpattern_check(\"himenss\",\"simen\") => True\n\n    \"\"\"\n    if len(b) > len(a):\n        return False\n    \n    # Generate all rotations of b\n    n = len(b)\n    for i in range(n):\n        rotation = b[i:] + b[:i]\n        if rotation in a:\n            return True\n    \n    return False", "base_status": "pass", "plus_status": "fail", "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    # Convert the number to its absolute value to handle negative numbers\n    num_str = str(abs(num))\n    \n    even_count = 0\n    odd_count = 0\n    \n    for digit in num_str:\n        if digit.isdigit():\n            if int(digit) % 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/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    # Define the mapping of integers to Roman numeral symbols\n    # We need to handle subtractive notation by including those combinations\n    val_sym_pairs = [\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    result = []\n    for value, symbol in val_sym_pairs:\n        while number >= value:\n            result.append(symbol)\n            number -= value\n    \n    return ''.join(result).lower()", "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    # For each word, compute the number of unique characters\n    # Then find the maximum number of unique characters\n    # Among words with that maximum, pick the lexicographically smallest\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            # Pick lexicographically smaller one\n            if word < result:\n                result = word\n    \n    return result", "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    # Sort the sides so that the largest is last (potential hypotenuse)\n    sides = sorted([a, b, c])\n    # Check if it satisfies Pythagorean theorem: a^2 + b^2 = c^2\n    # Use a small epsilon for floating point comparison\n    epsilon = 1e-9\n    return abs(sides[0]**2 + sides[1]**2 - sides[2]**2) < epsilon", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "HumanEval/139": [{"task_id": "HumanEval/139", "solution": "def special_factorial(n):\n    \"\"\"The Brazilian factorial is defined as:\n    brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!\n    where n > 0\n\n    For example:\n    >>> special_factorial(4)\n    288\n\n    The function will receive an integer as input and should return the special\n    factorial of this integer.\n    \"\"\"\n    import math\n    \n    def factorial(k):\n        return math.factorial(k)\n    \n    result = 1\n    for i in range(1, n + 1):\n        result *= factorial(i)\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 algebric \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    array = [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    \"\"\"\n    # Build the expression by combining operands and operators\n    # We need to respect operator precedence: ** > * // > + -\n    # But the problem says to build the expression and evaluate it.\n    # Looking at the example: 2 + 3 * 4 - 5 = 2 + 12 - 5 = 9\n    # This suggests standard operator precedence.\n    \n    # Let's build a string expression and use eval, but we need to be careful.\n    # Alternatively, we can parse and evaluate respecting precedence.\n    \n    # Since the operators include ** (exponentiation), which has higher precedence than * and //,\n    # and * and // have higher precedence than + and -, we need to handle this properly.\n    \n    # Let's build the expression as a string and use eval.\n    # But we need to make sure the expression is valid.\n    \n    expr_parts = [str(operand[0])]\n    for i, op in enumerate(operator):\n        expr_parts.append(op)\n        expr_parts.append(str(operand[i + 1]))\n    \n    expr = ''.join(expr_parts)\n    \n    # Use eval to evaluate the expression\n    return eval(expr)", "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    # Determine how many carrots the rabbit can actually eat\n    if remaining >= need:\n        # Eat exactly 'need' carrots\n        total_eaten = number + need\n        left = remaining - need\n    else:\n        # Eat all remaining carrots\n        total_eaten = number + remaining\n        left = 0\n    \n    return [total_eaten, left]", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}], "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    # Check if the string contains any letters\n    has_letters = any(c.isalpha() for c in s)\n    \n    if not has_letters:\n        # Reverse the string if no letters\n        return s[::-1]\n    else:\n        # Reverse the case of each letter, keep non-letters as is\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        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 text == '':\n        return None\n    return hashlib.md5(text.encode('utf-8')).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 range\n    start = min(a, b)\n    end = max(a, b)\n    \n    # Collect all even digits from 0-9 that fall within the range [start, end]\n    # But wait, the examples suggest we're looking at single-digit even numbers\n    # between a and b, not digits of numbers.\n    # generate_integers(2, 8) => [2, 4, 6, 8] - these are even numbers from 2 to 8\n    # generate_integers(10, 14) => [] - even numbers from 10 to 14 are 10, 12, 14, but result is []\n    # Hmm, that doesn't match. Let me re-read.\n    \n    # \"return the even digits between a and b\"\n    # Looking at generate_integers(10, 14) => []\n    # If we look at digits of numbers from 10 to 14:\n    # 10: digits 1, 0 -> 0 is even\n    # 11: digits 1, 1 -> no even digits\n    # 12: digits 1, 2 -> 2 is even\n    # 13: digits 1, 3 -> no even digits\n    # 14: digits 1, 4 -> 4 is even\n    # So even digits found: 0, 2, 4. But result is [].\n    \n    # Wait, maybe \"even digits\" means even single-digit numbers (2, 4, 6, 8) that are between a and b?\n    # generate_integers(2, 8): even digits 2,4,6,8 are all in [2,8] -> [2,4,6,8]\n    # generate_integers(10, 14): even digits 2,4,6,8 - none are in [10,14] -> []\n    # That matches!\n    \n    # So we need to find all even single-digit numbers (0, 2, 4, 6, 8) that lie within [start, end]\n    even_digits = [0, 2, 4, 6, 8]\n    result = [d for d in even_digits if start <= d <= end]\n    \n    return result", "base_status": "pass", "plus_status": "pass", "base_fail_tests": [], "plus_fail_tests": []}]}, "pass_at_k": {"base": {"pass@1": 0.9634146341463414}, "plus": {"pass@1": 0.926829268292683}}}