Mbpp/730

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度363 字符
模型生成的代码 (363 字符)
def consecutive_duplicates(lst):
    """
    Removes consecutive duplicates from a list, preserving order.
    Returns a new list with only one occurrence of each consecutive group.
    """
    if not lst:
        return []
    result = [lst[0]]
    for i in range(1, len(lst)):
        if lst[i] != lst[i - 1]:
            result.append(lst[i])
    return result
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试