Mbpp/472

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度800 字符
模型生成的代码 (800 字符)
def check_Consecutive(lst):
    """
    Check whether the given list contains consecutive integers.
    
    Consecutive integers mean that after sorting the list,
    the difference between any two adjacent elements is 1,
    and there are no duplicates.
    
    Args:
        lst (list of int): Input list of integers.
    
    Returns:
        bool: True if the list consists of consecutive integers,
              False otherwise.
    """
    if not lst:                     # empty list is vacuously consecutive
        return True
    if len(lst) == 1:               # single element list is trivially consecutive
        return True

    sorted_lst = sorted(lst)
    for i in range(1, len(sorted_lst)):
        if sorted_lst[i] - sorted_lst[i-1] != 1:
            return False
    return True
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试