Mbpp/161

⚠️ 仅 Base 通过 Base: PASS Plus: FAIL
测试评估
指标结果
Base 测试PASS
Plus 测试FAIL
代码长度691 字符
模型生成的代码 (691 字符)
def remove_elements(original_list, elements_to_remove):
    """
    Remove all elements from original_list that are present in elements_to_remove.
    
    Args:
        original_list: The list from which elements will be removed.
        elements_to_remove: The list containing elements to be removed from original_list.
        
    Returns:
        A new list with elements from original_list that are not in elements_to_remove.
    """
    # Convert elements_to_remove to a set for O(1) membership testing
    remove_set = set(elements_to_remove)
    
    # Build and return a new list with elements not in remove_set
    return [item for item in original_list if item not in remove_set]
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • [[1, 'apple', [1, 2], [3, 4], {'name': 'John'}, 5.5], [2, 'apple', [3, 4], {'name': 'John'}, 5.5]]