Mbpp/446

⚠️ 仅 Base 通过 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度488 字符
模型生成的代码 (488 字符)
def count_Occurrence(tup, lst):
    """
    Count the total number of times elements from `lst` appear in `tup`.
    
    Args:
        tup (tuple): The tuple to search in.
        lst (list): The list of elements to count.
    
    Returns:
        int: Total occurrences of all elements of `lst` in `tup`.
    """
    # Convert list to set for O(1) membership test
    valid = set(lst)
    count = 0
    for item in tup:
        if item in valid:
            count += 1
    return count
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [[1, 1, 1, 2, 2, 2, 3, 3, 3], [1, 1, 2, 2, 3, 3]]