Mbpp/743

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度319 字符
模型生成的代码 (319 字符)
def rotate_right(lst, k):
    """
    Rotate the given list to the right by k positions.
    Returns a new list with the elements rotated.
    """
    if not lst:
        return lst
    n = len(lst)
    k = k % n
    # Slicing: last k elements moved to the front, rest after
    return lst[-k:] + lst[:-k] if k else lst
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试