Mbpp/753

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度479 字符
模型生成的代码 (479 字符)
def min_k(tuple_list, k):
    """
    Find the minimum k records from a tuple list based on the second element.
    
    Parameters:
    tuple_list (list of tuples): The input list of tuples (name, value).
    k (int): The number of minimum records to return.
    
    Returns:
    list of tuples: The k smallest records sorted by value.
    """
    # Sort the list by the second element (value) and take the first k elements
    return sorted(tuple_list, key=lambda x: x[1])[:k]
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试