测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 463 字符 |
模型生成的代码 (463 字符)
def rotate_right(lst, k):
"""
Rotates the given list to the right by k positions.
Args:
lst (list): The input list.
k (int): Number of positions to rotate to the right.
Returns:
list: A new list rotated to the right by k positions.
"""
if not lst:
return []
n = len(lst)
k %= n # Handle rotations larger than list length
if k == 0:
return lst[:]
return lst[-k:] + lst[:-k]
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试